# HG changeset patch # User Goffi # Date 1263104743 -39600 # Node ID 2ce9e350cdf91cb834c1227b8b61b5ffe2c31bbf # Parent 6dfe5bb10008ae4165052730ad90d76c31ddc4d8 Wix: clicking on group in contact_list now (un)hide it. Quick App: added a method to get all contacts in a group in contact_management diff -r 6dfe5bb10008 -r 2ce9e350cdf9 frontends/quick_frontend/quick_contact_management.py --- a/frontends/quick_frontend/quick_contact_management.py Sun Jan 10 16:42:09 2010 +1100 +++ b/frontends/quick_frontend/quick_contact_management.py Sun Jan 10 17:25:43 2010 +1100 @@ -42,7 +42,16 @@ if entity.resource in self.__contactlist[entity.short]['resources']: self.__contactlist[entity.short]['resources'].remove(entity.resource) self.__contactlist[entity.short]['resources'].append(entity.resource) - + + def getContFromGroup(self, group): + """Return all contacts which are in given group""" + result = [] + for contact in self.__contactlist: + if self.__contactlist[contact].has_key('groups'): + if group in self.__contactlist[contact]['groups']: + result.append(JID(contact)) + return result + def getAttr(self, entity, name): """Return a specific attribute of contact, or all attributes @param entity: jid of the contact diff -r 6dfe5bb10008 -r 2ce9e350cdf9 frontends/wix/main_window.py --- a/frontends/wix/main_window.py Sun Jan 10 16:42:09 2010 +1100 +++ b/frontends/wix/main_window.py Sun Jan 10 17:25:43 2010 +1100 @@ -79,7 +79,7 @@ self.Bind(wx.EVT_LISTBOX_DCLICK, self.onActivated) def __find_idx(self, entity, reverse=False): - """Find indexes of given jid in contact list + """Find indexes of given jid (or groups) in contact list @return: list of indexes""" result=[] for i in range(self.GetCount()): @@ -98,10 +98,23 @@ def disconnect(self, jid): self.remove(jid) #for now, we only show online contacts + + def __eraseGroup(self, group): + """Erase all contacts in group + @param group: group to erase + @return: True if something as been erased""" + erased = False + indexes = self.__find_idx(group) + for idx in indexes: + while idx