These methods are required for more strange background processing, mainly required for storage. --- pyanaconda/ui/gui/spokes/__init__.py | 17 +++++++++++++++++ pyanaconda/ui/gui/spokes/keyboard.py | 4 ++-- pyanaconda/ui/gui/spokes/software.py | 4 ++-- pyanaconda/ui/gui/spokes/source.py | 4 ++-- 4 files changed, 23 insertions(+), 6 deletions(-) diff --git a/pyanaconda/ui/gui/spokes/__init__.py b/pyanaconda/ui/gui/spokes/__init__.py index 6124c87..216fc12 100644 --- a/pyanaconda/ui/gui/spokes/__init__.py +++ b/pyanaconda/ui/gui/spokes/__init__.py @@ -169,6 +169,23 @@ class NormalSpoke(Spoke): Spoke.__init__(self, data, devicetree, instclass) + def populate(self, readyCB=None): + """A special overridden version of UIObject.populate. This method + also takes a callback to be called whenever this spoke becomes + ready (see below). Very few spokes should ever concern themselves + with this, however. + """ + Spoke.populate(self) + + @property + def ready(self): + """Returns True if the Spoke has all the information required to be + displayed. Almost all spokes should keep the default value here. + Only override this method if the Spoke requires some potentially + long-lived process (like storage probing) before it's ready. + """ + return True + class PersonalizationSpoke(Spoke): """A PersonalizationSpoke is a Spoke subclass that is displayed when the user selects something on the Hub during package installation. diff --git a/pyanaconda/ui/gui/spokes/keyboard.py b/pyanaconda/ui/gui/spokes/keyboard.py index a88ca62..83ce651 100644 --- a/pyanaconda/ui/gui/spokes/keyboard.py +++ b/pyanaconda/ui/gui/spokes/keyboard.py @@ -120,8 +120,8 @@ class KeyboardSpoke(NormalSpoke): def status(self): return _("Something selected") - def populate(self): - NormalSpoke.populate(self) + def populate(self, readyCB=None): + NormalSpoke.populate(self, readyCB) self._store = self.builder.get_object("addedLayoutStore") self._addLayout(self._store, "English (US)") diff --git a/pyanaconda/ui/gui/spokes/software.py b/pyanaconda/ui/gui/spokes/software.py index 3cb71a4..7e80f2f 100644 --- a/pyanaconda/ui/gui/spokes/software.py +++ b/pyanaconda/ui/gui/spokes/software.py @@ -55,8 +55,8 @@ class SoftwareSelectionSpoke(NormalSpoke): return row[2] - def populate(self): - NormalSpoke.populate(self) + def populate(self, readyCB=None): + NormalSpoke.populate(self, readyCB) self._desktopStore = self.builder.get_object("desktopStore") self._addSelection(self._desktopStore, "Desktop", "The default Fedora desktop.") diff --git a/pyanaconda/ui/gui/spokes/source.py b/pyanaconda/ui/gui/spokes/source.py index a5a8d8e..6033ff7 100644 --- a/pyanaconda/ui/gui/spokes/source.py +++ b/pyanaconda/ui/gui/spokes/source.py @@ -203,8 +203,8 @@ class SourceSpoke(NormalSpoke): self._verifyIsoButton = self.builder.get_object("verifyIsoButton") - def populate(self): - NormalSpoke.populate(self) + def populate(self, readyCB=None): + NormalSpoke.populate(self, readyCB) self._grabObjects() -- 1.7.6 _______________________________________________ Anaconda-devel-list mailing list Anaconda-devel-list@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/anaconda-devel-list