summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-12-15 17:05:52 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-12-15 17:05:52 +0000
commit883c0ec812c7479aacc9cab01915861dde4485c1 (patch)
tree794797dbbac3489497b9790a3b2627fb9ef6459e
parentff24960b6aac02e85189ac8c6ee6b042f6c84258 (diff)
downloadpoezio-883c0ec812c7479aacc9cab01915861dde4485c1.tar.gz
poezio-883c0ec812c7479aacc9cab01915861dde4485c1.tar.bz2
poezio-883c0ec812c7479aacc9cab01915861dde4485c1.tar.xz
poezio-883c0ec812c7479aacc9cab01915861dde4485c1.zip
fix the /recolor command
-rw-r--r--src/core.py9
-rw-r--r--src/tabs.py16
2 files changed, 20 insertions, 5 deletions
diff --git a/src/core.py b/src/core.py
index 3fcfabfb..199bf237 100644
--- a/src/core.py
+++ b/src/core.py
@@ -1213,12 +1213,11 @@ class Core(object):
Move the new-messages separator at the bottom on the current
text.
"""
- try:
- room = self.current_tab().get_room()
- except:
+ window = self.current_tab().get_text_window()
+ if not window:
return
- room.remove_line_separator()
- room.add_line_separator()
+ window.remove_line_separator()
+ window.add_line_separator()
self.refresh_window()
def information(self, msg, typ=''):
diff --git a/src/tabs.py b/src/tabs.py
index 5f851cc6..bb9db89e 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -124,6 +124,12 @@ class Tab(object):
"""
raise NotImplementedError
+ def get_text_window(self):
+ """
+ Returns the principal TextWin window, if there's one
+ """
+ return None
+
def on_input(self, key):
pass
@@ -348,6 +354,7 @@ class MucTab(ChatTab):
for user in sorted(users, key=compare_users, reverse=True):
user.color = theme.LIST_COLOR_NICKNAMES[i % nb_color]
i+= 1
+ self.text_win.rebuild_everything(self.get_room())
self.core.refresh_window()
def command_nick(self, arg):
@@ -540,6 +547,9 @@ class MucTab(ChatTab):
def get_name(self):
return self._room.name
+ def get_text_window(self):
+ return self.text_win
+
def get_room(self):
return self._room
@@ -664,6 +674,9 @@ class PrivateTab(ChatTab):
def get_room(self):
return self._room
+ def get_text_window(self):
+ return self.text_win
+
def just_before_refresh(self):
return
@@ -939,6 +952,9 @@ class ConversationTab(ChatTab):
def get_room(self):
return self._room
+ def get_text_window(self):
+ return self.text_win
+
def just_before_refresh(self):
return