Fix edit group problems :

-redraw group expand state
-when removing last metacontact little brother, remove meta tag for big brother. Else that confuse when
moving via edit group.

Note that edit group is broken by http://trac.gajim.org/changeset/9551
This commit is contained in:
Jean-Marie Traissard 2008-05-01 14:27:53 +00:00
parent 79f4d22fa4
commit 7144520bc0
1 changed files with 10 additions and 4 deletions

View File

@ -482,7 +482,7 @@ class RosterWindow:
def _remove_metacontact_family(self, family, account): def _remove_metacontact_family(self, family, account):
'''Remove the give Metacontact family from roster data model. '''Remove the given Metacontact family from roster data model.
See Contacts.get_metacontacts_family() and RosterWindow._remove_entity() See Contacts.get_metacontacts_family() and RosterWindow._remove_entity()
''' '''
@ -752,7 +752,6 @@ class RosterWindow:
gajim.contacts.add_contact(account, c) gajim.contacts.add_contact(account, c)
self.add_contact(contact.jid, account) self.add_contact(contact.jid, account)
def add_contact_to_groups(self, jid, account, groups): def add_contact_to_groups(self, jid, account, groups):
'''Add contact to given groups and redraw them. '''Add contact to given groups and redraw them.
@ -776,6 +775,8 @@ class RosterWindow:
contact.groups) contact.groups)
self.add_contact(jid, account) self.add_contact(jid, account)
for group in groups:
self._adjust_group_expand_collapse_state(group, account)
def remove_contact_from_groups(self, jid, account, groups): def remove_contact_from_groups(self, jid, account, groups):
'''Remove contact from given groups and redraw them. '''Remove contact from given groups and redraw them.
@ -3705,8 +3706,13 @@ class RosterWindow:
if data['jid'] == c_source.jid and\ if data['jid'] == c_source.jid and\
data['account'] == account: data['account'] == account:
continue continue
if len(family) == 2:
# we deleted last remaining little brother, remove the meta
# tag for the parent
gajim.contacts.remove_metacontact(data['account'], \
data['jid'])
self.add_contact(data['jid'], data['account']) self.add_contact(data['jid'], data['account'])
break; break
self.add_contact_to_groups(c_source.jid, account, [grp_dest,]) self.add_contact_to_groups(c_source.jid, account, [grp_dest,])