From c77842e1becfa458dac24d4137c47bf17748db27 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Fri, 17 Dec 2010 14:36:14 +0000 Subject: fixed #1892 save folded rosters and info_win_height in the config file --- src/roster.py | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) (limited to 'src/roster.py') 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 -- cgit v1.2.3