summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-02-12 22:32:58 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-02-12 22:32:58 +0000
commitfff3d805a105722b85281654a2dfdf902c9c5cac (patch)
tree2600dc9b4af28f20807a912ace68ce84b1abf748 /src
parent17038f82049f2ab9ee6c7e0f5e34304856f45269 (diff)
downloadpoezio-fff3d805a105722b85281654a2dfdf902c9c5cac.tar.gz
poezio-fff3d805a105722b85281654a2dfdf902c9c5cac.tar.bz2
poezio-fff3d805a105722b85281654a2dfdf902c9c5cac.tar.xz
poezio-fff3d805a105722b85281654a2dfdf902c9c5cac.zip
show a color space to to show the show (aha.) of the users
Diffstat (limited to 'src')
-rw-r--r--src/gui.py2
-rw-r--r--src/window.py28
2 files changed, 23 insertions, 7 deletions
diff --git a/src/gui.py b/src/gui.py
index 38a98d38..fd3f7fe8 100644
--- a/src/gui.py
+++ b/src/gui.py
@@ -292,6 +292,8 @@ class Gui(object):
curses.init_pair(11, curses.COLOR_WHITE, curses.COLOR_BLUE) # normal room
curses.init_pair(12, curses.COLOR_WHITE, curses.COLOR_MAGENTA) # new message room
curses.init_pair(13, curses.COLOR_WHITE, curses.COLOR_RED) # highlight room
+ curses.init_pair(14, curses.COLOR_WHITE, curses.COLOR_YELLOW)
+ curses.init_pair(15, curses.COLOR_WHITE, curses.COLOR_GREEN)
def reset_curses(self):
curses.echo()
diff --git a/src/window.py b/src/window.py
index aa8cf5da..8ad1fc78 100644
--- a/src/window.py
+++ b/src/window.py
@@ -38,9 +38,16 @@ class UserList(Win):
self.win.attron(curses.color_pair(2))
self.win.vline(0, 0, curses.ACS_VLINE, self.height)
self.win.attroff(curses.color_pair(2))
- self.color_dict = {'moderator': 3,
+ self.color_role = {'moderator': 3,
'participant':2,
- 'visitor':4}
+ 'visitor':4
+ }
+ self.color_show = {'xa':12,
+ 'None':8,
+ 'dnd':13,
+ 'away':14,
+ 'chat':15
+ }
def refresh(self, users):
if not self.visible:
@@ -49,12 +56,19 @@ class UserList(Win):
y = 0
for user in users:
try:
- color = self.color_dict[user.role]
+ role_col = self.color_role[user.role]
except:
- color = 1
- self.win.attron(curses.color_pair(color))
- self.win.addnstr(y, 1, user.nick, self.width-1)
- self.win.attroff(curses.color_pair(color))
+ role_col = 1
+ try:
+ show_col = self.color_show[user.show]
+ except:
+ show_col = 8
+ self.win.attron(curses.color_pair(show_col))
+ self.win.addnstr(y, 0, " ", 1)
+ self.win.attroff(curses.color_pair(show_col))
+ self.win.attron(curses.color_pair(role_col))
+ self.win.addnstr(y, 1, user.nick, self.width-2)
+ self.win.attroff(curses.color_pair(role_col))
y += 1
if y == self.height:
break