Make back window of first wizard pane work
authorDavid Bartley <dtbartle@csclub.uwaterloo.ca>
Wed, 14 Nov 2007 00:37:59 +0000 (19:37 -0500)
committerDavid Bartley <dtbartle@csclub.uwaterloo.ca>
Wed, 14 Nov 2007 00:37:59 +0000 (19:37 -0500)
pylib/csc/apps/urwid/widgets.py
pylib/csc/apps/urwid/window.py

index a0f440b..1294035 100644 (file)
@@ -1,5 +1,6 @@
 import urwid
 from csc.apps.urwid.ldapfilter import *
+from csc.apps.urwid.window import raise_back
 
 class ButtonText(urwid.Text):
     def __init__(self, callback, data, *args, **kwargs):
@@ -79,6 +80,8 @@ class Wizard(urwid.WidgetWrap):
         self.select(self.selected + 1)
 
     def back(self, *args, **kwargs):
+        if self.selected == 0:
+            raise_back()
         self.select(self.selected - 1, False)
 
 class WizardPanel(urwid.WidgetWrap):
index 773fff7..836b11f 100644 (file)
@@ -55,7 +55,7 @@ def event_loop(ui):
            for k in keys:
               if k == "esc":
                  if not pop_window():
-                     break   
+                     break
               elif k == "window resize":
                  (cols, rows) = ui.get_cols_rows()
               else: