summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-07-18 22:30:08 +0200
committerFlorent Le Coz <louiz@louiz.org>2012-07-18 22:30:08 +0200
commit082067afe991e59afe4a90c57abc048bc6ea2ca9 (patch)
tree907f3d1d12473166112c018c00d02df88a31cb88
parent8317b845d810353daab07a467199f411c3fceaa4 (diff)
downloadpoezio-082067afe991e59afe4a90c57abc048bc6ea2ca9.tar.gz
poezio-082067afe991e59afe4a90c57abc048bc6ea2ca9.tar.bz2
poezio-082067afe991e59afe4a90c57abc048bc6ea2ca9.tar.xz
poezio-082067afe991e59afe4a90c57abc048bc6ea2ca9.zip
[labedz] Add keys to jump to the next and previous contact in the roster.
-rw-r--r--src/tabs.py29
1 files changed, 27 insertions, 2 deletions
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):