diff options
Diffstat (limited to 'src/windows.py')
-rw-r--r-- | src/windows.py | 30 |
1 files changed, 23 insertions, 7 deletions
diff --git a/src/windows.py b/src/windows.py index 49e23a46..b0780cf5 100644 --- a/src/windows.py +++ b/src/windows.py @@ -319,15 +319,24 @@ class GlobalInfoBar(Win): self._win.erase() self.addstr(0, 0, "[", to_curses_attr(get_theme().COLOR_INFORMATION_BAR)) sorted_tabs = sorted(self.core.tabs, key=comp) + show_names = config.getl('show_tab_names', 'false') == 'true' + show_nums = config.getl('show_tab_numbers', 'true') != 'false' + use_nicks = config.getl('use_tab_nicks', 'true') != 'false' for tab in sorted_tabs: color = tab.color if config.get('show_inactive_tabs', 'true') == 'false' and\ color is get_theme().COLOR_TAB_NORMAL: continue try: - self.addstr("%s" % str(tab.nb), to_curses_attr(color)) - if config.get('show_tab_names', 'false') == 'true': - self.addstr(" %s" % str(tab.get_name()), to_curses_attr(color)) + if show_nums or not show_names: + self.addstr("%s" % str(tab.nb), to_curses_attr(color)) + if show_names: + self.addstr(' ', to_curses_attr(color)) + if show_names: + if use_nicks: + self.addstr("%s" % str(tab.get_nick()), to_curses_attr(color)) + else: + self.addstr("%s" % str(tab.get_name()), to_curses_attr(color)) self.addstr("|", to_curses_attr(get_theme().COLOR_INFORMATION_BAR)) except: # end of line break @@ -356,6 +365,7 @@ class VerticalGlobalInfoBar(Win): sorted_tabs = [tab for tab in sorted_tabs if\ tab.vertical_color is not get_theme().COLOR_VERTICAL_TAB_NORMAL] nb_tabs = len(sorted_tabs) + use_nicks = config.getl('use_tab_nicks', 'true') != 'false' if nb_tabs >= height: for y, tab in enumerate(sorted_tabs): if tab.vertical_color == get_theme().COLOR_VERTICAL_TAB_CURRENT: @@ -372,7 +382,10 @@ class VerticalGlobalInfoBar(Win): color = tab.vertical_color self.addstr(y if config.get('vertical_tab_list_sort', 'desc') != 'asc' else height - y - 1, 0, "%2d" % tab.nb, to_curses_attr(get_theme().COLOR_VERTICAL_TAB_NUMBER)) self.addstr('.') - self.addnstr("%s" % tab.get_name(), width - 4, to_curses_attr(color)) + if use_nicks: + self.addnstr("%s" % tab.get_nick(), width - 4, to_curses_attr(color)) + else: + self.addnstr("%s" % tab.get_name(), width - 4, to_curses_attr(color)) self._win.attron(to_curses_attr(get_theme().COLOR_VERTICAL_SEPARATOR)) self._win.vline(0, width-1, curses.ACS_VLINE, height) self._win.attroff(to_curses_attr(get_theme().COLOR_VERTICAL_SEPARATOR)) @@ -1077,8 +1090,7 @@ class Input(Win): completion_type = config.get('completion', 'normal') if quotify: for i, word in enumerate(word_list[:]): - if ' ' in word: - word_list[i] = '"' + word + '"' + word_list[i] = '"' + word + '"' if completion_type == 'shell' and self.text != '': self.shell_completion(word_list, add_after) else: @@ -1619,7 +1631,9 @@ class RosterWin(Win): presence = resource.presence nb = ' (%s)' % len(contact) color = RosterWin.color_show[presence]() - if contact.name: + if config.getl('show_roster_jids', 'true') == 'false' and contact.name: + display_name = '%s %s' % (contact.name, nb[1:]) + elif contact.name: display_name = '%s (%s)%s' % (contact.name, contact.bare_jid, nb,) else: @@ -1681,6 +1695,8 @@ class ContactInfoWin(Win): else: self.addstr('Ask: %s' % (contact.ask,)) self.finish_line() + if resource: + self.addstr(2, 0, 'Status: %s' % (resource.status)) def draw_group_info(self, group): |