diff options
| author | Chris Lumens <clumens@redhat.com> | 2012-07-12 14:34:31 -0400 |
|---|---|---|
| committer | Chris Lumens <clumens@redhat.com> | 2012-07-12 14:34:31 -0400 |
| commit | 8ee5cbf54946e880c77a3d6d7f7004343dfc8aa0 (patch) | |
| tree | 3b0753ca0a46754a3b6058496143caedf62ff126 /pyanaconda | |
| parent | 0661fcbdafaded73a3f3256af3d8985554ec5b82 (diff) | |
| download | anaconda-8ee5cbf54946e880c77a3d6d7f7004343dfc8aa0.tar.gz anaconda-8ee5cbf54946e880c77a3d6d7f7004343dfc8aa0.tar.xz anaconda-8ee5cbf54946e880c77a3d6d7f7004343dfc8aa0.zip | |
Make hub continue button sensitivity more complicated.
It can only be sensitive both if there's no incomplete spokes and no not
ready spokes. By not tracking not ready spokes, it's possible to hit
continue while things are still downloading. This can lead to very bad
situations, and it's only by accident that we've not hit this yet.
Diffstat (limited to 'pyanaconda')
| -rw-r--r-- | pyanaconda/ui/gui/hubs/__init__.py | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/pyanaconda/ui/gui/hubs/__init__.py b/pyanaconda/ui/gui/hubs/__init__.py index 238f391b8..b2de91a79 100644 --- a/pyanaconda/ui/gui/hubs/__init__.py +++ b/pyanaconda/ui/gui/hubs/__init__.py @@ -78,6 +78,7 @@ class Hub(UIObject): self._autoContinue = False self._incompleteSpokes = [] + self._notReadySpokes = [] self._spokes = {} self.storage = storage @@ -154,6 +155,9 @@ class Hub(UIObject): spoke.selector.set_sensitive(False) spoke.initialize() + if not spoke.ready: + self._notReadySpokes.append(spoke) + # Set some default values on the associated selector that # affect its display on the hub. self._updateCompleteness(spoke) @@ -205,9 +209,10 @@ class Hub(UIObject): if spoke not in self._incompleteSpokes: self._incompleteSpokes.append(spoke) + self._updateContinueButton() + if len(self._incompleteSpokes) == 0: self.window.clear_info() - self.continueButton.set_sensitive(True) else: if flags.automatedInstall: msg = _("When all items marked with this icon are complete, installation will automatically continue.") @@ -215,7 +220,9 @@ class Hub(UIObject): msg = _("Please complete items marked with this icon before continuing to the next step.") self.window.set_info(Gtk.MessageType.WARNING, msg) - self.continueButton.set_sensitive(False) + + def _updateContinueButton(self): + self.continueButton.set_sensitive(len(self._incompleteSpokes) == 0 and len(self._notReadySpokes) == 0) def _update_spokes(self): from pyanaconda.ui.gui import communication @@ -239,9 +246,19 @@ class Hub(UIObject): if code == communication.HUB_CODE_NOT_READY: self._updateCompleteness(spoke) + + if spoke not in self._notReadySpokes: + self._notReadySpokes.append(spoke) + + self._updateContinueButton() elif code == communication.HUB_CODE_READY: self._updateCompleteness(spoke) + if spoke in self._notReadySpokes: + self._notReadySpokes.remove(spoke) + + self._updateContinueButton() + # If this is a real kickstart install (the kind with an input ks file) # and all spokes are now completed, we should skip ahead to the next # hub automatically. Take into account the possibility the user is |
