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)
|
commands = self.config.keymap.getCommands(key)
|
||||||
if keymap.PREV_SCREEN in commands:
|
if keymap.PREV_SCREEN in commands:
|
||||||
self.backScreen()
|
self.backScreen()
|
||||||
|
elif keymap.TOP_SCREEN in commands:
|
||||||
|
self.clearHistory()
|
||||||
|
self.refresh(force=True)
|
||||||
elif keymap.HELP in commands:
|
elif keymap.HELP in commands:
|
||||||
self.help()
|
self.help()
|
||||||
elif keymap.QUIT in commands:
|
elif keymap.QUIT in commands:
|
||||||
|
@ -31,6 +31,7 @@ CURSOR_MAX_RIGHT = urwid.CURSOR_MAX_RIGHT
|
|||||||
ACTIVATE = urwid.ACTIVATE
|
ACTIVATE = urwid.ACTIVATE
|
||||||
# Global gertty commands:
|
# Global gertty commands:
|
||||||
PREV_SCREEN = 'previous screen'
|
PREV_SCREEN = 'previous screen'
|
||||||
|
TOP_SCREEN = 'top screen'
|
||||||
HELP = 'help'
|
HELP = 'help'
|
||||||
QUIT = 'quit'
|
QUIT = 'quit'
|
||||||
CHANGE_SEARCH = 'change search'
|
CHANGE_SEARCH = 'change search'
|
||||||
@ -81,6 +82,7 @@ DEFAULT_KEYMAP = {
|
|||||||
ACTIVATE: 'enter',
|
ACTIVATE: 'enter',
|
||||||
|
|
||||||
PREV_SCREEN: 'esc',
|
PREV_SCREEN: 'esc',
|
||||||
|
TOP_SCREEN: 'meta home',
|
||||||
HELP: ['f1', '?'],
|
HELP: ['f1', '?'],
|
||||||
QUIT: 'ctrl q',
|
QUIT: 'ctrl q',
|
||||||
CHANGE_SEARCH: 'ctrl o',
|
CHANGE_SEARCH: 'ctrl o',
|
||||||
|
@ -21,6 +21,8 @@ GLOBAL_HELP = (
|
|||||||
"Display help"),
|
"Display help"),
|
||||||
(keymap.PREV_SCREEN,
|
(keymap.PREV_SCREEN,
|
||||||
"Back to previous screen"),
|
"Back to previous screen"),
|
||||||
|
(keymap.TOP_SCREEN,
|
||||||
|
"Back to project list"),
|
||||||
(keymap.QUIT,
|
(keymap.QUIT,
|
||||||
"Quit Gertty"),
|
"Quit Gertty"),
|
||||||
(keymap.CHANGE_SEARCH,
|
(keymap.CHANGE_SEARCH,
|
||||||
|
Loading…
x
Reference in New Issue
Block a user