summaryrefslogtreecommitdiffstats
path: root/gui.py
diff options
context:
space:
mode:
authorChris Lumens <clumens@redhat.com>2010-01-27 14:50:49 -0500
committerChris Lumens <clumens@redhat.com>2010-01-29 11:12:50 -0500
commit2172c5189f9b65a27adc6503e4d0358fc99242f1 (patch)
tree6f17245df21a0259673a3728ee8058117186f931 /gui.py
parent6e7db4f1cb954c3f7402c4ddef4e75aecd17a684 (diff)
downloadanaconda-2172c5189f9b65a27adc6503e4d0358fc99242f1.tar.gz
anaconda-2172c5189f9b65a27adc6503e4d0358fc99242f1.tar.xz
anaconda-2172c5189f9b65a27adc6503e4d0358fc99242f1.zip
Allow getScreen methods to indicate the screen should be skipped.
This is sometimes useful, like when we won't know until the screen is being populated whether or not we actually want to display it.
Diffstat (limited to 'gui.py')
-rwxr-xr-xgui.py14
1 files changed, 12 insertions, 2 deletions
diff --git a/gui.py b/gui.py
index 69559b94d..4de661a9f 100755
--- a/gui.py
+++ b/gui.py
@@ -1352,7 +1352,7 @@ class InstallControlWindow:
(file, className) = stepToClass[step]
newScreenClass = None
- while 1:
+ while True:
try:
found = imputil.imp.find_module(file)
loaded = imputil.imp.load_module(className, found[0], found[1],
@@ -1386,8 +1386,18 @@ class InstallControlWindow:
self.currentWindow = newScreenClass(ics)
new_screen = self.currentWindow.getScreen(anaconda)
+
+ # If the getScreen method returned None, that means the screen did not
+ # want to be displayed for some reason and we should skip to the next
+ # step. However, we do not want to remove the current step from the
+ # list as later events may cause the screen to be displayed.
if not new_screen:
- return
+ if self.anaconda.dispatch.dir == DISPATCH_FORWARD:
+ self.anaconda.dispatch.gotoNext()
+ else:
+ self.anaconda.dispatch.gotoPrev()
+
+ return self.setScreen()
self.update (ics)