If we're set to non-interactive, we shouldn't ask the user yes/no questions

but simply return the default answer instead.
This commit is contained in:
Jordan K. Hubbard 2001-07-30 20:45:54 +00:00
parent 7b141d5db3
commit c6934947db
3 changed files with 10 additions and 4 deletions

View File

@ -237,6 +237,8 @@ msgYesNo(char *fmt, ...)
ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
if (variable_get(VAR_NONINTERACTIVE))
return 1; /* If non-interactive, return YES all the time */
ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
restorescr(w);
return ret;
@ -261,6 +263,8 @@ msgNoYes(char *fmt, ...)
ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
if (variable_get(VAR_NONINTERACTIVE))
return 0; /* If non-interactive, return NO all the time */
ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1);
restorescr(w);
return ret;

View File

@ -323,10 +323,8 @@ mediaSetFTP(dialogMenuItem *self)
mediaClose();
cp = variable_get(VAR_FTP_PATH);
/* If we've been through here before ... */
if (!variable_get(VAR_NONINTERACTIVE))
if (networkDev && cp && msgYesNo("Re-use old FTP site selection values?"))
cp = NULL;
if (networkDev && cp && msgYesNo("Re-use old FTP site selection values?"))
cp = NULL;
if (!cp) {
if (!dmenuOpenSimple(&MenuMediaFTP, FALSE))
return DITEM_FAILURE;

View File

@ -237,6 +237,8 @@ msgYesNo(char *fmt, ...)
ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
if (variable_get(VAR_NONINTERACTIVE))
return 1; /* If non-interactive, return YES all the time */
ret = dialog_yesno("User Confirmation Requested", errstr, -1, -1);
restorescr(w);
return ret;
@ -261,6 +263,8 @@ msgNoYes(char *fmt, ...)
ioctl(0, VT_ACTIVATE, 1); /* Switch back */
msgInfo(NULL);
}
if (variable_get(VAR_NONINTERACTIVE))
return 0; /* If non-interactive, return NO all the time */
ret = dialog_noyes("User Confirmation Requested", errstr, -1, -1);
restorescr(w);
return ret;