if (strcmp(temp, "DHCP") == 0) startdhcptype = 1;
if (strcmp(temp, "PPPOE") == 0) startpppoetype = 1;
statictyperadio = newtRadiobutton(2, 4, ctr[TR_STATIC], startstatictype, NULL);
- dhcptyperadio = newtRadiobutton(2, 5, "DHCP", startdhcptype, statictyperadio);
- pppoetyperadio = newtRadiobutton(2, 6, "PPPOE", startpppoetype, dhcptyperadio);
+ dhcptyperadio = newtRadiobutton(2, 5, ctr[TR_DHCP], startdhcptype, statictyperadio);
+ pppoetyperadio = newtRadiobutton(2, 6, ctr[TR_PPP_DIALUP], startpppoetype, dhcptyperadio);
newtFormAddComponents(networkform, statictyperadio, dhcptyperadio,
pppoetyperadio, NULL);
newtComponentAddCallback(statictyperadio, networkdialogcallbacktype, NULL);
int netaddresschange;
-int oktoleave(char *errormessage);
+int oktoleave(void);
int firstmenu(void);
int configtypemenu(void);
int drivermenu(void);
int done;
int choice;
int found;
- char errormessage[STRING_SIZE];
netaddresschange = 0;
break;
case 0:
- if (oktoleave(errormessage))
- done = 1;
- else
- errorbox(errormessage);
+ if (oktoleave()) done = 1;
break;
default:
return 1;
}
-int oktoleave(char *errormessage)
+int oktoleave(void)
{
struct keyvalue *kv = initkeyvalues();
char temp[STRING_SIZE];
int configtype;
+ int rc;
if (!(readkeyvalues(kv, CONFIG_ROOT "/ethernet/settings")))
{
strcpy(temp, ""); findkey(kv, "GREEN_DEV", temp);
if (!(strlen(temp)))
{
- strcpy(errormessage, ctr[TR_NO_GREEN_INTERFACE]);
- goto EXIT;
+ errorbox(ctr[TR_NO_GREEN_INTERFACE]);
+ freekeyvalues(kv);
+ return 0;
}
if (!(interfacecheck(kv, "GREEN")))
{
- strcpy(errormessage, ctr[TR_MISSING_GREEN_IP]);
- goto EXIT;
+ errorbox(ctr[TR_MISSING_GREEN_IP]);
+ freekeyvalues(kv);
+ return 0;
}
}
if (HAS_RED)
{
+
strcpy(temp, ""); findkey(kv, "RED_DEV", temp);
if (!(strlen(temp)))
{
- strcpy(errormessage, ctr[TR_NO_RED_INTERFACE]);
- goto EXIT;
+ rc = newtWinChoice(ctr[TR_ERROR], ctr[TR_OK], ctr[TR_IGNORE], ctr[TR_NO_RED_INTERFACE]);
+ if (rc == 0 || rc == 1)
+ {
+ freekeyvalues(kv);
+ return 0;
+ }
}
if (!(interfacecheck(kv, "RED")))
{
- strcpy(errormessage, ctr[TR_MISSING_RED_IP]);
- goto EXIT;
+ errorbox(ctr[TR_MISSING_RED_IP]);
+ freekeyvalues(kv);
+ return 0;
}
}
if (HAS_ORANGE)
strcpy(temp, ""); findkey(kv, "ORANGE_DEV", temp);
if (!(strlen(temp)))
{
- strcpy(errormessage, ctr[TR_NO_ORANGE_INTERFACE]);
- goto EXIT;
+ errorbox(ctr[TR_NO_ORANGE_INTERFACE]);
+ freekeyvalues(kv);
+ return 0;
}
if (!(interfacecheck(kv, "ORANGE")))
{
- strcpy(errormessage, ctr[TR_MISSING_ORANGE_IP]);
- goto EXIT;
+ errorbox(ctr[TR_MISSING_ORANGE_IP]);
+ freekeyvalues(kv);
+ return 0;
}
}
if (HAS_BLUE)
strcpy(temp, ""); findkey(kv, "BLUE_DEV", temp);
if (!(strlen(temp)))
{
- strcpy(errormessage, ctr[TR_NO_BLUE_INTERFACE]);
- goto EXIT;
+ errorbox(ctr[TR_NO_BLUE_INTERFACE]);
+ freekeyvalues(kv);
+ return 0;
}
if (!(interfacecheck(kv, "BLUE")))
{
- strcpy(errormessage, ctr[TR_MISSING_BLUE_IP]);
- goto EXIT;
+ errorbox(ctr[TR_MISSING_BLUE_IP]);
+ freekeyvalues(kv);
+ return 0;
}
}
if (configtype == 0)
strcpy(temp, ""); findkey(kv, "DNS1", temp);
if (!(strlen(temp)))
{
- strcpy(errormessage, ctr[TR_MISSING_DNS]);
- goto EXIT;
+ errorbox(ctr[TR_MISSING_DNS]);
+ freekeyvalues(kv);
+ return 0;
}
strcpy(temp, ""); findkey(kv, "DEFAULT_GATEWAY", temp);
if (!(strlen(temp)))
{
- strcpy(errormessage, ctr[TR_MISSING_DEFAULT]);
- goto EXIT;
+ errorbox(ctr[TR_MISSING_DEFAULT]);
+ freekeyvalues(kv);
+ return 0;
}
}
- strcpy(errormessage, "");
-EXIT:
- freekeyvalues(kv);
-
- if (strlen(errormessage))
- return 0;
- else
- return 1;
+ return 1;
}
findkey(kv, "CONFIG_TYPE", temp); choise = atol(temp);
choise--;
- do
- {
sprintf(message, ctr[TR_NETWORK_CONFIGURATION_TYPE_LONG], NAME);
rc = newtWinMenu(ctr[TR_NETWORK_CONFIGURATION_TYPE], message, 50, 5, 5,
6, configtypenames, &choise, ctr[TR_OK], ctr[TR_CANCEL], NULL);
sprintf(message, ctr[TR_NOT_ENOUGH_INTERFACES] , configtypecards[choise], found);
errorbox(message);
}
- }
- while ( configtypecards[choise] > found);
if (rc == 0 || rc == 1)
{