[PATCH 2/6] Hook up the new action summary dialog.

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


This also removes the "Finish Partitioning" button from the custom screen
(good riddance) and relabels the back button to "Done".  This brings it in
line with all the other screens.
---
 pyanaconda/ui/gui/spokes/custom.glade | 21 +--------------------
 pyanaconda/ui/gui/spokes/custom.py    | 25 ++++++++++++++++++-------
 2 files changed, 19 insertions(+), 27 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.glade b/pyanaconda/ui/gui/spokes/custom.glade
index 4cd8db6..997671f 100644
--- a/pyanaconda/ui/gui/spokes/custom.glade
+++ b/pyanaconda/ui/gui/spokes/custom.glade
@@ -400,7 +400,7 @@ use.  Try something else?</property>
     <property name="can_focus">False</property>
     <property name="startup_id">filler</property>
     <property name="window_name" translatable="yes">MANUAL PARTITIONING</property>
-    <property name="button_label" translatable="yes">_Back to destination selection</property>
+    <property name="button_label" translatable="yes">_Done</property>
     <signal name="info-bar-clicked" handler="on_info_bar_clicked" swapped="no"/>
     <signal name="button-clicked" handler="on_back_clicked" swapped="no"/>
     <child internal-child="main_box">
@@ -1498,25 +1498,6 @@ use.  Try something else?</property>
                       </packing>
                     </child>
                     <child>
-                      <object class="GtkButton" id="finishPartitionsButton">
-                        <property name="label" translatable="yes">_Finish Partitioning</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">start</property>
-                        <property name="hexpand">True</property>
-                        <property name="use_underline">True</property>
-                        <signal name="clicked" handler="on_finish_clicked" swapped="no"/>
-                      </object>
-                      <packing>
-                        <property name="left_attach">2</property>
-                        <property name="top_attach">1</property>
-                        <property name="width">1</property>
-                        <property name="height">1</property>
-                      </packing>
-                    </child>
-                    <child>
                       <object class="GtkButton" id="summary_button">
                         <property name="label" translatable="yes">summary</property>
                         <property name="visible">True</property>
diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 3e19707..463af36 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -1,6 +1,6 @@
 # Custom partitioning classes.
 #
-# Copyright (C) 2012  Red Hat, Inc.
+# Copyright (C) 2012, 2013  Red Hat, Inc.
 #
 # This copyrighted material is made available to anyone wishing to use,
 # modify, copy, or redistribute it subject to the terms and conditions of
@@ -77,6 +77,7 @@ from pyanaconda.ui.gui.spokes.storage import StorageChecker
 from pyanaconda.ui.gui.spokes.lib.cart import SelectedDisksDialog
 from pyanaconda.ui.gui.spokes.lib.passphrase import PassphraseDialog
 from pyanaconda.ui.gui.spokes.lib.accordion import *
+from pyanaconda.ui.gui.spokes.lib.summary import ActionSummaryDialog
 from pyanaconda.ui.gui.utils import setViewportBackground
 from pyanaconda.ui.gui.categories.storage import StorageCategory
 
@@ -1598,14 +1599,11 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
     ###
 
     def on_back_clicked(self, button):
-        self.skipTo = "StorageSpoke"
-        NormalSpoke.on_back_clicked(self, button)
-
-    # Use the default back action here, since the finish button takes the user
-    # to the install summary screen.
-    def on_finish_clicked(self, button):
+        # First, save anything from the currently displayed mountpoint.
         self._save_right_side(self._current_selector)
 
+        # Then if they did anything that resulted in new LUKS devices, we need
+        # to prompt for passphrases.
         new_luks = any([d for d in self.__storage.devices
                             if d.format.type == "luks" and
                                not d.format.exists])
@@ -1620,6 +1618,19 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
 
             self.passphrase = dialog.passphrase
 
+        # And then display the summary screen.  From there, the user will either
+        # head back to the hub, or stay on the custom screen.
+        self.__storage.devicetree.sortActions()
+
+        dialog = ActionSummaryDialog(self.data)
+        with enlightbox(self.window, dialog.window):
+            dialog.refresh(self.__storage.devicetree.findActions())
+            rc = dialog.run()
+
+        if rc == 0:
+            # Cancel.  Stay on the custom screen.
+            return
+
         NormalSpoke.on_back_clicked(self, button)
 
     def on_customize_activated(self, expander):
-- 
1.8.1.2



More information about the anaconda-patches mailing list