]> git.ipfire.org Git - people/pmueller/ipfire-2.x.git/commitdiff
setup: fix field-order at addressconfig for red
authorArne Fitzenreiter <arne_f@ipfire.org>
Wed, 3 Feb 2021 18:31:50 +0000 (19:31 +0100)
committerMichael Tremer <michael.tremer@ipfire.org>
Wed, 3 Feb 2021 22:17:37 +0000 (22:17 +0000)
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 <arne_f@ipfire.org>
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/setup/netstuff.c

index dac4077675c7597cfac52945db880c3049ac05f4..1e196dc1e088ab1df5a5d0f4dad530d95252fb5d 100644 (file)
@@ -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"));