Support not-yet-ready spokes in the _createBox loop for hubs.
NormalSpokes (those that you can select off a Hub) can be hidden. Now, they
can also be ready or not. A Spoke is ready if it has all the information
needed to be displayed. Most will always be ready. However, the storage spoke
needs to wait for storageInitialize to finish which could potentially take a
very long time.
However, we do not want to sit in _createBox for a long time as that delays
showing the first hub thus making the UI look hung. Therefore, we will just
mark not-yet-ready spokes as insensitive until they're ready.
pyanaconda/ui/gui/hubs/__init__.py | 16 ++++++++++++----
1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py
index cf847aa..c74acba 100644
@@ -112,14 +112,22 @@ class Hub(UIObject):
# Create the new spoke and populate its UI with whatever data.
# From here on, this Spoke will always exist.
spoke = spokeClass(self.data, self.devicetree, self.instclass)
+ selector = AnacondaWidgets.SpokeSelector(_(spoke.title), spoke.icon)
if not spoke.showable:
- # And then create its associated selector, and set some default
- # values that affect its display on the hub.
- selector = AnacondaWidgets.SpokeSelector(_(spoke.title), spoke.icon)
+ # Does this spoke need a while to wait for some background process
+ # to finish before it can be shown? If so, we need to mark it as
+ # insensitive and tell it how to update itself later.
+ if not spoke.ready:
+ spoke.populate(readyCB=lambda : selector.set_sensitive(True))
+ # Set some default values on the associated selector that
+ # affect its display on the hub.
Anaconda-devel-list mailing list