From 7ba606136293aa9b08cb1185e046cfdff7bf1589 Mon Sep 17 00:00:00 2001 From: mathieui Date: Wed, 25 Jan 2012 17:51:11 +0100 Subject: [PATCH] Add affiliation chars in the theme --- src/theming.py | 11 +++++++++-- src/windows.py | 10 +++++----- 2 files changed, 14 insertions(+), 7 deletions(-) diff --git a/src/theming.py b/src/theming.py index ff2ff74e..815b059f 100644 --- a/src/theming.py +++ b/src/theming.py @@ -101,6 +101,13 @@ class Theme(object): CHAR_CHATSTATE_COMPOSING = 'X' CHAR_CHATSTATE_PAUSED = 'p' + # These characters are used for the affiliation in the user list + # in a MUC + CHAR_AFFILIATION_OWNER = '~' + CHAR_AFFILIATION_ADMIN = '&' + CHAR_AFFILIATION_MEMBER = '+' + CHAR_AFFILIATION_NONE = '-' + # Separators COLOR_VERTICAL_SEPARATOR = (4, -1) COLOR_NEW_TEXT_SEPARATOR = (2, -1) @@ -162,8 +169,8 @@ class Theme(object): CHAR_JOIN = '--->' CHAR_QUIT = '<---' CHAR_KICK = '-!-' - CHAR_COLUMN_ASC = ' ▲' - CHAR_COLUMN_DESC =' ▼' + CHAR_COLUMN_ASC = ' ▲' + CHAR_COLUMN_DESC =' ▼' COLOR_JOIN_CHAR = (4, -1) COLOR_QUIT_CHAR = (1, -1) diff --git a/src/windows.py b/src/windows.py index 7d9194b2..89630a12 100644 --- a/src/windows.py +++ b/src/windows.py @@ -196,10 +196,10 @@ class UserList(Win): 'none': lambda: get_theme().COLOR_USER_NONE, '': lambda: get_theme().COLOR_USER_NONE } - self.symbol_affiliation = {'owner': '~', - 'admin': '&', - 'member': '+', - 'none': '-'} + self.symbol_affiliation = {'owner': lambda: get_theme().CHAR_AFFILIATION_OWNER, + 'admin': lambda: get_theme().CHAR_AFFILIATION_ADMIN, + 'member': lambda: get_theme().CHAR_AFFILIATION_MEMBER, + 'none': lambda: get_theme().CHAR_AFFILIATION_NONE, } self.color_show = {'xa': lambda: get_theme().COLOR_STATUS_XA, 'none': lambda: get_theme().COLOR_STATUS_NONE, '': lambda: get_theme().COLOR_STATUS_NONE, @@ -245,7 +245,7 @@ class UserList(Win): color = get_theme().COLOR_USER_NONE else: color = self.color_role[user.role]() - symbol = self.symbol_affiliation.get(user.affiliation) or '-' + symbol = self.symbol_affiliation.get(user.affiliation, lambda: '-')() self.addstr(y, 1, symbol, to_curses_attr(color)) def draw_status_chatstate(self, y, user):