[PATCH 4/7] Allow more than one Page to be expanded at a time.

Chris Lumens clumens at redhat.com
Wed Feb 27 21:18:28 UTC 2013


This should help a little bit with the confusion people have where it looks
like filesystems are vanishing, when instead they are just moving to under
a different root.  However, note that anything calling _do_refresh will cause
everything to be closed except the current page.

I do not yet see a way around that.
---
 pyanaconda/ui/gui/spokes/custom.py        | 31 +++++--------------------------
 pyanaconda/ui/gui/spokes/lib/accordion.py |  9 ---------
 2 files changed, 5 insertions(+), 35 deletions(-)

diff --git a/pyanaconda/ui/gui/spokes/custom.py b/pyanaconda/ui/gui/spokes/custom.py
index 910bfc1..d540f2a 100644
--- a/pyanaconda/ui/gui/spokes/custom.py
+++ b/pyanaconda/ui/gui/spokes/custom.py
@@ -659,11 +659,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
             self._current_selector.set_chosen(False)
             self._current_selector = None
 
-        # We can only have one page expanded at a time.
-        page_order = []
-        if self._current_page:
-            page_order.append(self._current_page.pageTitle)
-
         # Make sure we start with a clean slate.
         self._accordion.removeAllPages()
 
@@ -703,9 +698,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
                                  partitionsToReuse=bool(ui_roots))
             self._accordion.addPage(page, cb=self.on_page_clicked)
 
-            if page.pageTitle not in page_order:
-                page_order.append(page.pageTitle)
-
             self._partitionsNotebook.set_current_page(NOTEBOOK_LABEL_PAGE)
             label = self.builder.get_object("whenCreateLabel")
             label.set_text(self._when_create_text % (productName, productVersion))
@@ -753,9 +745,6 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
             page.show_all()
             self._accordion.addPage(page, cb=self.on_page_clicked)
 
-            if root.name not in page_order:
-                page_order.append(root.name)
-
         # Anything that doesn't go with an OS we understand?  Put it in the Other box.
         if self.unusedDevices:
             page = UnknownPage(_("Unknown"))
@@ -766,22 +755,12 @@ class CustomPartitioningSpoke(NormalSpoke, StorageChecker):
             page.show_all()
             self._accordion.addPage(page, cb=self.on_page_clicked)
 
-            if page.pageTitle not in page_order:
-                page_order.append(page.pageTitle)
-
-        for page_name in page_order:
-            try:
-                self._accordion.expandPage(page_name)
-            except LookupError:
-                continue
-            else:
-                break
-
+        # And then open the first page by default.  Most of the time, this will
+        # be fine since it'll be the new installation page.
         self._initialized = True
-        currentPage = self._current_page
-        if currentPage:
-            self.on_page_clicked(self.currentPage,
-                                 mountpointToShow=mountpointToShow)
+        firstPage = self._accordion.allPages[0]
+        self._accordion.expandPage(firstPage.pageTitle)
+        self.on_page_clicked(firstPage, mountpointToShow=mountpointToShow)
 
     ###
     ### RIGHT HAND SIDE METHODS
diff --git a/pyanaconda/ui/gui/spokes/lib/accordion.py b/pyanaconda/ui/gui/spokes/lib/accordion.py
index e70bbe7..19af520 100644
--- a/pyanaconda/ui/gui/spokes/lib/accordion.py
+++ b/pyanaconda/ui/gui/spokes/lib/accordion.py
@@ -158,15 +158,6 @@ class Accordion(Gtk.Box):
         self._expanders = []
 
     def _onExpanded(self, obj, cb=None):
-        # Set all other expanders to closed, but don't do anything to the
-        # expander this method was called on.  It's already been handled by
-        # the default activate signal handler.
-        for expander in self._expanders:
-            if expander == obj:
-                continue
-
-            expander.set_expanded(False)
-
         if cb:
             cb(obj.get_child())
 
-- 
1.8.1.2



More information about the anaconda-patches mailing list