From 082067afe991e59afe4a90c57abc048bc6ea2ca9 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 18 Jul 2012 22:30:08 +0200 Subject: [labedz] Add keys to jump to the next and previous contact in the roster. --- src/tabs.py | 29 +++++++++++++++++++++++++++-- 1 file changed, 27 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/tabs.py b/src/tabs.py index 33a7126b..4d1d9072 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1821,8 +1821,10 @@ class RosterInfoTab(Tab): self.key_func["/"] = self.on_slash self.key_func["KEY_UP"] = self.move_cursor_up self.key_func["KEY_DOWN"] = self.move_cursor_down - self.key_func["M-u"] = self.move_cursor_to_next_group - self.key_func["M-y"] = self.move_cursor_to_prev_group + self.key_func["M-u"] = self.move_cursor_to_next_contact + self.key_func["M-y"] = self.move_cursor_to_prev_contact + self.key_func["M-U"] = self.move_cursor_to_next_group + self.key_func["M-Y"] = self.move_cursor_to_prev_group self.key_func["M-[1;5B"] = self.move_cursor_to_next_group self.key_func["M-[1;5A"] = self.move_cursor_to_prev_group self.key_func["o"] = self.toggle_offline_show @@ -2321,6 +2323,29 @@ class RosterInfoTab(Tab): self.input.refresh() self.core.doupdate() + def move_cursor_to_prev_contact(self): + self.roster_win.move_cursor_up() + self.roster_win.refresh(roster) + while not isinstance(self.roster_win.get_selected_row(), Contact): + if not self.roster_win.move_cursor_up(): + break + self.roster_win.refresh(roster) + self.contact_info_win.refresh(self.roster_win.get_selected_row()) + self.input.refresh() + self.core.doupdate() + + def move_cursor_to_next_contact(self): + self.roster_win.move_cursor_down() + self.roster_win.refresh(roster) + while not isinstance(self.roster_win.get_selected_row(), Contact): + if not self.roster_win.move_cursor_down(): + break + self.roster_win.refresh(roster) + self.contact_info_win.refresh(self.roster_win.get_selected_row()) + self.input.refresh() + self.core.doupdate() + + def move_cursor_to_prev_group(self): self.roster_win.move_cursor_up() while not isinstance(self.roster_win.get_selected_row(), RosterGroup): -- cgit v1.2.3