[virt-tools-list] [PATCHv2 virt-viewer 10/10] Enable share folder widgets if supported by session

Marc-André Lureau marcandre.lureau at gmail.com
Wed Mar 4 18:01:16 UTC 2015


---
 src/virt-viewer-app.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/virt-viewer-app.c b/src/virt-viewer-app.c
index 93a84dd..6b5bc39 100644
--- a/src/virt-viewer-app.c
+++ b/src/virt-viewer-app.c
@@ -2422,6 +2422,7 @@ void
 virt_viewer_app_show_preferences(VirtViewerApp *self, GtkWidget *parent)
 {
     GtkWidget *preferences = self->priv->preferences;
+    VirtViewerSession *session = virt_viewer_app_get_session(self);
 
     if (preferences)
         goto present;
@@ -2432,6 +2433,17 @@ virt_viewer_app_show_preferences(VirtViewerApp *self, GtkWidget *parent)
     preferences = GTK_WIDGET(gtk_builder_get_object(builder, "preferences"));
     self->priv->preferences = preferences;
 
+    gboolean can_share_folder = virt_viewer_session_can_share_folder(session);
+    g_object_set (gtk_builder_get_object(builder, "cbsharefolder"),
+                  "sensitive", can_share_folder, NULL);
+    g_object_set (gtk_builder_get_object(builder, "cbsharefolderro"),
+                  "sensitive", can_share_folder, NULL);
+    g_object_set (gtk_builder_get_object(builder, "fcsharefolder"),
+                  "sensitive", can_share_folder, NULL);
+
+    if (!can_share_folder)
+        goto present;
+
     g_object_bind_property(virt_viewer_app_get_session(self),
                            "share-folder",
                            gtk_builder_get_object(builder, "cbsharefolder"),
-- 
2.1.0




More information about the virt-tools-list mailing list