diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/roster.py | 9 | ||||
-rw-r--r-- | src/tabs.py | 2 | ||||
-rw-r--r-- | src/windows.py | 6 |
3 files changed, 14 insertions, 3 deletions
diff --git a/src/roster.py b/src/roster.py index 97975d33..5f927173 100644 --- a/src/roster.py +++ b/src/roster.py @@ -134,6 +134,15 @@ class Roster(object): log.debug('folded:%s\n' %folded_groups) config.set_and_save('folded_roster_groups', folded_groups, 'var') + def get_nb_connected_contacts(self): + """ + Return the number of contacts connected + """ + length = 0 + for group in self._roster_groups: + length += group.get_nb_connected_contacts() + return length + def __len__(self): """ Return the number of line that would be printed diff --git a/src/tabs.py b/src/tabs.py index 0dbf25a9..5a27902e 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -283,7 +283,7 @@ class InfoTab(ChatTab): self.tab_win.resize(1, self.width, self.height-2, 0, self.core.stdscr) self.info_win.resize(self.height-2, self.width, 0, 0, self.core.stdscr) self.input.resize(1, self.width, self.height-1, 0, self.core.stdscr) - + def refresh(self, tabs, informations, _): if not self.visible: return diff --git a/src/windows.py b/src/windows.py index 546b4be3..2720053d 100644 --- a/src/windows.py +++ b/src/windows.py @@ -1259,7 +1259,8 @@ class RosterWin(Win): def draw_roster_information(self, roster): """ """ - self.addstr('Roster: %s contacts' % roster.get_contact_len(), curses.color_pair(theme.COLOR_INFORMATION_BAR)) + self.addstr('Roster: %s/%s contacts' % (roster.get_nb_connected_contacts(), roster.get_contact_len())\ + , curses.color_pair(theme.COLOR_INFORMATION_BAR)) self.finish_line(theme.COLOR_INFORMATION_BAR) def draw_group(self, y, group, colored): @@ -1272,7 +1273,8 @@ class RosterWin(Win): self.addstr(y, 0, '[+] ') else: self.addstr(y, 0, '[-] ') - self.addstr(y, 4, group.name) + contacts = " (%s/%s)" % (group.get_nb_connected_contacts(), len(group)) + self.addstr(y, 4, group.name + contacts) if colored: self._win.attroff(curses.color_pair(theme.COLOR_SELECTED_ROW)) |