[virt-tools-list] [virt-viewer][PATCH 3/4 v3] virt-viewer-app: Added can_reconnect property
Lukas Venhoda
lvenhoda at redhat.com
Wed May 13 14:51:02 UTC 2015
New property in virt-viewer-app: "can_reconnect".
Will be set to TRUE when constructing virt-viewer.
Default value is FALSE.
This property will be used to determine whether to show Reconnect button
in the new General tab under preferences or not. This will be probably
only shown int virt-viewer.
---
Changes since v2:
- Got rid of compiler definition USING_VIRT_VIEWER
- Implemented can_reconnect property instead
- Will be set to true only when creating virt-viewer
---
src/virt-viewer-app.c | 20 ++++++++++++++++++++
src/virt-viewer.c | 1 +
2 files changed, 21 insertions(+)
diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 2570b8c..11e3da6 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -121,6 +121,7 @@ struct _VirtViewerAppPrivate {
gboolean attach;
gboolean quitting;
gboolean kiosk;
+ gboolean can_reconnect;
VirtViewerSession *session;
gboolean active;
@@ -170,6 +171,7 @@ enum {
PROP_KIOSK,
PROP_QUIT_ON_DISCONNECT,
PROP_UUID,
+ PROP_CAN_RECONNECT,
};
enum {
@@ -1601,6 +1603,10 @@ virt_viewer_app_get_property (GObject *object, guint property_id,
g_value_set_string(value, priv->uuid);
break;
+ case PROP_CAN_RECONNECT:
+ g_value_set_boolean(value, priv->can_reconnect);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -1655,6 +1661,10 @@ virt_viewer_app_set_property (GObject *object, guint property_id,
virt_viewer_app_set_uuid_string(self, g_value_get_string(value));
break;
+ case PROP_CAN_RECONNECT:
+ priv->can_reconnect = g_value_get_boolean(value);
+ break;
+
default:
G_OBJECT_WARN_INVALID_PROPERTY_ID (object, property_id, pspec);
}
@@ -1977,6 +1987,16 @@ virt_viewer_app_class_init (VirtViewerAppClass *klass)
G_PARAM_WRITABLE |
G_PARAM_STATIC_STRINGS));
+ g_object_class_install_property(object_class,
+ PROP_CAN_RECONNECT,
+ g_param_spec_boolean("can-reconnect",
+ "Can reconnect",
+ "Can reconnect",
+ FALSE,
+ G_PARAM_READWRITE |
+ G_PARAM_CONSTRUCT_ONLY |
+ G_PARAM_STATIC_STRINGS));
+
signals[SIGNAL_WINDOW_ADDED] =
g_signal_new("window-added",
G_OBJECT_CLASS_TYPE(object_class),
diff --git a/src/virt-viewer.c b/src/virt-viewer.c
index 10bb129..0f8ac5a 100644
--- a/src/virt-viewer.c
+++ b/src/virt-viewer.c
@@ -1019,6 +1019,7 @@ virt_viewer_new(const char *uri,
self = g_object_new(VIRT_VIEWER_TYPE,
"guest-name", name,
+ "can-reconnect", TRUE,
"reconnect", reconnect,
NULL);
app = VIRT_VIEWER_APP(self);
--
2.4.0
More information about the virt-tools-list
mailing list