summaryrefslogtreecommitdiffstats
path: root/src/virt-viewer-session-spice.c
diff options
context:
space:
mode:
authorJonathon Jongsma <jjongsma@redhat.com>2014-01-17 13:39:29 -0600
committerJonathon Jongsma <jjongsma@redhat.com>2014-08-07 08:51:15 -0500
commitb684a76fa4147ecf5c241476d9c362cfff404c29 (patch)
tree17282196879e0177ab880470cdce3dfe100713c7 /src/virt-viewer-session-spice.c
parent7d8abf39571b7d6f741d39da8d6e33f55a14cb23 (diff)
downloadvirt-viewer-b684a76fa4147ecf5c241476d9c362cfff404c29.tar.gz
virt-viewer-b684a76fa4147ecf5c241476d9c362cfff404c29.tar.xz
virt-viewer-b684a76fa4147ecf5c241476d9c362cfff404c29.zip
Add a dialog showing details of the current guest
This allows the user to obtain the GUID and vm name of the currently-connected guest. Obviously, this only works with spice. In the future, it will allow them to set guest-specific configuration options (using a GUID as a key)
Diffstat (limited to 'src/virt-viewer-session-spice.c')
-rw-r--r--src/virt-viewer-session-spice.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/src/virt-viewer-session-spice.c b/src/virt-viewer-session-spice.c
index 8b90d66..d5531c2 100644
--- a/src/virt-viewer-session-spice.c
+++ b/src/virt-viewer-session-spice.c
@@ -875,8 +875,8 @@ uuid_changed(GObject *gobject G_GNUC_UNUSED,
}
if (!uuid_empty) {
- gchar* uuid_str = spice_uuid_to_string(uuid);
- virt_viewer_app_set_uuid_string(app, uuid_str);
+ gchar *uuid_str = spice_uuid_to_string(uuid);
+ g_object_set(app, "uuid", uuid_str, NULL);
g_free(uuid_str);
}
}
@@ -884,6 +884,20 @@ uuid_changed(GObject *gobject G_GNUC_UNUSED,
virt_viewer_session_spice_fullscreen_auto_conf(self);
}
+static void
+name_changed(GObject *gobject G_GNUC_UNUSED,
+ GParamSpec *pspec G_GNUC_UNUSED,
+ VirtViewerSessionSpice *self)
+{
+ gchar *name = NULL;
+ VirtViewerApp* app = virt_viewer_session_get_app(VIRT_VIEWER_SESSION(self));
+
+ g_object_get(self->priv->session, "name", &name, NULL);
+
+ g_object_set(app, "guest-name", name, NULL);
+ g_free(name);
+}
+
VirtViewerSession *
virt_viewer_session_spice_new(VirtViewerApp *app, GtkWindow *main_window)
{
@@ -899,6 +913,7 @@ virt_viewer_session_spice_new(VirtViewerApp *app, GtkWindow *main_window)
/* notify::uuid is guaranteed to be emitted during connection startup even
* if the server is too old to support sending uuid */
g_signal_connect(self->priv->session, "notify::uuid", G_CALLBACK(uuid_changed), self);
+ g_signal_connect(self->priv->session, "notify::name", G_CALLBACK(name_changed), self);
return VIRT_VIEWER_SESSION(self);
}