[gnome-disk-utility/udisks2-port] Make popup menu items insensitive, not invisible if unavailable



commit 49a8b7dc6bcf55b6f91b6dea807fc9a8ab31ee11
Author: David Zeuthen <davidz redhat com>
Date:   Thu Nov 10 16:37:47 2011 -0500

    Make popup menu items insensitive, not invisible if unavailable
    
    Also fix up some capitalization issues.
    
    Signed-off-by: David Zeuthen <davidz redhat com>

 data/ui/palimpsest.ui      |   17 ++++++++++++-----
 src/palimpsest/gduwindow.c |   24 ++++++++++++------------
 2 files changed, 24 insertions(+), 17 deletions(-)
---
diff --git a/data/ui/palimpsest.ui b/data/ui/palimpsest.ui
index 1114fa9..cabbdfb 100644
--- a/data/ui/palimpsest.ui
+++ b/data/ui/palimpsest.ui
@@ -71,16 +71,23 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="use_action_appearance">False</property>
-        <property name="label" translatable="yes">View SMART data...</property>
+        <property name="label" translatable="yes">View SMART Data...</property>
         <property name="use_underline">True</property>
       </object>
     </child>
     <child>
+      <object class="GtkSeparatorMenuItem" id="menuitem1">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="use_action_appearance">False</property>
+      </object>
+    </child>
+    <child>
       <object class="GtkMenuItem" id="generic-menu-item-configure-fstab">
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="use_action_appearance">False</property>
-        <property name="label" translatable="yes">Configure mount options...</property>
+        <property name="label" translatable="yes">Configure Mount Options...</property>
         <property name="use_underline">True</property>
       </object>
     </child>
@@ -89,7 +96,7 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="use_action_appearance">False</property>
-        <property name="label" translatable="yes">Configure encryption...</property>
+        <property name="label" translatable="yes">Configure Encryption...</property>
         <property name="use_underline">True</property>
       </object>
     </child>
@@ -98,7 +105,7 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="use_action_appearance">False</property>
-        <property name="label" translatable="yes">Edit filesystem label...</property>
+        <property name="label" translatable="yes">Edit Filesystem Label...</property>
         <property name="use_underline">True</property>
       </object>
     </child>
@@ -107,7 +114,7 @@
         <property name="visible">True</property>
         <property name="can_focus">False</property>
         <property name="use_action_appearance">False</property>
-        <property name="label" translatable="yes">Edit partition...</property>
+        <property name="label" translatable="yes">Edit Partition...</property>
         <property name="use_underline">True</property>
       </object>
     </child>
diff --git a/src/palimpsest/gduwindow.c b/src/palimpsest/gduwindow.c
index 89dbb7f..321e789 100644
--- a/src/palimpsest/gduwindow.c
+++ b/src/palimpsest/gduwindow.c
@@ -313,18 +313,18 @@ update_for_show_flags (GduWindow *window,
   gtk_action_set_visible (GTK_ACTION (window->devtab_toolbar_lock_button),
                           show_flags & SHOW_FLAGS_ENCRYPTED_LOCK_BUTTON);
 
-  gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_view_smart),
-                          show_flags & SHOW_FLAGS_POPUP_MENU_VIEW_SMART);
-  gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_configure_fstab),
-                          show_flags & SHOW_FLAGS_POPUP_MENU_CONFIGURE_FSTAB);
-  gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_configure_crypttab),
-                          show_flags & SHOW_FLAGS_POPUP_MENU_CONFIGURE_CRYPTTAB);
-  gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_edit_label),
-                          show_flags & SHOW_FLAGS_POPUP_MENU_EDIT_LABEL);
-  gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_edit_partition),
-                          show_flags & SHOW_FLAGS_POPUP_MENU_EDIT_PARTITION);
-  gtk_widget_set_visible (GTK_WIDGET (window->generic_menu_item_format_volume),
-                          show_flags & SHOW_FLAGS_POPUP_MENU_FORMAT_VOLUME);
+  gtk_widget_set_sensitive (GTK_WIDGET (window->generic_menu_item_view_smart),
+                            show_flags & SHOW_FLAGS_POPUP_MENU_VIEW_SMART);
+  gtk_widget_set_sensitive (GTK_WIDGET (window->generic_menu_item_configure_fstab),
+                            show_flags & SHOW_FLAGS_POPUP_MENU_CONFIGURE_FSTAB);
+  gtk_widget_set_sensitive (GTK_WIDGET (window->generic_menu_item_configure_crypttab),
+                            show_flags & SHOW_FLAGS_POPUP_MENU_CONFIGURE_CRYPTTAB);
+  gtk_widget_set_sensitive (GTK_WIDGET (window->generic_menu_item_edit_label),
+                            show_flags & SHOW_FLAGS_POPUP_MENU_EDIT_LABEL);
+  gtk_widget_set_sensitive (GTK_WIDGET (window->generic_menu_item_edit_partition),
+                            show_flags & SHOW_FLAGS_POPUP_MENU_EDIT_PARTITION);
+  gtk_widget_set_sensitive (GTK_WIDGET (window->generic_menu_item_format_volume),
+                            show_flags & SHOW_FLAGS_POPUP_MENU_FORMAT_VOLUME);
   /* TODO: don't show the button bringing up the popup menu if it has no items */
 }
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]