summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2012-01-26 10:08:43 +0100
committerFlorent Le Coz <louiz@louiz.org>2012-01-26 10:08:43 +0100
commit7433510470beaa8f009a14d57952133e7dff82b0 (patch)
tree7062b30aa6ed68074c08b21e1550dd35409147a3
parenta3344b11b2ea7ac17097b8db4b703bb9f6c02912 (diff)
parent17fdd5d60618ebc1e84a966b89e57c43fc6dd53a (diff)
downloadpoezio-7433510470beaa8f009a14d57952133e7dff82b0.tar.gz
poezio-7433510470beaa8f009a14d57952133e7dff82b0.tar.bz2
poezio-7433510470beaa8f009a14d57952133e7dff82b0.tar.xz
poezio-7433510470beaa8f009a14d57952133e7dff82b0.zip
Merge branch 'master' of https://git.louiz.org/poezio
Conflicts: src/theming.py src/windows.py
-rw-r--r--src/tabs.py18
-rw-r--r--src/theming.py11
-rw-r--r--src/windows.py12
3 files changed, 31 insertions, 10 deletions
diff --git a/src/tabs.py b/src/tabs.py
index 019fae30..7df200b0 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -2371,7 +2371,23 @@ class MucListTab(Tab):
'name': item[2] or '' ,'users': ''} for item in iq['disco_items'].get_items()]
self.listview.add_lines(items)
self.upper_message.set_message('Chatroom list on server %s' % self.name)
- self.upper_message.refresh()
+ if self.core.current_tab() is self:
+ self.listview.refresh()
+ self.upper_message.refresh()
+ else:
+ self.state = 'highlight'
+ self.refresh_tab_win()
+ curses.doupdate()
+
+ def sort_by(self):
+ if self.list_header.get_order():
+ self.listview.sort_by_column(col_name=self.list_header.get_sel_column(),asc=False)
+ self.list_header.set_order(False)
+ self.list_header.refresh()
+ else:
+ self.listview.sort_by_column(col_name=self.list_header.get_sel_column(),asc=True)
+ self.list_header.set_order(True)
+ self.list_header.refresh()
curses.doupdate()
def sort_by(self):
diff --git a/src/theming.py b/src/theming.py
index 96c47337..25188f81 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..3a852ebc 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):
@@ -1667,8 +1667,6 @@ class ListWin(Win):
if not lines:
return
self.lines += lines
- self.refresh()
- curses.doupdate()
def get_selected_row(self):
"""