diff options
-rw-r--r-- | vncviewer/CConn.cxx | 3 | ||||
-rw-r--r-- | vncviewer/parameters.cxx | 7 | ||||
-rw-r--r-- | vncviewer/parameters.h | 1 | ||||
-rw-r--r-- | vncviewer/vncviewer.cxx | 12 | ||||
-rw-r--r-- | vncviewer/vncviewer.man | 4 |
5 files changed, 21 insertions, 6 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx index addc30df..2e97ec28 100644 --- a/vncviewer/CConn.cxx +++ b/vncviewer/CConn.cxx @@ -110,7 +110,8 @@ CConn::CConn(const char* vncServerName, network::Socket* socket=NULL) vlog.info(_("connected to host %s port %d"), serverHost, serverPort); } catch (rdr::Exception& e) { vlog.error("%s", e.str()); - fl_alert("%s", e.str()); + if (alertOnFatalError) + fl_alert("%s", e.str()); exit_vncviewer(); return; } diff --git a/vncviewer/parameters.cxx b/vncviewer/parameters.cxx index ad82f27c..9385b986 100644 --- a/vncviewer/parameters.cxx +++ b/vncviewer/parameters.cxx @@ -59,6 +59,10 @@ BoolParameter dotWhenNoCursor("DotWhenNoCursor", "Show the dot cursor when the server sends an " "invisible cursor", false); +BoolParameter alertOnFatalError("AlertOnFatalError", + "Give a dialog on connection problems rather " + "than exiting immediately", true); + StringParameter passwordFile("PasswordFile", "Password file for VNC authentication", ""); AliasParameter passwd("passwd", "Alias for PasswordFile", &passwordFile); @@ -174,7 +178,8 @@ static VoidParameter* parameterArray[] = { &sendPrimary, #endif &menuKey, - &fullscreenSystemKeys + &fullscreenSystemKeys, + &alertOnFatalError }; // Encoding Table diff --git a/vncviewer/parameters.h b/vncviewer/parameters.h index 682b6d69..9ce56b97 100644 --- a/vncviewer/parameters.h +++ b/vncviewer/parameters.h @@ -60,6 +60,7 @@ extern rfb::BoolParameter sendPrimary; extern rfb::StringParameter menuKey; extern rfb::BoolParameter fullscreenSystemKeys; +extern rfb::BoolParameter alertOnFatalError; #ifndef WIN32 extern rfb::StringParameter via; diff --git a/vncviewer/vncviewer.cxx b/vncviewer/vncviewer.cxx index de2b423e..0ca46af4 100644 --- a/vncviewer/vncviewer.cxx +++ b/vncviewer/vncviewer.cxx @@ -494,7 +494,9 @@ int main(int argc, char** argv) defaultServerName = loadViewerParameters(NULL); } catch (rfb::Exception& e) { defaultServerName = ""; - fl_alert("%s", e.str()); + vlog.error("%s", e.str()); + if (alertOnFatalError) + fl_alert("%s", e.str()); } int i = 1; @@ -532,7 +534,8 @@ int main(int argc, char** argv) // TRANSLATORS: "Parameters" are command line arguments, or settings // from a file or the Windows registry. 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(); return 1; } @@ -580,7 +583,8 @@ int main(int argc, char** argv) } } catch (rdr::Exception& e) { vlog.error("%s", e.str()); - fl_alert("%s", e.str()); + if (alertOnFatalError) + fl_alert("%s", e.str()); exit_vncviewer(); return 1; } @@ -609,7 +613,7 @@ int main(int argc, char** argv) delete cc; - if (exitError != NULL) + if (exitError != NULL && alertOnFatalError) fl_alert("%s", exitError); return 0; diff --git a/vncviewer/vncviewer.man b/vncviewer/vncviewer.man index b1450d13..e48a0c43 100644 --- a/vncviewer/vncviewer.man +++ b/vncviewer/vncviewer.man @@ -275,6 +275,10 @@ command is executed with the environment variables \fIL\fR, \fIH\fR, \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 respectively. +. +.TP +.B \-AlertOnFatalError +Display a dialog with any fatal error before exiting. Default is on. .SH FILES .TP |