From 5bfbbb2c245ac8eb16268856d8c06559ced1a7fe Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Fri, 30 Nov 2012 13:47:11 +0100 Subject: Add a hide_user_lits option that does what it says. fix #2170 --- data/default_config.cfg | 5 +++++ doc/en/configure.txt | 6 ++++++ src/tabs.py | 19 +++++++++++++------ src/windows.py | 2 ++ 4 files changed, 26 insertions(+), 6 deletions(-) diff --git a/data/default_config.cfg b/data/default_config.cfg index 489f9915..9c0c7052 100644 --- a/data/default_config.cfg +++ b/data/default_config.cfg @@ -147,6 +147,11 @@ information_buffer_popup_on = error roster warning help info # one line, the popup will stay visible two second per additional lines popup_time = 4 +# Whether to hide the list of user in the MultiUserChat tabs or not. Useful +# for example if you want to copy/paste the content of the buffer, or if you +# want to gain space +hide_user_list = false + # A list of words (or sentences) separated by colons (":"). All the # informational messages (described above) containing at least one of those # values will not be shown. diff --git a/doc/en/configure.txt b/doc/en/configure.txt index dee45931..8e487f14 100644 --- a/doc/en/configure.txt +++ b/doc/en/configure.txt @@ -196,6 +196,12 @@ section of this documentation. If the message takes more than one line, the popup will stay visible two more second per additional lines +*hide_user_list*:: false + + Whether to hide the list of user in the MultiUserChat tabs or not. Useful + for example if you want to copy/paste the content of the buffer, or if you + want to gain space + *filter_info_messages*:: [empty] A list of words or sentences separated by colons (":"). All the diff --git a/src/tabs.py b/src/tabs.py index a76489ea..0d99e19c 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -1157,12 +1157,15 @@ class MucTab(ChatTab): if not self.visible: return self.need_resize = False - text_width = (self.width//10)*9 + if config.get("hide_user_list", "false") == "true": + text_width = self.width + else: + text_width = (self.width//10)*9 + self.user_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), self.width-(self.width//10)*9-1, 1, (self.width//10)*9+1) self.topic_win.resize(1, self.width, 0, 0) self.v_separator.resize(self.height-2 - Tab.tab_win_height(), 1, 1, 9*(self.width//10)) self.text_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), text_width, 1, 0) self.text_win.rebuild_everything(self._text_buffer) - self.user_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), self.width-text_width-1, 1, text_width+1) self.info_header.resize(1, self.width, self.height-2-self.core.information_win_size - Tab.tab_win_height(), 0) self.input.resize(1, self.width, self.height-1, 0) @@ -1172,8 +1175,9 @@ class MucTab(ChatTab): log.debug(' TAB Refresh: %s',self.__class__.__name__) self.topic_win.refresh(self.get_single_line_topic()) self.text_win.refresh() - self.v_separator.refresh() - self.user_win.refresh(self.users) + if config.get("hide_user_list", "false") == "false": + self.v_separator.refresh() + self.user_win.refresh(self.users) self.info_header.refresh(self, self.text_win) self.refresh_tab_win() self.info_win.refresh() @@ -1248,10 +1252,13 @@ class MucTab(ChatTab): def on_info_win_size_changed(self): if self.core.information_win_size >= self.height-3: return - text_width = (self.width//10)*9 + if config.get("hide_user_list", "false") == "true": + text_width = self.width + else: + text_width = (self.width//10)*9 + self.user_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), self.width-(self.width//10)*9-1, 1, (self.width//10)*9+1) self.text_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), text_width, 1, 0) self.info_header.resize(1, self.width, self.height-2-self.core.information_win_size - Tab.tab_win_height(), 0) - self.user_win.resize(self.height-3-self.core.information_win_size - Tab.tab_win_height(), self.width-text_width-1, 1, text_width+1) def handle_presence(self, presence): from_nick = presence['from'].resource diff --git a/src/windows.py b/src/windows.py index 751c6c39..1b23cd03 100644 --- a/src/windows.py +++ b/src/windows.py @@ -227,6 +227,8 @@ class UserList(Win): def refresh(self, users): log.debug('Refresh: %s',self.__class__.__name__) + if config.get("hide_user_list", "false") == "true": + return # do not refresh if this win is hidden. with g_lock: self._win.erase() if config.get('user_list_sort', 'desc').lower() == 'asc': -- cgit v1.2.3