summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2018-07-22 16:17:06 +0200
committermathieui <mathieui@mathieui.net>2018-07-22 16:17:06 +0200
commitc6cf2d08b7295a477d89d01535463d18103f6311 (patch)
tree9ec9f61ab5d4b6fe45d10d0752dab90df935e76f /plugins
parente2414121af16474744d012cdb8466de6ae3136e4 (diff)
downloadpoezio-c6cf2d08b7295a477d89d01535463d18103f6311.tar.gz
poezio-c6cf2d08b7295a477d89d01535463d18103f6311.tar.bz2
poezio-c6cf2d08b7295a477d89d01535463d18103f6311.tar.xz
poezio-c6cf2d08b7295a477d89d01535463d18103f6311.zip
Fix close_all and change_title plugins
Diffstat (limited to 'plugins')
-rw-r--r--plugins/change_title.py6
-rw-r--r--plugins/close_all.py7
2 files changed, 5 insertions, 8 deletions
diff --git a/plugins/change_title.py b/plugins/change_title.py
index 92fcb5c3..e5ed96a8 100644
--- a/plugins/change_title.py
+++ b/plugins/change_title.py
@@ -8,7 +8,7 @@ import sys
class Plugin(BasePlugin):
def init(self):
- self.on_tab_change(0, self.core.current_tab_nb)
+ self.on_tab_change(None, new_tab=self.core.tabs.current_tab)
self.api.add_event_handler('tab_change', self.on_tab_change)
def cleanup(self):
@@ -16,8 +16,6 @@ class Plugin(BasePlugin):
sys.stdout.write("\x1b]0;poezio\x07")
sys.stdout.flush()
- def on_tab_change(self, old, new):
- new_tab = self.core.get_tab_by_number(new)
+ def on_tab_change(self, old_tab, new_tab):
sys.stdout.write("\x1b]0;{}\x07".format(new_tab.name))
sys.stdout.flush()
-
diff --git a/plugins/close_all.py b/plugins/close_all.py
index 93bcdcfc..faf1d0ea 100644
--- a/plugins/close_all.py
+++ b/plugins/close_all.py
@@ -26,19 +26,18 @@ class Plugin(BasePlugin):
"""
/closeall
"""
- current = self.core.current_tab()
+ current = self.api.current_tab()
if not isinstance(current, (tabs.RosterInfoTab, tabs.MucTab)):
self.core.go_to_roster()
- current = self.core.current_tab()
+ current = self.api.current_tab()
def filter_func(x):
return not isinstance(x, (tabs.RosterInfoTab, tabs.MucTab))
- matching_tabs = list(filter(filter_func, self.core.tabs))
+ matching_tabs = list(filter(filter_func, self.core.tabs.get_tabs()))
length = len(matching_tabs)
for tab in matching_tabs:
self.core.close_tab(tab)
- self.core.current_tab_nb = current.nb
self.api.information('%s tabs closed.' % length, 'Info')
self.core.refresh_window()