diff options
author | Aldo Cortesi <aldo@nullcube.com> | 2015-04-17 13:30:49 +1200 |
---|---|---|
committer | Aldo Cortesi <aldo@nullcube.com> | 2015-04-17 13:30:49 +1200 |
commit | ff654730e8dc0e68998487a8dcaf3db00a42c371 (patch) | |
tree | 4ef27e1c4f7d3c5b8e40b16610b2c00f5e772a89 /libmproxy | |
parent | d20069fcd201cec534fbdc348cec5d63fa087c23 (diff) | |
download | mitmproxy-ff654730e8dc0e68998487a8dcaf3db00a42c371.tar.gz mitmproxy-ff654730e8dc0e68998487a8dcaf3db00a42c371.tar.bz2 mitmproxy-ff654730e8dc0e68998487a8dcaf3db00a42c371.zip |
console: make g/G shortcuts work in more contexts
Diffstat (limited to 'libmproxy')
-rw-r--r-- | libmproxy/console/flowlist.py | 4 | ||||
-rw-r--r-- | libmproxy/console/grideditor.py | 9 | ||||
-rw-r--r-- | libmproxy/console/help.py | 4 |
3 files changed, 15 insertions, 2 deletions
diff --git a/libmproxy/console/flowlist.py b/libmproxy/console/flowlist.py index aa3fd718..c7a0d1b7 100644 --- a/libmproxy/console/flowlist.py +++ b/libmproxy/console/flowlist.py @@ -47,6 +47,10 @@ class EventListBox(urwid.ListBox): if key == "C": self.master.clear_events() key = None + elif key == "G": + self.set_focus(0) + elif key == "g": + self.set_focus(len(self.master.eventlist)-1) return urwid.ListBox.keypress(self, size, key) diff --git a/libmproxy/console/grideditor.py b/libmproxy/console/grideditor.py index e5e64403..5a2da59f 100644 --- a/libmproxy/console/grideditor.py +++ b/libmproxy/console/grideditor.py @@ -294,6 +294,7 @@ class GridWalker(urwid.ListWalker): def set_focus(self, focus): self.stop_edit() self.focus = focus + self._modified() def get_next(self, pos): if pos+1 >= len(self.lst): @@ -414,6 +415,10 @@ class GridEditor(urwid.WidgetWrap): res.append(i[0]) self.callback(self.data_out(res), *self.cb_args, **self.cb_kwargs) signals.pop_view_state.send(self) + elif key == "G": + self.walker.set_focus(0) + elif key == "g": + self.walker.set_focus(len(self.walker.lst)-1) elif key in ["h", "left"]: self.walker.left() elif key in ["l", "right"]: @@ -459,10 +464,10 @@ class GridEditor(urwid.WidgetWrap): ("a", "add row after cursor"), ("d", "delete row"), ("e", "spawn external editor on current field"), - ("q", "return to flow view"), + ("q", "save changes and exit editor"), ("r", "read value from file"), ("R", "read unescaped value from file"), - ("esc", "return to flow view/exit field edit mode"), + ("esc", "save changes and exit editor"), ("tab", "next field"), ("enter", "edit field"), ] diff --git a/libmproxy/console/help.py b/libmproxy/console/help.py index 6d36ee71..cbd5bef8 100644 --- a/libmproxy/console/help.py +++ b/libmproxy/console/help.py @@ -103,4 +103,8 @@ class HelpView(urwid.ListBox): return None elif key == "?": key = None + elif key == "G": + self.set_focus(0) + elif key == "g": + self.set_focus(len(self.body.contents)) return urwid.ListBox.keypress(self, size, key) |