Package: netcfg Version: 1.140 Severity: normal -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA256
Dear Maintainer, When using netcfg, without a wifi card, and dhcp configuration fails the presented options show an empty option 4 which is usually used for wifireconf. The reason behind it is that when templates potential answers are substituted, there ends up a ", ," for the option 4. I have moved all choices into two internal templates - one with wifi answer and one without. And substitute complete translation in. This doesn't change any template strings, nor results in any fuzzy translations, but does fix the above UX problem. debconf-updatepo has been ommitted from the patch for clarity. Regards, Dimitri. -----BEGIN PGP SIGNATURE----- Version: GnuPG v2 iQEcBAEBCAAGBQJYdQZnAAoJEMrC2LnNLKX5bsMIAK/UX3J6mVxOq0meixMlZxck X9Mm8npLX6xBbncMuUMOmRKALDWB4j4LMj2hcx3hES30RGzDt781CvBVdtODtMs2 +5SZlzouOxJ2L+KWYs5JNGYpH2LPZm0r3lF6s6AkYSfqP1/oX744ugsk8bv3dbkw be9S9wQDvHdu2bUQ7vS9oeuF+i/WwvLRKVAt3itkLtGrVzM/bNBPZgGpR6uWY4C3 NDiC5A1NUq+Z92wb/CtnWd8wpXGaMuZg8paRm5tT+gEPZF8PoMVUosNezDnZcry6 MgS5rLgGU2iLS2e+qAsWW5Apu5CzUaPCYiM9Si3JGhoWEbN0Aq8r6AyU2AKDXXk= =Y2sz -----END PGP SIGNATURE-----
>From 309bcd9bbb1ef3d47fcef01a607b7f5074bf18ff Mon Sep 17 00:00:00 2001 From: Dimitri John Ledkov <x...@ubuntu.com> Date: Tue, 10 Jan 2017 15:51:43 +0000 Subject: [PATCH] Do now show an empty option 4 when using netcfg, without a wifi-card, and when automatic configuration fails. This is achieved by substituting all choices into the question, from two internal select templates of identical options but wifireconf one. This resolves UX bug without changing translation strings or fuzzing any of the existing translations. --- debian/changelog | 12 ++++++++---- debian/netcfg-dhcp.templates | 19 ++++++++++++------- dhcp.c | 9 ++++----- 3 files changed, 24 insertions(+), 16 deletions(-) diff --git a/debian/changelog b/debian/changelog index bd3c5b9..f938dd6 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,2 +1,13 @@ + netcfg (1.141) UNRELEASED; urgency=medium + + * Do now show an empty option 4 when using netcfg, without a wifi-card, + and when automatic configuration fails. This is achieved by + substituting all choices into the question, from two internal select + templates of identical options but wifireconf one. This resolves UX + bug without changing translation strings or fuzzing any of the + existing translations. + + -- Dimitri John Ledkov <x...@ubuntu.com> Tue, 10 Jan 2017 15:47:43 +0000 + netcfg (1.140) unstable; urgency=medium diff --git a/debian/netcfg-dhcp.templates b/debian/netcfg-dhcp.templates index f725ad1..1ded476 100644 --- a/debian/netcfg-dhcp.templates +++ b/debian/netcfg-dhcp.templates @@ -33,11 +33,8 @@ _Description: No DHCP client found Template: netcfg/dhcp_options Type: select # :sl1: -# Note to translators : Please keep your translation -# below a 65 columns limit (which means 65 characters -# in single-byte languages) -#flag:translate!:4 -__Choices: Retry network autoconfiguration, Retry network autoconfiguration with a DHCP hostname, Configure network manually, ${wifireconf}, Do not configure the network at this time +#flag:translate!:1 +__Choices: ${choices} Default: Configure network manually # :sl1: _Description: Network configuration method: @@ -68,10 +65,18 @@ _Description: Continue without a default route? If you are unsure, you should not continue without a default route: contact your local network administrator about this problem. +Template: netcfg/internal-nowifi +Type: select +# :sl1: +__Choices: Retry network autoconfiguration, Retry network autoconfiguration with a DHCP hostname, Configure network manually, Do not configure the network at this time + Template: netcfg/internal-wifireconf -Type: text +Type: select # :sl1: -_Description: Reconfigure the wireless network +# Note to translators : Please keep your translation +# below a 65 columns limit (which means 65 characters +# in single-byte languages) +__Choices: Retry network autoconfiguration, Retry network autoconfiguration with a DHCP hostname, Configure network manually, Reconfigure the wireless network, Do not configure the network at this time Template: netcfg/dhcp_timeout Type: string diff --git a/dhcp.c b/dhcp.c index fe06950..ceb3b89 100644 --- a/dhcp.c +++ b/dhcp.c @@ -344,12 +344,11 @@ int poll_dhcp_client (struct debconfclient *client) int ask_dhcp_options (struct debconfclient *client, const char *if_name) { - if (is_wireless_iface(if_name)) { - debconf_metaget(client, "netcfg/internal-wifireconf", "description"); - debconf_subst(client, "netcfg/dhcp_options", "wifireconf", client->value); - } + if (is_wireless_iface(if_name)) + debconf_metaget(client, "netcfg/internal-wifireconf", "Choices"); else /* blank from last time */ - debconf_subst(client, "netcfg/dhcp_options", "wifireconf", ""); + debconf_metaget(client, "netcfg/internal-nowifi", "Choices"); + debconf_subst(client, "netcfg/dhcp_options", "choices", client->value); /* critical, we don't want to enter a loop */ debconf_input(client, "critical", "netcfg/dhcp_options"); -- 2.7.4