[gnome-disk-utility] Show a menu for the RAID multiple-selection toolbar button



commit 532e86a4215c3951f379cbe53adeb931024d7df5
Author: David Zeuthen <zeuthen gmail com>
Date:   Wed Oct 10 17:05:05 2012 -0400

    Show a menu for the RAID multiple-selection toolbar button
    
    Signed-off-by: David Zeuthen <zeuthen gmail com>

 data/ui/disks.ui      |   23 ++++++++++++++++++++++-
 src/disks/gduwindow.c |   16 ++++++++++------
 2 files changed, 32 insertions(+), 7 deletions(-)
---
diff --git a/data/ui/disks.ui b/data/ui/disks.ui
index 9d647e8..7ea99cc 100644
--- a/data/ui/disks.ui
+++ b/data/ui/disks.ui
@@ -1875,6 +1875,26 @@
       </object>
     </child>
   </object>
+  <object class="GtkMenu" id="ms-raid-menu">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <child>
+      <object class="GtkMenuItem" id="ms-raid-menu-item-create">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Create New RAID Array...</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+    <child>
+      <object class="GtkMenuItem" id="ms-raid-menu-item-add-to">
+        <property name="visible">True</property>
+        <property name="can_focus">False</property>
+        <property name="label" translatable="yes">Add To Existing RAID Array...</property>
+        <property name="use_underline">True</property>
+      </object>
+    </child>
+  </object>
   <object class="GtkWindow" id="overlay-toolbar-dummy-window">
     <property name="can_focus">False</property>
     <child>
@@ -1916,7 +1936,8 @@
                   </packing>
                 </child>
                 <child>
-                  <object class="GtkButton" id="overlay-toolbar-create-raid-button">
+                  <object class="GtkMenuButton" id="overlay-toolbar-raid-button">
+                    <property name="menu">ms-raid-menu</property>
                     <property name="label" translatable="yes">RAID</property>
                     <property name="visible">True</property>
                     <property name="can_focus">True</property>
diff --git a/src/disks/gduwindow.c b/src/disks/gduwindow.c
index c2723ee..0919148 100644
--- a/src/disks/gduwindow.c
+++ b/src/disks/gduwindow.c
@@ -62,7 +62,9 @@ struct _GduWindow
 
   GtkWidget *overlay_toolbar;
   GtkWidget *overlay_toolbar_erase_button;
-  GtkWidget *overlay_toolbar_create_raid_button;
+  GtkWidget *overlay_toolbar_raid_button;
+  GtkWidget *ms_raid_menu_item_create;
+  GtkWidget *ms_raid_menu_item_add_to;
 
   GtkWidget *main_hpane;
   GtkWidget *details_notebook;
@@ -168,7 +170,10 @@ static const struct {
   {G_STRUCT_OFFSET (GduWindow, toolbutton_generic_menu), "toolbutton-generic-menu"},
   {G_STRUCT_OFFSET (GduWindow, overlay_toolbar), "overlay-toolbar"},
   {G_STRUCT_OFFSET (GduWindow, overlay_toolbar_erase_button), "overlay-toolbar-erase-button"},
-  {G_STRUCT_OFFSET (GduWindow, overlay_toolbar_create_raid_button), "overlay-toolbar-create-raid-button"},
+  {G_STRUCT_OFFSET (GduWindow, overlay_toolbar_raid_button), "overlay-toolbar-raid-button"},
+  {G_STRUCT_OFFSET (GduWindow, ms_raid_menu_item_create), "ms-raid-menu-item-create"},
+  {G_STRUCT_OFFSET (GduWindow, ms_raid_menu_item_add_to), "ms-raid-menu-item-add-to"},
+
   {G_STRUCT_OFFSET (GduWindow, main_hpane), "main-hpane"},
   {G_STRUCT_OFFSET (GduWindow, device_tree_overlay), "device-tree-overlay"},
   {G_STRUCT_OFFSET (GduWindow, device_tree_scrolledwindow), "device-tree-scrolledwindow"},
@@ -4418,10 +4423,9 @@ update_for_multi_selection (GduWindow *window, ShowFlags *show_flags)
     {
       gtk_widget_show (window->overlay_toolbar);
       gtk_widget_show (window->overlay_toolbar_erase_button);
-      if (num_disks > 1)
-        gtk_widget_show (window->overlay_toolbar_create_raid_button);
-      else
-        gtk_widget_hide (window->overlay_toolbar_create_raid_button);
+      gtk_widget_show (window->overlay_toolbar_raid_button);
+      gtk_widget_set_sensitive (window->ms_raid_menu_item_add_to, TRUE);
+      gtk_widget_set_sensitive (window->ms_raid_menu_item_create, num_disks > 1);
     }
   else
     {



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