summaryrefslogtreecommitdiff
path: root/src/roster.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-12-17 14:36:14 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-12-17 14:36:14 +0000
commitc77842e1becfa458dac24d4137c47bf17748db27 (patch)
treea040bedea4079acbe3258d17d0d67e492ae48a45 /src/roster.py
parent483ad95f3bfc8fa84d01aee8c94e66f21d3a0139 (diff)
downloadpoezio-c77842e1becfa458dac24d4137c47bf17748db27.tar.gz
poezio-c77842e1becfa458dac24d4137c47bf17748db27.tar.bz2
poezio-c77842e1becfa458dac24d4137c47bf17748db27.tar.xz
poezio-c77842e1becfa458dac24d4137c47bf17748db27.zip
fixed #1892 save folded rosters and info_win_height in the config file
Diffstat (limited to 'src/roster.py')
-rw-r--r--src/roster.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/roster.py b/src/roster.py
index 610d73dc..c03e1e1c 100644
--- a/src/roster.py
+++ b/src/roster.py
@@ -99,7 +99,8 @@ class Roster(object):
if not group.has_contact(contact):
group.add_contact(contact)
return
- new_group = RosterGroup(group_name)
+ folded_groups = config.get('folded_roster_groups', '', section='var').split(':')
+ new_group = RosterGroup(group_name, folded=group_name in folded_groups)
self._roster_groups.append(new_group)
new_group.add_contact(contact)
@@ -109,6 +110,16 @@ class Roster(object):
"""
return self._roster_groups
+ def save_to_config_file(self):
+ """
+ Save various information to the config file
+ e.g. the folded groups
+ """
+ folded_groups = ':'.join([group.name for group in self._roster_groups\
+ if group.folded])
+ log.debug('folded:%s\n' %folded_groups)
+ config.set_and_save('folded_roster_groups', folded_groups, 'var')
+
def __len__(self):
"""
Return the number of line that would be printed