Add a new parameter 'alertOnFatalError' which guards the displaying of the GUI alert on fatal errors, and thus when false just gives the textual error. Now I can do: while true do vncviewer alertOnFatalError=false vm:0 sleep 1 done and it'll reappear when my VM appears without me getting error dialogs. Signed-off-by: Dr. David Alan Gilbert <dgilbert@redhat.com> --tags/v1.8.90
vlog.info(_("connected to host %s port %d"), serverHost, serverPort); | vlog.info(_("connected to host %s port %d"), serverHost, serverPort); | ||||
} catch (rdr::Exception& e) { | } catch (rdr::Exception& e) { | ||||
vlog.error("%s", e.str()); | vlog.error("%s", e.str()); | ||||
fl_alert("%s", e.str()); | |||||
if (alertOnFatalError) | |||||
fl_alert("%s", e.str()); | |||||
exit_vncviewer(); | exit_vncviewer(); | ||||
return; | return; | ||||
} | } |
"Show the dot cursor when the server sends an " | "Show the dot cursor when the server sends an " | ||||
"invisible cursor", false); | "invisible cursor", false); | ||||
BoolParameter alertOnFatalError("AlertOnFatalError", | |||||
"Give a dialog on connection problems rather " | |||||
"than exiting immediately", true); | |||||
StringParameter passwordFile("PasswordFile", | StringParameter passwordFile("PasswordFile", | ||||
"Password file for VNC authentication", ""); | "Password file for VNC authentication", ""); | ||||
AliasParameter passwd("passwd", "Alias for PasswordFile", &passwordFile); | AliasParameter passwd("passwd", "Alias for PasswordFile", &passwordFile); | ||||
&sendPrimary, | &sendPrimary, | ||||
#endif | #endif | ||||
&menuKey, | &menuKey, | ||||
&fullscreenSystemKeys | |||||
&fullscreenSystemKeys, | |||||
&alertOnFatalError | |||||
}; | }; | ||||
// Encoding Table | // Encoding Table |
extern rfb::StringParameter menuKey; | extern rfb::StringParameter menuKey; | ||||
extern rfb::BoolParameter fullscreenSystemKeys; | extern rfb::BoolParameter fullscreenSystemKeys; | ||||
extern rfb::BoolParameter alertOnFatalError; | |||||
#ifndef WIN32 | #ifndef WIN32 | ||||
extern rfb::StringParameter via; | extern rfb::StringParameter via; |
defaultServerName = loadViewerParameters(NULL); | defaultServerName = loadViewerParameters(NULL); | ||||
} catch (rfb::Exception& e) { | } catch (rfb::Exception& e) { | ||||
defaultServerName = ""; | defaultServerName = ""; | ||||
fl_alert("%s", e.str()); | |||||
vlog.error("%s", e.str()); | |||||
if (alertOnFatalError) | |||||
fl_alert("%s", e.str()); | |||||
} | } | ||||
int i = 1; | int i = 1; | ||||
// TRANSLATORS: "Parameters" are command line arguments, or settings | // TRANSLATORS: "Parameters" are command line arguments, or settings | ||||
// from a file or the Windows registry. | // from a file or the Windows registry. | ||||
vlog.error(_("Parameters -listen and -via are incompatible")); | vlog.error(_("Parameters -listen and -via are incompatible")); | ||||
fl_alert(_("Parameters -listen and -via are incompatible")); | |||||
if (alertOnFatalError) | |||||
fl_alert(_("Parameters -listen and -via are incompatible")); | |||||
exit_vncviewer(); | exit_vncviewer(); | ||||
return 1; | return 1; | ||||
} | } | ||||
} | } | ||||
} catch (rdr::Exception& e) { | } catch (rdr::Exception& e) { | ||||
vlog.error("%s", e.str()); | vlog.error("%s", e.str()); | ||||
fl_alert("%s", e.str()); | |||||
if (alertOnFatalError) | |||||
fl_alert("%s", e.str()); | |||||
exit_vncviewer(); | exit_vncviewer(); | ||||
return 1; | return 1; | ||||
} | } | ||||
delete cc; | delete cc; | ||||
if (exitError != NULL) | |||||
if (exitError != NULL && alertOnFatalError) | |||||
fl_alert("%s", exitError); | fl_alert("%s", exitError); | ||||
return 0; | return 0; |
\fIR\fR, and \fIG\fR taken the values of the local port number, the remote | \fIR\fR, and \fIG\fR taken the values of the local port number, the remote | ||||
host, the port number on the remote host, and the gateway machine | host, the port number on the remote host, and the gateway machine | ||||
respectively. | respectively. | ||||
. | |||||
.TP | |||||
.B \-AlertOnFatalError | |||||
Display a dialog with any fatal error before exiting. Default is on. | |||||
.SH FILES | .SH FILES | ||||
.TP | .TP |