summaryrefslogtreecommitdiff
path: root/src/roster.py
diff options
context:
space:
mode:
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