[virt-tools-list] [PATCH virt-viewer 3/4] file: learn to set secure-attention hotkey

Marc-André Lureau marcandre.lureau at gmail.com
Thu Nov 7 17:41:09 UTC 2013


---
 src/virt-viewer-file.c | 26 ++++++++++++++++++++++++++
 src/virt-viewer-file.h |  2 ++
 2 files changed, 28 insertions(+)

diff --git a/src/virt-viewer-file.c b/src/virt-viewer-file.c
index ca7158c..3ff8b35 100644
--- a/src/virt-viewer-file.c
+++ b/src/virt-viewer-file.c
@@ -55,6 +55,7 @@
  * - release-cursor: string in spice hotkey format
  * - smartcard-insert: string in spice hotkey format
  * - smartcard-remove: string in spice hotkey format
+ * - secure-attention: string in spice hotkey format
  * - enable-smartcard: int (0 or 1 atm)
  * - enable-usbredir: int (0 or 1 atm)
  * - color-depth: int
@@ -105,6 +106,7 @@ enum  {
     PROP_VERSION,
     PROP_SECURE_CHANNELS,
     PROP_DELETE_THIS_FILE,
+    PROP_SECURE_ATTENTION,
 };
 
 VirtViewerFile*
@@ -437,6 +439,19 @@ virt_viewer_file_set_release_cursor(VirtViewerFile* self, const gchar* value)
 }
 
 gchar*
+virt_viewer_file_get_secure_attention(VirtViewerFile* self)
+{
+    return virt_viewer_file_get_string(self, "secure-attention");
+}
+
+void
+virt_viewer_file_set_secure_attention(VirtViewerFile* self, const gchar* value)
+{
+    virt_viewer_file_set_string(self, "secure-attention", value);
+    g_object_notify(G_OBJECT(self), "secure-attention");
+}
+
+gchar*
 virt_viewer_file_get_smartcard_remove(VirtViewerFile* self)
 {
     return virt_viewer_file_get_string(self, "smartcard-remove");
@@ -631,6 +646,7 @@ virt_viewer_file_fill_app(VirtViewerFile* self, VirtViewerApp *app, GError **err
             { "toggle-fullscreen", "<virt-viewer>/view/toggle-fullscreen" },
             { "smartcard-insert", "<virt-viewer>/file/smartcard-insert" },
             { "smartcard-remove", "<virt-viewer>/file/smartcard-remove" },
+            { "secure-attention", "<virt-viewer>/send/secure-attention" }
         };
         int i;
 
@@ -701,6 +717,9 @@ virt_viewer_file_set_property(GObject* object, guint property_id,
     case PROP_RELEASE_CURSOR:
         virt_viewer_file_set_release_cursor(self, g_value_get_string(value));
         break;
+    case PROP_SECURE_ATTENTION:
+        virt_viewer_file_set_secure_attention(self, g_value_get_string(value));
+        break;
     case PROP_ENABLE_SMARTCARD:
         virt_viewer_file_set_enable_smartcard(self, g_value_get_int(value));
         break;
@@ -788,6 +807,9 @@ virt_viewer_file_get_property(GObject* object, guint property_id,
     case PROP_RELEASE_CURSOR:
         g_value_take_string(value, virt_viewer_file_get_release_cursor(self));
         break;
+    case PROP_SECURE_ATTENTION:
+        g_value_take_string(value, virt_viewer_file_get_secure_attention(self));
+        break;
     case PROP_ENABLE_SMARTCARD:
         g_value_set_int(value, virt_viewer_file_get_enable_smartcard(self));
         break;
@@ -905,6 +927,10 @@ virt_viewer_file_class_init(VirtViewerFileClass* klass)
         g_param_spec_string("release-cursor", "release-cursor", "release-cursor", NULL,
                             G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
 
+    g_object_class_install_property(G_OBJECT_CLASS(klass), PROP_SECURE_ATTENTION,
+        g_param_spec_string("secure-attention", "secure-attention", "secure-attention", NULL,
+                            G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
+
     g_object_class_install_property(G_OBJECT_CLASS(klass), PROP_ENABLE_SMARTCARD,
         g_param_spec_int("enable-smartcard", "enable-smartcard", "enable-smartcard", 0, 1, 0,
                          G_PARAM_STATIC_STRINGS | G_PARAM_READWRITE));
diff --git a/src/virt-viewer-file.h b/src/virt-viewer-file.h
index 8665070..9507bf9 100644
--- a/src/virt-viewer-file.h
+++ b/src/virt-viewer-file.h
@@ -106,6 +106,8 @@ gchar** virt_viewer_file_get_secure_channels(VirtViewerFile* self, gsize* length
 void virt_viewer_file_set_secure_channels(VirtViewerFile* self, const gchar* const* value, gsize length);
 gint virt_viewer_file_get_delete_this_file(VirtViewerFile* self);
 void virt_viewer_file_set_delete_this_file(VirtViewerFile* self, gint value);
+gchar* virt_viewer_file_get_secure_attention(VirtViewerFile* self);
+void virt_viewer_file_set_secure_attention(VirtViewerFile* self, const gchar* value);
 
 G_END_DECLS
 
-- 
1.8.3.1




More information about the virt-tools-list mailing list