Allow removal of GUI prompt on fatal errors
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>
--
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx
index addc30d..2e97ec2 100644
--- a/vncviewer/CConn.cxx
+++ b/vncviewer/CConn.cxx
@@ -110,7 +110,8 @@
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;
}