Don't annoyingly reconfigure the network when you don't have to.
This commit is contained in:
parent
899469e32a
commit
a54f2b1abb
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: ftp_strat.c,v 1.23 1996/10/02 00:41:39 jkh Exp $
|
||||
* $Id: ftp_strat.c,v 1.24 1996/10/02 01:30:34 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -72,7 +72,7 @@ mediaInitFTP(Device *dev)
|
||||
try:
|
||||
cp = variable_get(VAR_FTP_PATH);
|
||||
if (!cp) {
|
||||
msgConfirm("You haven't specified an FTP server!");
|
||||
msgConfirm("You haven't specified an FTP server! Please visit\nthe Options editor and select a Media type.");
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
@ -119,17 +119,17 @@ try:
|
||||
"FTP server. You may need to visit a different server for\n"
|
||||
"the release you're trying to fetch or go to the Options\n"
|
||||
"menu and to set the release name to explicitly match what's\n"
|
||||
"available on %s.\n\n"
|
||||
"available on %s (or set to \"none\").\n\n"
|
||||
"Would you like to select another FTP server?", rel, hostname)) {
|
||||
dialog_clear_norefresh();
|
||||
variable_unset(VAR_FTP_PATH);
|
||||
if (!dmenuOpenSimple(&MenuMediaFTP, FALSE))
|
||||
goto punt;
|
||||
else {
|
||||
cp = variable_get(VAR_FTP_PATH);
|
||||
else
|
||||
goto try;
|
||||
}
|
||||
}
|
||||
else
|
||||
goto punt;
|
||||
}
|
||||
else if (i == IO_ERROR)
|
||||
goto punt;
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: media.c,v 1.55 1996/10/01 14:08:28 jkh Exp $
|
||||
* $Id: media.c,v 1.56 1996/10/02 00:41:40 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -259,6 +259,7 @@ mediaSetFTP(dialogMenuItem *self)
|
||||
static Device ftpDevice;
|
||||
char *cp, *hostname, *dir;
|
||||
extern int FtpPort;
|
||||
static Boolean network_init = 1;
|
||||
int what = DITEM_RESTORE;
|
||||
|
||||
cp = variable_get(VAR_FTP_PATH);
|
||||
@ -291,13 +292,20 @@ mediaSetFTP(dialogMenuItem *self)
|
||||
}
|
||||
strcpy(ftpDevice.name, cp);
|
||||
|
||||
if (!tcpDeviceSelect())
|
||||
return DITEM_FAILURE | what;
|
||||
if (!mediaDevice || !mediaDevice->init(mediaDevice)) {
|
||||
if (isDebug())
|
||||
msgDebug("mediaSetFTP: Net device init failed.\n");
|
||||
return DITEM_FAILURE | what;
|
||||
dialog_clear_norefresh();
|
||||
if (network_init || msgYesNo("You've already done the network configuration once,\n"
|
||||
"would you like to skip over it now?")) {
|
||||
if (!tcpDeviceSelect())
|
||||
return DITEM_FAILURE | what;
|
||||
if (!network_init)
|
||||
mediaDevice->shutdown(mediaDevice);
|
||||
if (!mediaDevice || !mediaDevice->init(mediaDevice)) {
|
||||
if (isDebug())
|
||||
msgDebug("mediaSetFTP: Net device init failed.\n");
|
||||
return DITEM_FAILURE | what;
|
||||
}
|
||||
}
|
||||
network_init = FALSE;
|
||||
hostname = cp + 6;
|
||||
if ((cp = index(hostname, ':')) != NULL) {
|
||||
*(cp++) = '\0';
|
||||
@ -318,6 +326,7 @@ mediaSetFTP(dialogMenuItem *self)
|
||||
msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n"
|
||||
"name server, gateway and network interface are correctly configured?", hostname);
|
||||
mediaDevice->shutdown(mediaDevice);
|
||||
network_init = TRUE;
|
||||
return DITEM_FAILURE | what;
|
||||
}
|
||||
}
|
||||
|
@ -4,7 +4,7 @@
|
||||
* This is probably the last attempt in the `sysinstall' line, the next
|
||||
* generation being slated to essentially a complete rewrite.
|
||||
*
|
||||
* $Id: media.c,v 1.55 1996/10/01 14:08:28 jkh Exp $
|
||||
* $Id: media.c,v 1.56 1996/10/02 00:41:40 jkh Exp $
|
||||
*
|
||||
* Copyright (c) 1995
|
||||
* Jordan Hubbard. All rights reserved.
|
||||
@ -259,6 +259,7 @@ mediaSetFTP(dialogMenuItem *self)
|
||||
static Device ftpDevice;
|
||||
char *cp, *hostname, *dir;
|
||||
extern int FtpPort;
|
||||
static Boolean network_init = 1;
|
||||
int what = DITEM_RESTORE;
|
||||
|
||||
cp = variable_get(VAR_FTP_PATH);
|
||||
@ -291,13 +292,20 @@ mediaSetFTP(dialogMenuItem *self)
|
||||
}
|
||||
strcpy(ftpDevice.name, cp);
|
||||
|
||||
if (!tcpDeviceSelect())
|
||||
return DITEM_FAILURE | what;
|
||||
if (!mediaDevice || !mediaDevice->init(mediaDevice)) {
|
||||
if (isDebug())
|
||||
msgDebug("mediaSetFTP: Net device init failed.\n");
|
||||
return DITEM_FAILURE | what;
|
||||
dialog_clear_norefresh();
|
||||
if (network_init || msgYesNo("You've already done the network configuration once,\n"
|
||||
"would you like to skip over it now?")) {
|
||||
if (!tcpDeviceSelect())
|
||||
return DITEM_FAILURE | what;
|
||||
if (!network_init)
|
||||
mediaDevice->shutdown(mediaDevice);
|
||||
if (!mediaDevice || !mediaDevice->init(mediaDevice)) {
|
||||
if (isDebug())
|
||||
msgDebug("mediaSetFTP: Net device init failed.\n");
|
||||
return DITEM_FAILURE | what;
|
||||
}
|
||||
}
|
||||
network_init = FALSE;
|
||||
hostname = cp + 6;
|
||||
if ((cp = index(hostname, ':')) != NULL) {
|
||||
*(cp++) = '\0';
|
||||
@ -318,6 +326,7 @@ mediaSetFTP(dialogMenuItem *self)
|
||||
msgConfirm("Cannot resolve hostname `%s'! Are you sure that your\n"
|
||||
"name server, gateway and network interface are correctly configured?", hostname);
|
||||
mediaDevice->shutdown(mediaDevice);
|
||||
network_init = TRUE;
|
||||
return DITEM_FAILURE | what;
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user