clean up getNamedWindow
@@ -56,7 +56,7 @@ class Controller:
self.findAndChangeTo('interactiveQuit')
def changeToHostWindow(self, *args):
- host = self.getNamedWindow('inputWindow', True)
+ host = self.getNamedWindow('inputWindow')
if app.config.strict_debug:
assert issubclass(self.view.__class__, app.window.Window), self.view
assert issubclass(host.__class__, app.window.Window), host
@@ -91,7 +91,7 @@ class Controller:
self.findAndChangeTo('interactiveQuit')
def changeToSaveAs(self):
- view = self.getNamedWindow('fileManagerWindow', True)
+ view = self.getNamedWindow('fileManagerWindow')
view.setMode('saveAs')
view.bringToFront()
view.changeFocusTo(view);
@@ -111,21 +111,17 @@ class Controller:
self.commandDefault(ch, meta)
self.textBuffer.compoundChangePush()
- def getNamedWindow(self, windowName, unfocus=False):
+ def getNamedWindow(self, windowName):
view = self.view
- first = True
while view is not None:
if hasattr(view, windowName):
return getattr(view, windowName);
- #if not first and unfocus and view.isFocusable:
- # view.unfocus()
- first = False
view = view.parent
app.log.fatal(windowName + ' not found');
return None
def findAndChangeTo(self, windowName):
- window = self.getNamedWindow(windowName, True)
+ window = self.getNamedWindow(windowName)
window.bringToFront()
self.view.changeFocusTo(window)
@@ -134,7 +130,7 @@ class Controller:
pass
def confirmationPromptFinish(self, *args):
- window = self.getNamedWindow('inputWindow', True)
+ window = self.getNamedWindow('inputWindow')
window.userIntent = 'edit'
window.bringToFront()
self.view.changeFocusTo(window)
@@ -284,7 +280,7 @@ class Controller:
def saveEventChangeToHostWindow(self, *args):
curses.ungetch(self.savedCh)
- host = self.getNamedWindow('inputWindow', True)
+ host = self.getNamedWindow('inputWindow')
host.bringToFront()
self.view.changeFocusTo(host)
