diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-01 09:25:50 +1300 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-01 09:25:50 +1300 |
commit | 32ba6021b3c07efaa45a9223479151cd7e74ccbd (patch) | |
tree | 0ad364d4edcbed27c12535a8d142b690a34596c0 /libmproxy/console/window.py | |
parent | 44fb42185f0e177b775c5e4f11249a55390048f6 (diff) | |
download | mitmproxy-32ba6021b3c07efaa45a9223479151cd7e74ccbd.tar.gz mitmproxy-32ba6021b3c07efaa45a9223479151cd7e74ccbd.tar.bz2 mitmproxy-32ba6021b3c07efaa45a9223479151cd7e74ccbd.zip |
console: improve handling of help contexts, fix key bindings in flow views
Diffstat (limited to 'libmproxy/console/window.py')
-rw-r--r-- | libmproxy/console/window.py | 20 |
1 files changed, 7 insertions, 13 deletions
diff --git a/libmproxy/console/window.py b/libmproxy/console/window.py index d686f61d..14a3acd2 100644 --- a/libmproxy/console/window.py +++ b/libmproxy/console/window.py @@ -1,19 +1,21 @@ import urwid -from . import common, grideditor, signals, contentview +from . import grideditor, signals, contentview + class Window(urwid.Frame): - def __init__(self, master, body, header, footer): + def __init__(self, master, body, header, footer, helpctx): urwid.Frame.__init__(self, body, header=header, footer=footer) self.master = master + self.helpctx = helpctx signals.focus.connect(self.sig_focus) def sig_focus(self, sender, section): self.focus_position = section def keypress(self, size, k): - k = urwid.Frame.keypress(self, self.master.loop.screen_size, k) + k = super(self.__class__, self).keypress(size, k) if k == "?": - self.master.view_help() + self.master.view_help(self.helpctx) elif k == "c": if not self.master.client_playback: signals.status_prompt_path.send( @@ -65,15 +67,7 @@ class Window(urwid.Frame): elif k == "Q": raise urwid.ExitMainLoop elif k == "q": - signals.status_prompt_onekey.send( - self, - prompt = "Quit", - keys = ( - ("yes", "y"), - ("no", "n"), - ), - callback = self.master.quit, - ) + signals.pop_view_state.send(self) elif k == "M": signals.status_prompt_onekey.send( prompt = "Global default display mode", |