From bd6c0499fb121306c7e3095ce38ddc3f5718d808 Mon Sep 17 00:00:00 2001 From: Aldo Cortesi Date: Wed, 26 Jan 2011 22:17:42 +1300 Subject: Fix UI sync bugs introduced by flow serialization. --- libmproxy/console.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'libmproxy/console.py') diff --git a/libmproxy/console.py b/libmproxy/console.py index ec17b2e9..a986cc1c 100644 --- a/libmproxy/console.py +++ b/libmproxy/console.py @@ -109,6 +109,8 @@ class ConnectionItem(WWrap): class ConnectionListView(urwid.ListWalker): def __init__(self, master, state): self.master, self.state = master, state + if self.state.flow_list: + self.set_focus(0) def get_focus(self): f, i = self.state.get_focus() @@ -572,6 +574,7 @@ class ConsoleMaster(controller.Master): ('key', "q"), ":back ", ] def __init__(self, server, options): + self.conn_list_view = None self.set_palette() controller.Master.__init__(self, server) self.state = ConsoleState() @@ -689,8 +692,9 @@ class ConsoleMaster(controller.Master): self.statusbar.message(str(v)) return self.state.load_flows(data, ConsoleFlow) - self.conn_list_view.set_focus(0) - self.sync_list_view() + if self.conn_list_view: + self.conn_list_view.set_focus(0) + self.sync_list_view() def helptext(self): text = [] -- cgit v1.2.3