From e835bd2d20bf9fd678e974c1aec9b3cbe6b9ea08 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 10 Mar 2011 05:11:12 +0100 Subject: [PATCH] Fix the search (the enter key opens the conversation BEFORE restoring the roster list) --- src/tabs.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/tabs.py b/src/tabs.py index cafeabc4..ffafc322 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1042,7 +1042,6 @@ class RosterInfoTab(Tab): self.set_color_state(theme.COLOR_TAB_NORMAL) self.key_func['^I'] = self.completion self.key_func['M-i'] = self.completion - self.key_func["^M"] = self.on_enter self.key_func[' '] = self.on_space self.key_func["/"] = self.on_slash self.key_func["KEY_UP"] = self.move_cursor_up @@ -1179,10 +1178,15 @@ class RosterInfoTab(Tab): self._color_state = color def on_input(self, key): + if key == '^M': + selected_row = self.roster_win.get_selected_row() res = self.input.do_command(key) if res: return True - if key in self.key_func: + if key == '^M': + self.core.on_roster_enter_key(selected_row) + return selected_row + elif key in self.key_func: return self.key_func[key]() def toggle_offline_show(self): @@ -1268,11 +1272,6 @@ class RosterInfoTab(Tab): selected_row.toggle_folded() return True - def on_enter(self): - selected_row = self.roster_win.get_selected_row() - self.core.on_roster_enter_key(selected_row) - return selected_row - def start_search(self): """ Start the search. The input should appear with a short instruction