summaryrefslogtreecommitdiffstats
path: root/src/remote-viewer.c
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2013-10-29 13:25:53 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2013-11-13 11:29:05 +0100
commit06b2c382468876a19600374bd59475e66d488af8 (patch)
tree5d30d788968330f2186b345fd8aa42107b2f4fd9 /src/remote-viewer.c
parent30bb4019fdd2805485f70e8b1635c84336355fc1 (diff)
downloadvirt-viewer-06b2c382468876a19600374bd59475e66d488af8.tar.gz
virt-viewer-06b2c382468876a19600374bd59475e66d488af8.tar.xz
virt-viewer-06b2c382468876a19600374bd59475e66d488af8.zip
Reshow connection dialog on errors
remote-viewer behaviour is currently inconsistent in the connection dialog: if the user enters a valid URI, but then remote-viewer fails to connect to it, then we'll show again the connection dialog through a call to virt_viewer_app_start() in remote_viewer_deactivated(). If instead we enter an invalid URI in the connection dialog, then remote-viewer will report an error and quit. This commit makes sure in the latter case, we report the error and show again the connection dialog. The user can press 'Cancel' in the connection dialog to get out of remote-viewer as in this case, we return directly FALSE rather than going through the cleanup: label and looping.
Diffstat (limited to 'src/remote-viewer.c')
-rw-r--r--src/remote-viewer.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index 56b8518..768ff74 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -976,6 +976,7 @@ remote_viewer_start(VirtViewerApp *app)
virt_viewer_app_show_status(VIRT_VIEWER_APP(self), _("Setting up Spice session..."));
} else {
#endif
+retry_dialog:
if (priv->open_recent_dialog) {
if (connect_dialog(&guri) != 0)
return FALSE;
@@ -1044,6 +1045,10 @@ cleanup:
g_free(guri);
g_free(type);
+ if (!ret && priv->open_recent_dialog) {
+ goto retry_dialog;
+ }
+
return ret;
}