summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-12 05:48:29 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-12 05:48:29 +0100
commit9e8706a2e8bfb5dc1242ca42f87a6e3df90d9138 (patch)
tree923660b9ece82fbe88bf65f30d54a843dfd1357f /src/tabs.py
parenta97e6b548b32836e97e88e83fdb1d0073b15c8c1 (diff)
downloadpoezio-9e8706a2e8bfb5dc1242ca42f87a6e3df90d9138.tar.gz
poezio-9e8706a2e8bfb5dc1242ca42f87a6e3df90d9138.tar.bz2
poezio-9e8706a2e8bfb5dc1242ca42f87a6e3df90d9138.tar.xz
poezio-9e8706a2e8bfb5dc1242ca42f87a6e3df90d9138.zip
a plugin can now add informations in ConversationTab’s InfoWin. And the GPG plugin does that.
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/src/tabs.py b/src/tabs.py
index d7f1323b..472a15fa 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1921,6 +1921,7 @@ class ConversationTab(ChatTab):
The tab containg a normal conversation (not from a MUC)
"""
plugin_commands = {}
+ additional_informations = {}
message_type = 'chat'
def __init__(self, jid):
ChatTab.__init__(self)
@@ -1941,6 +1942,17 @@ class ConversationTab(ChatTab):
self.resize()
self.update_commands()
+ @staticmethod
+ def add_information_element(plugin_name, callback):
+ """
+ Lets a plugin add its own information to the ConversationInfoWin
+ """
+ ConversationTab.additional_informations[plugin_name] = callback
+
+ @staticmethod
+ def remove_information_element(plugin_name):
+ del ConversationTab.additional_informations[plugin_name]
+
def completion(self):
self.complete_commands(self.input)
@@ -2013,13 +2025,13 @@ class ConversationTab(ChatTab):
log.debug(' TAB Refresh: %s'%self.__class__.__name__)
self.text_win.refresh()
self.upper_bar.refresh(self.get_name(), roster.get_contact_by_jid(self.get_name()))
- self.info_header.refresh(self.get_name(), roster.get_contact_by_jid(self.get_name()), self.text_win, self.chatstate)
+ self.info_header.refresh(self.get_name(), roster.get_contact_by_jid(self.get_name()), self.text_win, self.chatstate, ConversationTab.additional_informations)
self.info_win.refresh()
self.tab_win.refresh()
self.input.refresh()
def refresh_info_header(self):
- self.info_header.refresh(self.get_name(), roster.get_contact_by_jid(self.get_name()), self.text_win, self.chatstate)
+ self.info_header.refresh(self.get_name(), roster.get_contact_by_jid(self.get_name()), self.text_win, self.chatstate, ConversationTab.additional_informations)
self.input.refresh()
def get_name(self):