Fix setting of window title with --wait

When waiting for a VM to appear or start, set the initial window
title to the command line arg. When the VM actually appears then
update it to the real VM name
This commit is contained in:
Daniel P. Berrange 2011-10-11 10:01:10 +01:00
parent 986c040fd7
commit 168af497b9
2 changed files with 7 additions and 2 deletions

View File

@ -167,6 +167,7 @@ virt_viewer_window_set_property (GObject *object, guint property_id,
case PROP_SUBTITLE:
g_free(priv->subtitle);
priv->subtitle = g_value_dup_string(value);
virt_viewer_window_update_title(VIRT_VIEWER_WINDOW(object));
break;
case PROP_CONTAINER:

View File

@ -365,6 +365,8 @@ virt_viewer_update_display(VirtViewer *self, virDomainPtr dom)
virt_viewer_app_trace(app, "Guest %s is running, determining display\n",
priv->domkey);
g_object_set(app, "title", virDomainGetName(dom), NULL);
if (!virt_viewer_app_has_session(app)) {
if (!virt_viewer_extract_connect_info(self, dom))
return -1;
@ -427,8 +429,6 @@ virt_viewer_initial_connect(VirtViewerApp *app)
}
}
g_object_set(app, "title", virDomainGetName(dom), NULL);
virt_viewer_app_show_status(app, _("Checking guest domain status"));
if (virDomainGetInfo(dom, &info) < 0) {
DEBUG_LOG("Cannot get guest state");
@ -544,6 +544,10 @@ virt_viewer_new(const char *uri,
app = VIRT_VIEWER_APP(self);
priv = self->priv;
/* Set initial title based on guest name arg, which can be a ID,
* UUID, or NAME string. To be replaced with the real guest name later
*/
g_object_set(app, "title", name, NULL);
virt_viewer_window_set_zoom_level(virt_viewer_app_get_main_window(app), zoom);
virt_viewer_app_set_direct(app, direct);