From: Arne Fitzenreiter Date: Wed, 3 Feb 2021 18:31:50 +0000 (+0100) Subject: setup: fix field-order at addressconfig for red X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=2e2170bfb541ea1238f1dcc9f026fab1c3f28d51;p=people%2Fms%2Fipfire-2.x.git setup: fix field-order at addressconfig for red i have added the gatewayfield at the line below the IP and Netmask fields but prior this fields so the cursor jumps first the the gateway and after this to the IP. This patch fix the activation order. Signed-off-by: Arne Fitzenreiter Signed-off-by: Michael Tremer --- diff --git a/src/setup/netstuff.c b/src/setup/netstuff.c index dac4077675..1e196dc1e0 100644 --- a/src/setup/netstuff.c +++ b/src/setup/netstuff.c @@ -134,18 +134,6 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag, newtEntrySetFlags(dhcphostnameentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET); newtEntrySetFlags(dhcpforcemtuentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET); } - /* Gateway */ - gatewaylabel = newtTextbox(2, (typeflag ? 11 : 4) + 2, 18, 1, 0); - newtTextboxSetText(gatewaylabel, _("Gateway:")); - strcpy(temp, ""); - findkey(kv, gatewayfield, temp); - gatewayentry = newtEntry(20, (typeflag ? 11 : 4) + 2, temp, 20, &gatewayresult, 0); - newtEntrySetFilter(gatewayentry, ip_input_filter, NULL); - if (typeflag == 1 && startstatictype == 0) - newtEntrySetFlags(gatewayentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET); - newtFormAddComponent(networkform, gatewaylabel); - newtFormAddComponent(networkform, gatewayentry); - } /* Address */ addresslabel = newtTextbox(2, (typeflag ? 11 : 4) + 0, 18, 1, 0); @@ -171,6 +159,20 @@ int changeaddress(struct keyvalue *kv, char *colour, int typeflag, newtFormAddComponent(networkform, netmasklabel); newtFormAddComponent(networkform, netmaskentry); + if (typeflag) + { + /* Gateway */ + gatewaylabel = newtTextbox(2, (typeflag ? 11 : 4) + 2, 18, 1, 0); + newtTextboxSetText(gatewaylabel, _("Gateway:")); + strcpy(temp, ""); + findkey(kv, gatewayfield, temp); + gatewayentry = newtEntry(20, (typeflag ? 11 : 4) + 2, temp, 20, &gatewayresult, 0); + newtEntrySetFilter(gatewayentry, ip_input_filter, NULL); + if (typeflag == 1 && startstatictype == 0) + newtEntrySetFlags(gatewayentry, NEWT_FLAG_DISABLED, NEWT_FLAGS_SET); + newtFormAddComponent(networkform, gatewaylabel); + newtFormAddComponent(networkform, gatewayentry); + } /* Buttons. */ ok = newtButton(8, (typeflag ? 15 : 7), _("OK"));