[virt-tools-list] [PATCH virt-viewer 6/9] Add hidden menu smartcard remove/insert and release-cursor

Marc-André Lureau marcandre.lureau at gmail.com
Wed Feb 15 00:29:57 UTC 2012


---
 src/virt-viewer-window.c |   25 +++++++++++++++++++++++++
 src/virt-viewer.xml      |   31 +++++++++++++++++++++++++++++++
 2 files changed, 56 insertions(+), 0 deletions(-)

diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index fd08fcb..7f50e90 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -36,6 +36,7 @@
 #include <glib/gi18n.h>
 
 #include "virt-viewer-window.h"
+#include "virt-viewer-session.h"
 #include "virt-viewer-app.h"
 #include "virt-viewer-util.h"
 #include "view/autoDrawer.h"
@@ -52,6 +53,9 @@ void virt_viewer_window_menu_view_resize(GtkWidget *menu, VirtViewerWindow *self
 void virt_viewer_window_menu_send(GtkWidget *menu, VirtViewerWindow *self);
 void virt_viewer_window_menu_file_screenshot(GtkWidget *menu, VirtViewerWindow *self);
 void virt_viewer_window_menu_file_usb_device_selection(GtkWidget *menu, VirtViewerWindow *self);
+void virt_viewer_window_menu_file_smartcard_insert(GtkWidget *menu, VirtViewerWindow *self);
+void virt_viewer_window_menu_file_smartcard_remove(GtkWidget *menu, VirtViewerWindow *self);
+void virt_viewer_window_menu_view_release_cursor(GtkWidget *menu, VirtViewerWindow *self);
 
 /* Internal methods */
 static void virt_viewer_window_enable_modifiers(VirtViewerWindow *self);
@@ -745,6 +749,27 @@ virt_viewer_window_menu_file_usb_device_selection(GtkWidget *menu G_GNUC_UNUSED,
 }
 
 G_MODULE_EXPORT void
+virt_viewer_window_menu_file_smartcard_insert(GtkWidget *menu G_GNUC_UNUSED,
+                                              VirtViewerWindow *self)
+{
+    virt_viewer_session_smartcard_insert(virt_viewer_app_get_session(self->priv->app));
+}
+
+G_MODULE_EXPORT void
+virt_viewer_window_menu_file_smartcard_remove(GtkWidget *menu G_GNUC_UNUSED,
+                                              VirtViewerWindow *self)
+{
+    virt_viewer_session_smartcard_remove(virt_viewer_app_get_session(self->priv->app));
+}
+
+G_MODULE_EXPORT void
+virt_viewer_window_menu_view_release_cursor(GtkWidget *menu G_GNUC_UNUSED,
+                                            VirtViewerWindow *self)
+{
+    virt_viewer_display_release_cursor(VIRT_VIEWER_DISPLAY(self->priv->display));
+}
+
+G_MODULE_EXPORT void
 virt_viewer_window_menu_help_about(GtkWidget *menu G_GNUC_UNUSED,
                                    VirtViewerWindow *self)
 {
diff --git a/src/virt-viewer.xml b/src/virt-viewer.xml
index a561262..bef89ac 100644
--- a/src/virt-viewer.xml
+++ b/src/virt-viewer.xml
@@ -49,6 +49,26 @@
                       </object>
                     </child>
                     <child>
+                      <object class="GtkMenuItem" id="menu-file-smartcard-insert">
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="accel_path"><virt-viewer>/file/smartcard-insert</property>
+                        <property name="label" translatable="yes">Smartcard insertion</property>
+                        <property name="use_underline">True</property>
+                        <signal name="activate" handler="virt_viewer_window_menu_file_smartcard_insert" swapped="no"/>
+                      </object>
+                    </child>
+                    <child>
+                      <object class="GtkMenuItem" id="menu-file-smartcard-remove">
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="accel_path"><virt-viewer>/file/smartcard-remove</property>
+                        <property name="label" translatable="yes">Smartcard removal</property>
+                        <property name="use_underline">True</property>
+                        <signal name="activate" handler="virt_viewer_window_menu_file_smartcard_remove" swapped="no"/>
+                      </object>
+                    </child>
+                    <child>
                       <object class="GtkSeparatorMenuItem" id="separatormenuitem1">
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
@@ -87,6 +107,7 @@
                         <property name="visible">True</property>
                         <property name="can_focus">False</property>
                         <property name="use_action_appearance">False</property>
+                        <property name="accel_path"><virt-viewer>/view/fullscreen</property>
                         <property name="label" translatable="yes">Full screen</property>
                         <property name="use_underline">True</property>
                         <accelerator key="F11" signal="activate"/>
@@ -169,6 +190,16 @@
                         <property name="use_underline">True</property>
                       </object>
                     </child>
+                    <child>
+                      <object class="GtkMenuItem" id="menu-view-release-cursor">
+                        <property name="can_focus">False</property>
+                        <property name="use_action_appearance">False</property>
+                        <property name="accel_path"><virt-viewer>/view/release-cursor</property>
+                        <property name="label" translatable="yes">Release cursor</property>
+                        <property name="use_underline">True</property>
+                        <signal name="activate" handler="virt_viewer_window_menu_view_release_cursor" swapped="no"/>
+                      </object>
+                    </child>
                   </object>
                 </child>
               </object>
-- 
1.7.7.6




More information about the virt-tools-list mailing list