[f20-branch][PATCH] Don't update hub's continue button and label for every spoke (#1020373)

Vratislav Podzimek vpodzime at redhat.com
Fri Oct 18 11:10:02 UTC 2013


If a spoke is left, we need to update completeness of the spokes and also of the
hub. But instead of updating completeness of the hub after updating completeness
of every single spoke, we can do it afterwards only once. This removes a
possibly long hang (on live installations) caused by poking in yum and storage
many times.

Signed-off-by: Vratislav Podzimek <vpodzime at redhat.com>
---
 pyanaconda/ui/gui/hubs/__init__.py | 14 ++++++++++----
 1 file changed, 10 insertions(+), 4 deletions(-)

diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index f142a18..93af233 100644
--- a/pyanaconda/ui/gui/hubs/__init__.py
+++ b/pyanaconda/ui/gui/hubs/__init__.py
@@ -254,14 +254,14 @@ class Hub(GUIObject, common.Hub):
 
         setViewportBackground(viewport)
 
-    def _updateCompleteness(self, spoke):
+    def _updateCompleteness(self, spoke, update_continue=True):
         spoke.selector.set_sensitive(spoke.ready)
         spoke.selector.set_property("status", spoke.status)
         spoke.selector.set_tooltip_markup(GLib.markup_escape_text(spoke.status))
         spoke.selector.set_incomplete(not spoke.completed and spoke.mandatory)
-        self._handleCompleteness(spoke)
+        self._handleCompleteness(spoke, update_continue)
 
-    def _handleCompleteness(self, spoke):
+    def _handleCompleteness(self, spoke, update_continue=True):
         # Add the spoke to the incomplete list if it's now incomplete, and make
         # sure it's not on the list if it's now complete.  Then show the box if
         # it's needed and hide it if it's not.
@@ -272,6 +272,10 @@ class Hub(GUIObject, common.Hub):
             if spoke not in self._incompleteSpokes:
                 self._incompleteSpokes.append(spoke)
 
+        if update_continue:
+            self._updateContinue()
+
+    def _updateContinue(self):
         self.clear_info()
         if len(self._incompleteSpokes) == 0:
             if self._checker and not self._checker.check():
@@ -416,7 +420,9 @@ class Hub(GUIObject, common.Hub):
         # Now update the selector with the current status and completeness.
         for sp in self._spokes.itervalues():
             if not sp.indirect:
-                self._updateCompleteness(sp)
+                self._updateCompleteness(sp, update_continue=False)
+
+        self._updateContinue()
 
         # And then if that spoke wants us to jump straight to another one,
         # handle that now.
-- 
1.7.11.7



More information about the anaconda-patches mailing list