[virt-tools-list] [PATCH 05/22] window: move default sensitivity in .ui

marcandre.lureau at redhat.com marcandre.lureau at redhat.com
Tue Jul 31 13:41:08 UTC 2018


From: Marc-André Lureau <marcandre.lureau at redhat.com>

Instead of modifying it in object initialization.

Signed-off-by: Marc-André Lureau <marcandre.lureau at redhat.com>
---
 src/resources/ui/virt-viewer.ui | 4 ++++
 src/virt-viewer-window.c        | 5 -----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/resources/ui/virt-viewer.ui b/src/resources/ui/virt-viewer.ui
index e9609ec..9da1403 100644
--- a/src/resources/ui/virt-viewer.ui
+++ b/src/resources/ui/virt-viewer.ui
@@ -34,6 +34,7 @@
                         <property name="accel_group">accelgroup</property>
                         <child>
                           <object class="GtkMenuItem" id="menu-file-screenshot">
+                            <property name="sensitive">False</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="use_action_appearance">False</property>
@@ -83,6 +84,7 @@
                         </child>
                         <child>
                           <object class="GtkMenuItem" id="menu-preferences">
+                            <property name="sensitive">False</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="label" translatable="yes">_Preferences</property>
@@ -136,6 +138,7 @@
                         </child>
                         <child>
                           <object class="GtkMenuItem" id="menu-view-zoom">
+                            <property name="sensitive">False</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
                             <property name="use_action_appearance">False</property>
@@ -214,6 +217,7 @@
                 </child>
                 <child>
                   <object class="GtkMenuItem" id="menu-send">
+                    <property name="sensitive">False</property>
                     <property name="visible">True</property>
                     <property name="can_focus">False</property>
                     <property name="use_action_appearance">False</property>
diff --git a/src/virt-viewer-window.c b/src/virt-viewer-window.c
index 4b48e31..301a3bf 100644
--- a/src/virt-viewer-window.c
+++ b/src/virt-viewer-window.c
@@ -313,11 +313,6 @@ virt_viewer_window_init (VirtViewerWindow *self)
 
     priv->builder = virt_viewer_util_load_ui("virt-viewer.ui");
 
-    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-send")), FALSE);
-    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-view-zoom")), FALSE);
-    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-file-screenshot")), FALSE);
-    gtk_widget_set_sensitive(GTK_WIDGET(gtk_builder_get_object(self->priv->builder, "menu-preferences")), FALSE);
-
     gtk_builder_connect_signals(priv->builder, self);
 
     priv->accel_group = GTK_ACCEL_GROUP(gtk_builder_get_object(priv->builder, "accelgroup"));
-- 
2.18.0.321.gffc6fa0e39




More information about the virt-tools-list mailing list