summaryrefslogtreecommitdiff
path: root/src/windows.py
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-11-08 20:51:48 +0100
committermathieui <mathieui@mathieui.net>2011-11-08 20:51:48 +0100
commit95dcaa7fece3cf47c4f0640d0bdd561415cd3372 (patch)
treea1c70666a33400311b7a6aa5b13d058ee80769e6 /src/windows.py
parenta05c88ffe75e8d97e73a43ab1161b8fdd7329fca (diff)
downloadpoezio-95dcaa7fece3cf47c4f0640d0bdd561415cd3372.tar.gz
poezio-95dcaa7fece3cf47c4f0640d0bdd561415cd3372.tar.bz2
poezio-95dcaa7fece3cf47c4f0640d0bdd561415cd3372.tar.xz
poezio-95dcaa7fece3cf47c4f0640d0bdd561415cd3372.zip
Forgot those hardcoded values…
Diffstat (limited to 'src/windows.py')
-rw-r--r--src/windows.py38
1 files changed, 19 insertions, 19 deletions
diff --git a/src/windows.py b/src/windows.py
index c94de15e..2253b871 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -367,14 +367,14 @@ class ConversationInfoWin(InfoWin):
The line above the information window, displaying informations
about the user we are talking to
"""
- color_show = {'xa':get_theme().COLOR_STATUS_XA,
- 'none':get_theme().COLOR_STATUS_ONLINE,
- '':get_theme().COLOR_STATUS_ONLINE,
- 'available':get_theme().COLOR_STATUS_ONLINE,
- 'dnd':get_theme().COLOR_STATUS_DND,
- 'away':get_theme().COLOR_STATUS_AWAY,
- 'chat':get_theme().COLOR_STATUS_CHAT,
- 'unavailable':get_theme().COLOR_STATUS_UNAVAILABLE
+ color_show = {'xa': lambda: get_theme().COLOR_STATUS_XA,
+ 'none': lambda: get_theme().COLOR_STATUS_ONLINE,
+ '': lambda: get_theme().COLOR_STATUS_ONLINE,
+ 'available': lambda: get_theme().COLOR_STATUS_ONLINE,
+ 'dnd': lambda: get_theme().COLOR_STATUS_DND,
+ 'away': lambda: get_theme().COLOR_STATUS_AWAY,
+ 'chat': lambda: get_theme().COLOR_STATUS_CHAT,
+ 'unavailable': lambda: get_theme().COLOR_STATUS_UNAVAILABLE
}
def __init__(self):
@@ -416,7 +416,7 @@ class ConversationInfoWin(InfoWin):
presence = "unavailable"
else:
presence = resource.get_presence()
- color = RosterWin.color_show[presence]
+ color = RosterWin.color_show[presence]()
self.addstr('[', to_curses_attr(get_theme().COLOR_INFORMATION_BAR))
self.addstr(" ", to_curses_attr(color))
self.addstr(']', to_curses_attr(get_theme().COLOR_INFORMATION_BAR))
@@ -1328,14 +1328,14 @@ class VerticalSeparator(Win):
self.rewrite_line()
class RosterWin(Win):
- color_show = {'xa':get_theme().COLOR_STATUS_XA,
- 'none':get_theme().COLOR_STATUS_ONLINE,
- '':get_theme().COLOR_STATUS_ONLINE,
- 'available':get_theme().COLOR_STATUS_ONLINE,
- 'dnd':get_theme().COLOR_STATUS_DND,
- 'away':get_theme().COLOR_STATUS_AWAY,
- 'chat':get_theme().COLOR_STATUS_CHAT,
- 'unavailable':get_theme().COLOR_STATUS_UNAVAILABLE
+ color_show = {'xa': lambda: get_theme().COLOR_STATUS_XA,
+ 'none': lambda: get_theme().COLOR_STATUS_ONLINE,
+ '': lambda: get_theme().COLOR_STATUS_ONLINE,
+ 'available': lambda: get_theme().COLOR_STATUS_ONLINE,
+ 'dnd':lambda: get_theme().COLOR_STATUS_DND,
+ 'away': lambda: get_theme().COLOR_STATUS_AWAY,
+ 'chat': lambda: get_theme().COLOR_STATUS_CHAT,
+ 'unavailable': lambda: get_theme().COLOR_STATUS_UNAVAILABLE
}
def __init__(self):
@@ -1473,7 +1473,7 @@ class RosterWin(Win):
else:
presence = resource.get_presence()
nb = ' (%s)' % (contact.get_nb_resources(),)
- color = RosterWin.color_show[presence]
+ color = RosterWin.color_show[presence]()
if contact.get_name():
display_name = '%s (%s)%s' % (contact.get_name(),
contact.get_bare_jid(), nb,)
@@ -1496,7 +1496,7 @@ class RosterWin(Win):
"""
Draw a specific resource line
"""
- color = RosterWin.color_show[resource.get_presence()]
+ color = RosterWin.color_show[resource.get_presence()]()
self.addstr(y, 4, " ", to_curses_attr(color))
if colored:
self.addstr(y, 6, resource.get_jid().full, to_curses_attr(get_theme().COLOR_SELECTED_ROW))