summaryrefslogtreecommitdiff
path: root/src/tabs.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-02-14 14:54:56 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-02-14 14:54:56 +0100
commit85d645b7d27a940c262d0a1e333c61754877155e (patch)
tree3e6d25ffa0ce92f108076be05e80f791925b8533 /src/tabs.py
parent8d0ebdfc123890048f7d282077c4e3ab0b845bba (diff)
parent4b31e5acf142664c2f2ebd2e0cfa26e700d947d7 (diff)
downloadpoezio-85d645b7d27a940c262d0a1e333c61754877155e.tar.gz
poezio-85d645b7d27a940c262d0a1e333c61754877155e.tar.bz2
poezio-85d645b7d27a940c262d0a1e333c61754877155e.tar.xz
poezio-85d645b7d27a940c262d0a1e333c61754877155e.zip
Automated merge with http://hg.louiz.org/poezio
Diffstat (limited to 'src/tabs.py')
-rw-r--r--src/tabs.py27
1 files changed, 16 insertions, 11 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 3c91fc14..3b25095d 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -259,6 +259,16 @@ class ChatTab(Tab):
def command_say(self, line):
raise NotImplementedError
+class TabWithInfoWin(Tab):
+ def __init__(self):
+ self.info_win = windows.TextWin(20)
+ self.core.information_buffer.add_window(self.info_win)
+
+ def __del__(self):
+ self.core.information_buffer.del_window(self.info_win)
+ del self.info_win
+ Tab.__del__(self)
+
class InfoTab(ChatTab):
"""
The information tab, used to display global informations
@@ -267,8 +277,6 @@ class InfoTab(ChatTab):
def __init__(self, core):
Tab.__init__(self, core)
self.tab_win = windows.GlobalInfoBar()
- self.info_win = windows.TextWin()
- self.core.information_buffer.add_window(self.info_win)
self.input = windows.Input()
self.name = "Info"
self.color_state = theme.COLOR_TAB_NORMAL
@@ -338,21 +346,20 @@ class InfoTab(ChatTab):
def on_close(self):
return
-class MucTab(ChatTab):
+class MucTab(ChatTab, TabWithInfoWin):
"""
The tab containing a multi-user-chat room.
It contains an userlist, an input, a topic, an information and a chat zone
"""
def __init__(self, core, room):
ChatTab.__init__(self, core, room)
+ TabWithInfoWin.__init__(self)
self.topic_win = windows.Topic()
self.text_win = windows.TextWin()
room.add_window(self.text_win)
self.v_separator = windows.VerticalSeparator()
self.user_win = windows.UserList()
self.info_header = windows.MucInfoWin()
- self.info_win = windows.TextWin()
- self.core.information_buffer.add_window(self.info_win)
self.tab_win = windows.GlobalInfoBar()
self.input = windows.MessageInput()
self.ignores = [] # set of Users
@@ -662,17 +669,16 @@ class MucTab(ChatTab):
def on_close(self):
return
-class PrivateTab(ChatTab):
+class PrivateTab(ChatTab, TabWithInfoWin):
"""
The tab containg a private conversation (someone from a MUC)
"""
def __init__(self, core, room):
ChatTab.__init__(self, core, room)
+ TabWithInfoWin.__init__(self)
self.text_win = windows.TextWin()
room.add_window(self.text_win)
self.info_header = windows.PrivateInfoWin()
- self.info_win = windows.TextWin()
- self.core.information_buffer.add_window(self.info_win)
self.tab_win = windows.GlobalInfoBar()
self.input = windows.MessageInput()
# keys
@@ -1043,21 +1049,20 @@ class RosterInfoTab(Tab):
def on_close(self):
return
-class ConversationTab(ChatTab):
+class ConversationTab(ChatTab, TabWithInfoWin):
"""
The tab containg a normal conversation (not from a MUC)
"""
def __init__(self, core, jid):
txt_buff = text_buffer.TextBuffer()
ChatTab.__init__(self, core, txt_buff)
+ TabWithInfoWin.__init__(self)
self.color_state = theme.COLOR_TAB_NORMAL
self._name = jid # a conversation tab is linked to one specific full jid OR bare jid
self.text_win = windows.TextWin()
txt_buff.add_window(self.text_win)
self.upper_bar = windows.ConversationStatusMessageWin()
self.info_header = windows.ConversationInfoWin()
- self.info_win = windows.TextWin()
- self.core.information_buffer.add_window(self.info_win)
self.tab_win = windows.GlobalInfoBar()
self.input = windows.MessageInput()
# keys