[PATCH 6/8] Add a button to the specialized window to bring up the add dialog.

Chris Lumens clumens at redhat.com
Thu Mar 14 18:48:49 UTC 2013


---
 pyanaconda/ui/gui/spokes/storage.glade | 22 +++++++++++++++++++++-
 pyanaconda/ui/gui/spokes/storage.py    | 18 ++++++++++++++----
 2 files changed, 35 insertions(+), 5 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.glade b/pyanaconda/ui/gui/spokes/storage.glade
index a7ca795..1c6aaf0 100644
--- a/pyanaconda/ui/gui/spokes/storage.glade
+++ b/pyanaconda/ui/gui/spokes/storage.glade
@@ -2,6 +2,12 @@
 <interface>
   <!-- interface-requires gtk+ 3.0 -->
   <!-- interface-requires AnacondaWidgets 1.0 -->
+  <object class="GtkImage" id="addSpecializedImage">
+    <property name="visible">True</property>
+    <property name="can_focus">False</property>
+    <property name="icon_name">drive-harddisk</property>
+    <property name="icon-size">6</property>
+  </object>
   <object class="GtkDialog" id="options1_dialog">
     <property name="width_request">500</property>
     <property name="height_request">200</property>
@@ -976,7 +982,21 @@
                             <property name="hexpand">True</property>
                             <property name="spacing">30</property>
                             <child>
-                              <placeholder/>
+                              <object class="GtkButton" id="addSpecializedButton">
+                                <property name="label" translatable="yes">_Add a disk...</property>
+                                <property name="visible">True</property>
+                                <property name="can_focus">True</property>
+                                <property name="receives_default">True</property>
+                                <property name="use_underline">True</property>
+                                <property name="image">addSpecializedImage</property>
+                                <property name="image_position">top</property>
+                                <signal name="clicked" handler="on_specialized_clicked" swapped="no"/>
+                              </object>
+                              <packing>
+                                <property name="expand">False</property>
+                                <property name="fill">False</property>
+                                <property name="position">0</property>
+                              </packing>
                             </child>
                           </object>
                         </child>
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 810f50a..bf9a068 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -301,7 +301,7 @@ class StorageChecker(object):
             log.warn(w)
 
 class StorageSpoke(NormalSpoke, StorageChecker):
-    builderObjects = ["storageWindow"]
+    builderObjects = ["storageWindow", "addSpecializedImage"]
     mainWidgetName = "storageWindow"
     uiFile = "spokes/storage.glade"
 
@@ -501,13 +501,23 @@ class StorageSpoke(NormalSpoke, StorageChecker):
 
         NormalSpoke.initialize(self)
 
+        # Wouldn't it be nice if glade knew how to do this?
         label = self.builder.get_object("summary_button").get_children()[0]
         markup = "<span foreground='blue'><u>%s</u></span>" % label.get_text()
         label.set_use_markup(True)
         label.set_markup(markup)
 
+        specializedButton = self.builder.get_object("addSpecializedButton")
+
+        # It's uh... uh... it's down there somewhere, let me take another look.
+        label = specializedButton.get_children()[0].get_children()[0].get_children()[1]
+        markup = "<span size='large'><b>%s</b></span>" % label.get_text()
+        label.set_use_markup(True)
+        label.set_markup(markup)
+        specializedButton.show_all()
+
         self.local_disks_box = self.builder.get_object("local_disks_box")
-        #specialized_disks_box = self.builder.get_object("specialized_disks_box")
+        self.specialized_disks_box = self.builder.get_object("specialized_disks_box")
 
         threadMgr.add(AnacondaThread(name="AnaStorageWatcher", target=self._initialize))
 
@@ -781,8 +791,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
         rc = self.run_lightbox_dialog(resizeDialog)
         return rc
 
-    def on_add_disk_clicked(self, button):
-        print "ADD DISK CLICKED"
+    def on_specialized_clicked(self, button):
+        return
 
     def on_info_bar_clicked(self, *args):
         if self.errors:
-- 
1.8.1.2



More information about the anaconda-patches mailing list