[PATCH 5/5] When the user clicks "Reclaim Space", go back to the hub (#911792).

Chris Lumens clumens at redhat.com
Wed Feb 27 20:43:12 UTC 2013


Going back to the options dialogs is arguably not really a bug (the user may
want to go to custom partitioning), but they have other ways of doing those
things.  Also, watching people test this out showed it to be very confusing
and led to people going down paths they didn't need to.  Also, it's the way
it worked in F17.
---
 pyanaconda/ui/gui/spokes/storage.py | 19 ++++++++++++-------
 1 file changed, 12 insertions(+), 7 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/storage.py b/pyanaconda/ui/gui/spokes/storage.py
index c52eb8d..1b474f0 100644
--- a/pyanaconda/ui/gui/spokes/storage.py
+++ b/pyanaconda/ui/gui/spokes/storage.py
@@ -775,8 +775,10 @@ class StorageSpoke(NormalSpoke, StorageChecker):
                 self.autopart = True
             elif dialog.continue_response == dialog.RESPONSE_CONTINUE_RECLAIM:
                 self.apply()
-                gtk_call_once(self._show_resize_dialog, disks)
-                return
+                if not self._show_resize_dialog(disks):
+                    # User pressed cancel on the reclaim dialog, so don't leave
+                    # the storage spoke.
+                    return
             elif dialog.continue_response == dialog.RESPONSE_CONTINUE_CUSTOM:
                 self.autopart = False
                 self.skipTo = "CustomPartitioningSpoke"
@@ -797,7 +799,12 @@ class StorageSpoke(NormalSpoke, StorageChecker):
                 return
 
             self.apply()
-            gtk_call_once(self._show_resize_dialog, disks)
+            if not self._show_resize_dialog(disks):
+                # User pressed cancel on the reclaim dialog, so don't leave
+                # the storage spoke.
+                return
+
+            NormalSpoke.on_back_clicked(self, button)
         elif rc == dialog.RESPONSE_QUIT:
             raise SystemExit("user-selected exit")
         elif rc == dialog.RESPONSE_CUSTOM:
@@ -812,10 +819,8 @@ class StorageSpoke(NormalSpoke, StorageChecker):
         resizeDialog = ResizeDialog(self.data, self.storage, self.payload)
         resizeDialog.refresh(disks)
 
-        # resizeDialog handles okay/cancel on its own, so we can throw out the
-        # return value.
-        self.run_lightbox_dialog(resizeDialog)
-        gtk_call_once(self.window.emit, "button-clicked")
+        rc = self.run_lightbox_dialog(resizeDialog)
+        return rc
 
     def on_add_disk_clicked(self, button):
         print "ADD DISK CLICKED"
-- 
1.8.1.2



More information about the anaconda-patches mailing list