[PATCH 2/2] On storage, remove the "Continue" button and make "Done" do it all (#882737).

Chris Lumens clumens at redhat.com
Wed Jan 9 22:02:11 UTC 2013


This is another attempt to fix some of the confusion of having both a Continue
and a Done button on the same screen.  To clear it up, I've completely removed
the Continue button and made the Done button do everything that Continue used
to do.  This makes the storage spoke a little more standalone instead of the
first screen in a series.
---
 pyanaconda/ui/gui/spokes/storage.glade | 26 ++++----------------------
 pyanaconda/ui/gui/spokes/storage.py    | 16 ++++++++++------
 2 files changed, 14 insertions(+), 28 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.glade b/pyanaconda/ui/gui/spokes/storage.glade
index 43e2791..047abbf 100644
--- a/pyanaconda/ui/gui/spokes/storage.glade
+++ b/pyanaconda/ui/gui/spokes/storage.glade
@@ -951,26 +951,6 @@
                     <property name="row_spacing">6</property>
                     <property name="column_spacing">6</property>
                     <child>
-                      <object class="GtkButton" id="continue_button">
-                        <property name="label" translatable="yes">_Continue</property>
-                        <property name="visible">True</property>
-                        <property name="can_focus">True</property>
-                        <property name="receives_default">True</property>
-                        <property name="halign">end</property>
-                        <property name="valign">end</property>
-                        <property name="hexpand">True</property>
-                        <property name="use_underline">True</property>
-                        <property name="xalign">1</property>
-                        <signal name="clicked" handler="on_continue_clicked" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">1</property>
-                        <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">2</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkButton" id="summary_button">
                         <property name="label" translatable="yes">_Full disk summary and options...</property>
                         <property name="visible">True</property>
@@ -1016,13 +996,15 @@
                         <property name="can_focus">True</property>
                         <property name="receives_default">False</property>
                         <property name="halign">end</property>
-                        <property name="xalign">0</property>
+                        <property name="valign">end</property>
+                        <property name="hexpand">True</property>
+                        <property name="xalign">1</property>
                         <property name="draw_indicator">True</property>
                         <property name="use_underline">True</property>
                       </object>
                       <packing>
                         <property name="left_attach">1</property>
-                        <property name="top_attach">0</property>
+                        <property name="top_attach">2</property>
                         <property name="width">1</property>
                         <property name="height">1</property>
                       </packing>
diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index 0324ef3..6efd00d 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -584,7 +584,6 @@ class StorageSpoke(NormalSpoke, StorageChecker):
         else:
             self.clear_info()
 
-        self.builder.get_object("continue_button").set_sensitive(count > 0)
         self.builder.get_object("summary_label").set_sensitive(count > 0)
 
     def _update_disk_list(self):
@@ -634,7 +633,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
 
         return rc
 
-    def on_continue_clicked(self, button):
+    def on_back_clicked(self, button):
         # Remove all non-existing devices if autopart was active when we last
         # refreshed.
         if self._previous_autopart:
@@ -658,6 +657,11 @@ class StorageSpoke(NormalSpoke, StorageChecker):
         disks = [d for d in self.disks if d.name in self.selected_disks]
         disks_size = sum(Size(spec="%f MB" % d.size) for d in disks)
 
+        # No disks selected?  The user wants to back out of the storage spoke.
+        if not disks:
+            NormalSpoke.on_back_clicked(self, button)
+            return
+
         # Figure out if the existing disk labels will work on this platform
         # you need to have at least one of the platform's labels in order for
         # any of the free space to be useful.
@@ -713,14 +717,14 @@ class StorageSpoke(NormalSpoke, StorageChecker):
 
                 self.passphrase = dialog.passphrase
 
-            gtk_call_once(self.window.emit, "button-clicked")
+            NormalSpoke.on_back_clicked(self, button)
         elif rc == dialog.RESPONSE_CANCEL:
             # stay on this spoke
-            print "user chose to continue disk selection"
+            return
         elif rc == dialog.RESPONSE_MODIFY_SW:
             # go to software spoke
             self.skipTo = "SoftwareSelectionSpoke"
-            gtk_call_once(self.window.emit, "button-clicked")
+            NormalSpoke.on_back_clicked(self, button)
         elif rc == dialog.RESPONSE_RECLAIM:
             self.autopart = not dialog.custom
             self.autoPartType = dialog.autoPartType
@@ -732,7 +736,7 @@ class StorageSpoke(NormalSpoke, StorageChecker):
 
             if dialog.custom:
                 self.skipTo = "CustomPartitioningSpoke"
-                gtk_call_once(self.window.emit, "button-clicked")
+                NormalSpoke.on_back_clicked(self, button)
             else:
                 if self.encrypted:
                     dialog = PassphraseDialog(self.data)
-- 
1.7.11.2



More information about the anaconda-patches mailing list