summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authormathieui <mathieui@mathieui.net>2011-02-02 00:51:34 +0100
committermathieui <mathieui@mathieui.net>2011-02-02 00:51:34 +0100
commit01f3409505a6d0a0459b79f2d9c3895cd7078a70 (patch)
tree741f81f2a46accf44df6341e38b17b5a1465aefc
parent89f337a4573ebbca513103340c9400b97950745c (diff)
downloadpoezio-01f3409505a6d0a0459b79f2d9c3895cd7078a70.tar.gz
poezio-01f3409505a6d0a0459b79f2d9c3895cd7078a70.tar.bz2
poezio-01f3409505a6d0a0459b79f2d9c3895cd7078a70.tar.xz
poezio-01f3409505a6d0a0459b79f2d9c3895cd7078a70.zip
fixed #2115
-rw-r--r--src/roster.py9
-rw-r--r--src/tabs.py2
-rw-r--r--src/windows.py6
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 0667edb3..7abc0e8f 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))