summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2013-08-04 15:28:35 +0200
committermathieui <mathieui@mathieui.net>2013-08-04 15:28:35 +0200
commit416ceddbe498a70d703c46a531d89aeaecb1f5f0 (patch)
tree5f0cde22f297f4214a7998a75c67445c0504656f /src/tabs.py
parentd01f6208d67f6c88584fc1f362dae0a9f2d107d0 (diff)
downloadpoezio-416ceddbe498a70d703c46a531d89aeaecb1f5f0.tar.gz
poezio-416ceddbe498a70d703c46a531d89aeaecb1f5f0.tar.bz2
poezio-416ceddbe498a70d703c46a531d89aeaecb1f5f0.tar.xz
poezio-416ceddbe498a70d703c46a531d89aeaecb1f5f0.zip
Add the same pluggable "information element" to the PrivateTab
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/tabs.py b/src/tabs.py
index e5564aa6..bae192e6 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -1837,6 +1837,7 @@ class PrivateTab(ChatTab):
"""
message_type = 'chat'
plugin_commands = {}
+ additional_informations = {}
plugin_keys = {}
def __init__(self, name, nick):
ChatTab.__init__(self, name)
@@ -1870,6 +1871,21 @@ class PrivateTab(ChatTab):
def general_jid(self):
return self.get_name()
+ @property
+ def nick(self):
+ return self.get_nick()
+
+ @staticmethod
+ def add_information_element(plugin_name, callback):
+ """
+ Lets a plugin add its own information to the PrivateInfoWin
+ """
+ PrivateTab.additional_informations[plugin_name] = callback
+
+ @staticmethod
+ def remove_information_element(plugin_name):
+ del PrivateTab.additional_informations[plugin_name]
+
def log_message(self, txt, nickname, time=None, typ=1):
"""
Log the messages in the archives.
@@ -2019,13 +2035,13 @@ class PrivateTab(ChatTab):
self.resize()
log.debug(' TAB Refresh: %s',self.__class__.__name__)
self.text_win.refresh()
- self.info_header.refresh(self.name, self.text_win, self.chatstate)
+ self.info_header.refresh(self.name, self.text_win, self.chatstate, PrivateTab.additional_informations)
self.info_win.refresh()
self.refresh_tab_win()
self.input.refresh()
def refresh_info_header(self):
- self.info_header.refresh(self.name, self.text_win, self.chatstate)
+ self.info_header.refresh(self.name, self.text_win, self.chatstate, PrivateTab.additional_informations)
self.input.refresh()
def get_name(self):