Add a key to return to the project list
To facilitate escaping from a deep stack of screens, add a key to clear the history and return to the main project list. Bind this to meta-home by default. Change-Id: Ic98e47d7a3a17271bf21230ec4bac184f691ced3
This commit is contained in:
parent
dbe0f37b04
commit
cdd6bd2399
@ -500,6 +500,9 @@ class App(object):
|
||||
commands = self.config.keymap.getCommands(key)
|
||||
if keymap.PREV_SCREEN in commands:
|
||||
self.backScreen()
|
||||
elif keymap.TOP_SCREEN in commands:
|
||||
self.clearHistory()
|
||||
self.refresh(force=True)
|
||||
elif keymap.HELP in commands:
|
||||
self.help()
|
||||
elif keymap.QUIT in commands:
|
||||
|
@ -31,6 +31,7 @@ CURSOR_MAX_RIGHT = urwid.CURSOR_MAX_RIGHT
|
||||
ACTIVATE = urwid.ACTIVATE
|
||||
# Global gertty commands:
|
||||
PREV_SCREEN = 'previous screen'
|
||||
TOP_SCREEN = 'top screen'
|
||||
HELP = 'help'
|
||||
QUIT = 'quit'
|
||||
CHANGE_SEARCH = 'change search'
|
||||
@ -81,6 +82,7 @@ DEFAULT_KEYMAP = {
|
||||
ACTIVATE: 'enter',
|
||||
|
||||
PREV_SCREEN: 'esc',
|
||||
TOP_SCREEN: 'meta home',
|
||||
HELP: ['f1', '?'],
|
||||
QUIT: 'ctrl q',
|
||||
CHANGE_SEARCH: 'ctrl o',
|
||||
|
@ -21,6 +21,8 @@ GLOBAL_HELP = (
|
||||
"Display help"),
|
||||
(keymap.PREV_SCREEN,
|
||||
"Back to previous screen"),
|
||||
(keymap.TOP_SCREEN,
|
||||
"Back to project list"),
|
||||
(keymap.QUIT,
|
||||
"Quit Gertty"),
|
||||
(keymap.CHANGE_SEARCH,
|
||||
|
Loading…
x
Reference in New Issue
Block a user