diff options
author | mathieui <mathieui@mathieui.net> | 2018-08-01 19:39:48 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2018-08-01 19:39:48 +0200 |
commit | 19c9d167055e1e32d5835d66cda826650cdc47b1 (patch) | |
tree | 33faed42fd5542b297b256b439ac89b2d5946751 | |
parent | 4d41bada1601c32baa3fb948ab962c5269dcc886 (diff) | |
download | poezio-19c9d167055e1e32d5835d66cda826650cdc47b1.tar.gz poezio-19c9d167055e1e32d5835d66cda826650cdc47b1.tar.bz2 poezio-19c9d167055e1e32d5835d66cda826650cdc47b1.tar.xz poezio-19c9d167055e1e32d5835d66cda826650cdc47b1.zip |
Fix some leftover issues with tab handling
-rw-r--r-- | poezio/core/core.py | 5 | ||||
-rw-r--r-- | poezio/core/handlers.py | 6 |
2 files changed, 8 insertions, 3 deletions
diff --git a/poezio/core/core.py b/poezio/core/core.py index ee1025e8..3dd7dfe2 100644 --- a/poezio/core/core.py +++ b/poezio/core/core.py @@ -1055,6 +1055,11 @@ class Core: return True return False + def focus_tab(self, tab: tabs.Tab) -> bool: + """Focus a tab""" + return self.tabs.set_current_tab(tab) + + ### Opening actions ### def open_conversation_window(self, jid: JID, diff --git a/poezio/core/handlers.py b/poezio/core/handlers.py index fcc0a07e..36bc6821 100644 --- a/poezio/core/handlers.py +++ b/poezio/core/handlers.py @@ -950,7 +950,7 @@ class HandlerCore: '%s wants to subscribe to your presence, use ' '/accept <jid> or /deny <jid> in the roster ' 'tab to accept or reject the query.' % jid, 'Roster') - self.core.get_tab_by_number(0).state = 'highlight' + self.core.tabs.first().state = 'highlight' roster.modified() if isinstance(self.core.tabs.current_tab, tabs.RosterInfoTab): self.core.refresh_window() @@ -979,7 +979,7 @@ class HandlerCore: roster.modified() self.core.information( '%s does not want to receive your status anymore.' % jid, 'Roster') - self.core.get_tab_by_number(0).state = 'highlight' + self.core.tabs.first().state = 'highlight' if isinstance(self.core.tabs.current_tab, tabs.RosterInfoTab): self.core.refresh_window() @@ -998,7 +998,7 @@ class HandlerCore: self.core.information( '%s does not want you to receive his/her/its status anymore.' % jid, 'Roster') - self.core.get_tab_by_number(0).state = 'highlight' + self.core.tabs.first().state = 'highlight' if isinstance(self.core.tabs.current_tab, tabs.RosterInfoTab): self.core.refresh_window() |