summaryrefslogtreecommitdiffstats
path: root/src/remote-viewer.c
diff options
context:
space:
mode:
authorChristophe Fergeau <cfergeau@redhat.com>2013-10-29 10:52:14 +0100
committerChristophe Fergeau <cfergeau@redhat.com>2013-11-13 11:29:05 +0100
commitb19a246c5cac54ff0570d482f78cc0172ea2d884 (patch)
tree2c8c92b2e603108b8176d68045d87c8f7a220d43 /src/remote-viewer.c
parent24877bc546adc7a7a610f3e1eb64e610eb6ecc1e (diff)
downloadvirt-viewer-b19a246c5cac54ff0570d482f78cc0172ea2d884.tar.gz
virt-viewer-b19a246c5cac54ff0570d482f78cc0172ea2d884.tar.xz
virt-viewer-b19a246c5cac54ff0570d482f78cc0172ea2d884.zip
Fix window title after failed connection
When using the connection dialog, if the user picks an invalid URI first causing a failed connection, and then picks/enters a valid URI, remote-viewer window title will be set to the first invalid URI, not to the second one which was entered. As the user may have specified a window title to use on the command line (-t option), we need to be careful not to override that when setting the window title on the second attempt. Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1024309
Diffstat (limited to 'src/remote-viewer.c')
-rw-r--r--src/remote-viewer.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/src/remote-viewer.c b/src/remote-viewer.c
index d345f7a..f55925b 100644
--- a/src/remote-viewer.c
+++ b/src/remote-viewer.c
@@ -57,6 +57,10 @@ struct _RemoteViewerPrivate {
GtkWidget *controller_menu;
GtkWidget *foreign_menu;
gboolean open_recent_dialog;
+
+ gboolean default_title; /* Whether the window title was set by the user, or
+ is the default one (URI we are connecting to) */
+
};
G_DEFINE_TYPE (RemoteViewer, remote_viewer, VIRT_VIEWER_TYPE_APP)
@@ -981,8 +985,10 @@ remote_viewer_start(VirtViewerApp *app)
g_return_val_if_fail(guri != NULL, FALSE);
DEBUG_LOG("Opening display to %s", guri);
- if (virt_viewer_app_get_title(app) == NULL)
+ if ((virt_viewer_app_get_title(app) == NULL) || priv->default_title) {
+ priv->default_title = TRUE;
virt_viewer_app_set_title(app, guri);
+ }
file = g_file_new_for_commandline_arg(guri);
if (g_file_query_exists(file, NULL)) {