diff options
author | mathieui <mathieui@mathieui.net> | 2016-07-22 19:56:07 +0200 |
---|---|---|
committer | mathieui <mathieui@mathieui.net> | 2016-07-22 19:56:07 +0200 |
commit | 8634b5ea66cd8fb305d41a2680c66a7d4fcde73c (patch) | |
tree | b8b70bddee730c87e43c31cd826fa2bd1d2d0db3 /poezio/tabs | |
parent | 89194356ee3b61c6c630d15b8aeb94c91cbacba4 (diff) | |
download | poezio-8634b5ea66cd8fb305d41a2680c66a7d4fcde73c.tar.gz poezio-8634b5ea66cd8fb305d41a2680c66a7d4fcde73c.tar.bz2 poezio-8634b5ea66cd8fb305d41a2680c66a7d4fcde73c.tar.xz poezio-8634b5ea66cd8fb305d41a2680c66a7d4fcde73c.zip |
Fix a bug with the _close_tab shortcut
on_close wasn’t used correctly everywhere.
Also make the "close" commands for each tab specific to themselves,
rather than taking the current tab for closure.
Diffstat (limited to 'poezio/tabs')
-rw-r--r-- | poezio/tabs/bookmarkstab.py | 4 | ||||
-rw-r--r-- | poezio/tabs/conversationtab.py | 2 | ||||
-rw-r--r-- | poezio/tabs/listtab.py | 1 | ||||
-rw-r--r-- | poezio/tabs/muctab.py | 6 | ||||
-rw-r--r-- | poezio/tabs/privatetab.py | 3 | ||||
-rw-r--r-- | poezio/tabs/xmltab.py | 3 |
6 files changed, 12 insertions, 7 deletions
diff --git a/poezio/tabs/bookmarkstab.py b/poezio/tabs/bookmarkstab.py index 053e45dd..5416712b 100644 --- a/poezio/tabs/bookmarkstab.py +++ b/poezio/tabs/bookmarkstab.py @@ -58,7 +58,7 @@ class BookmarksTab(Tab): self.removed_bookmarks.append(current) def on_cancel(self): - self.core.close_tab() + self.core.close_tab(self) return True def on_save(self): @@ -85,7 +85,7 @@ class BookmarksTab(Tab): self.core.information('Remote bookmarks not saved.', 'Error') log.debug('alerte %s', str(stanza_storage(self.bookmarks.bookmarks))) self.bookmarks.save(self.core.xmpp, callback=send_cb) - self.core.close_tab() + self.core.close_tab(self) return True def on_input(self, key, raw=False): diff --git a/poezio/tabs/conversationtab.py b/poezio/tabs/conversationtab.py index 99c4b122..469ef28a 100644 --- a/poezio/tabs/conversationtab.py +++ b/poezio/tabs/conversationtab.py @@ -207,7 +207,7 @@ class ConversationTab(OneToOneTab): @command_args_parser.ignored def command_unquery(self): - self.core.close_tab() + self.core.close_tab(self) @command_args_parser.quoted(0, 1) def command_version(self, args): diff --git a/poezio/tabs/listtab.py b/poezio/tabs/listtab.py index c99bd3bd..18ee1da4 100644 --- a/poezio/tabs/listtab.py +++ b/poezio/tabs/listtab.py @@ -111,7 +111,6 @@ class ListTab(Tab): self.input.do_command("/") # we add the slash def close(self, arg=None): - self.input.on_delete() self.core.close_tab(self) def set_error(self, msg, code, body): diff --git a/poezio/tabs/muctab.py b/poezio/tabs/muctab.py index e0f3b6e2..281237ad 100644 --- a/poezio/tabs/muctab.py +++ b/poezio/tabs/muctab.py @@ -624,7 +624,11 @@ class MucTab(ChatTab): /close [msg] """ self.command_part(msg) - self.core.close_tab() + self.core.close_tab(self) + + def on_close(self): + super().on_close() + self.command_part('') @command_args_parser.quoted(1, 1) def command_query(self, args): diff --git a/poezio/tabs/privatetab.py b/poezio/tabs/privatetab.py index c8c80f19..7a132167 100644 --- a/poezio/tabs/privatetab.py +++ b/poezio/tabs/privatetab.py @@ -96,6 +96,7 @@ class PrivateTab(OneToOneTab): self.core.information('Unable to write in the log file', 'Error') def on_close(self): + super().on_close() self.parent_muc.privates.remove(self) def completion(self): @@ -188,7 +189,7 @@ class PrivateTab(OneToOneTab): """ /unquery """ - self.core.close_tab() + self.core.close_tab(self) @command_args_parser.quoted(0, 1) def command_version(self, args): diff --git a/poezio/tabs/xmltab.py b/poezio/tabs/xmltab.py index 937ab0f9..3fdaffc7 100644 --- a/poezio/tabs/xmltab.py +++ b/poezio/tabs/xmltab.py @@ -303,7 +303,7 @@ class XMLTab(Tab): return self.key_func[key]() def close(self, arg=None): - self.core.close_tab() + self.core.close_tab(self) def resize(self): self.need_resize = False @@ -348,6 +348,7 @@ class XMLTab(Tab): curses.curs_set(0) def on_close(self): + super().on_close() self.command_clear('') self.core.xml_tab = False |