[PATCH 4/6] Add a refresh button to the custom partitioning toolbar.

Chris Lumens clumens at redhat.com
Mon Mar 11 20:06:47 UTC 2013


This button throws away whatever changes the user has made in custom
partitioning, rescans the disks, and updates the UI to the new disk status.
This button is designed for the user who's made very specific storage
configuration changes on the shell and wants anaconda to use what they've
created.
---
 pyanaconda/ui/gui/spokes/custom.glade | 20 +++++++++++++++++---
 pyanaconda/ui/gui/spokes/custom.py    |  5 +++++
 2 files changed, 22 insertions(+), 3 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index 3a7ece2..3f8516a 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -1321,12 +1321,11 @@ use.  Try something else?</property>
                         </child>
                         <child>
                           <object class="GtkToolButton" id="removeButton">
-                            <property name="use_action_appearance">False</property>
                             <property name="width_request">42</property>
                             <property name="height_request">36</property>
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
-                            <property name="tooltip_text" translatable="yes">Remove the selected mountpoint(s.)</property>
+                            <property name="tooltip_text" translatable="yes">Remove the selected mountpoint(s).</property>
                             <property name="label" translatable="yes">removeButton</property>
                             <property name="use_underline">True</property>
                             <property name="icon_name">list-remove-symbolic</property>
@@ -1356,11 +1355,26 @@ use.  Try something else?</property>
                           </packing>
                         </child>
                         <child>
+                          <object class="GtkToolButton" id="refreshButton">
+                            <property name="visible">True</property>
+                            <property name="can_focus">False</property>
+                            <property name="tooltip_text" translatable="yes">Reload storage configuration from disk.</property>
+                            <property name="label" translatable="yes">Refresh</property>
+                            <property name="use_underline">True</property>
+                            <property name="icon_name">view-refresh-symbolic</property>
+                            <signal name="clicked" handler="on_refresh_clicked" swapped="no"/>
+                          </object>
+                          <packing>
+                            <property name="expand">False</property>
+                            <property name="homogeneous">True</property>
+                          </packing>
+                        </child>
+                        <child>
                           <object class="GtkToolButton" id="helpButton">
                             <property name="visible">True</property>
                             <property name="can_focus">False</property>
+                            <property name="tooltip_text" translatable="yes">Click for help.</property>
                             <property name="label" translatable="yes">Help</property>
-                            <property name="tooltip_text" translatable="yes">Click for help</property>
                             <property name="use_underline">True</property>
                             <property name="icon_name">system-help-symbolic</property>
                             <signal name="clicked" handler="on_help_clicked" swapped="no"/>
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 2c213e8..3a94dbd 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -2366,6 +2366,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
     def on_reset_clicked(self, *args):
         self.refresh()
 
+    # This callback is for the button that has anaconda go back and rescan the
+    # disks to pick up whatever changes the user made outside our control.
+    def on_refresh_clicked(self, *args):
+        pass
+
     def on_info_bar_clicked(self, *args):
         log.debug("info bar clicked: %s (%s)" % (self._error, args))
         if not self._error:
-- 
1.8.1.2



More information about the anaconda-patches mailing list