From 38f0cd1c32a24a2d680e60608563f52e6a24dbd3 Mon Sep 17 00:00:00 2001 From: mathieui Date: Mon, 23 Jul 2018 20:40:43 +0200 Subject: Fix "go_to_previous_tab" and remove the usage of Command.win to move internally --- poezio/core/core.py | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'poezio/core/core.py') diff --git a/poezio/core/core.py b/poezio/core/core.py index eee580d5..815473ae 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -1020,7 +1020,7 @@ class Core: """ self.tabs.append(new_tab) if focus: - self.command.win("%s" % new_tab.nb) + self.tabs.set_current_tab(new_tab) def insert_tab(self, old_pos, new_pos=99999): """ @@ -1072,11 +1072,11 @@ class Core: def go_to_roster(self): "Select the roster as the current tab" - self.command.win('0') + self.tabs.set_current_tab(self.tabs.first()) def go_to_previous_tab(self): "Go to the previous tab" - self.command.win(str(self.previous_tab_nb)) + self.tabs.restore_previous_tab() def go_to_important_room(self): """ @@ -1104,7 +1104,7 @@ class Core: if (tab.nb < self.tabs.current_index and tab_refs[state][-1].nb > self.tabs.current_index): continue - self.command.win(str(tab.nb)) + self.tabs.set_current_tab(tab) return return @@ -1115,7 +1115,7 @@ class Core: else: tab = self.tabs.by_name_and_class(tab_name, type_) if tab: - self.command.win(str(tab.nb)) + self.tabs.set_current_tab(tab) return True return False @@ -1145,7 +1145,7 @@ class Core: # if the room exists, focus it and return for tab in self.get_tabs(tabs.PrivateTab): if tab.name == complete_jid: - self.command.win(str(tab.nb)) + self.tabs.set_current_tab(tab) return tab # create the new tab tab = self.tabs.by_name_and_class(room_name, tabs.MucTab) -- cgit v1.2.3