Add a hide_user_lits option that does what it says.

fix #2170
This commit is contained in:
Florent Le Coz 2012-11-30 13:47:11 +01:00
parent 5db9144303
commit 5bfbbb2c24
4 changed files with 26 additions and 6 deletions

View file

@ -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.

View file

@ -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

View file

@ -1157,12 +1157,15 @@ class MucTab(ChatTab):
if not self.visible:
return
self.need_resize = False
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,6 +1175,7 @@ class MucTab(ChatTab):
log.debug(' TAB Refresh: %s',self.__class__.__name__)
self.topic_win.refresh(self.get_single_line_topic())
self.text_win.refresh()
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)
@ -1248,10 +1252,13 @@ class MucTab(ChatTab):
def on_info_win_size_changed(self):
if self.core.information_win_size >= self.height-3:
return
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

View file

@ -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':