def group_updated(self, groupview): if (groupview.uid == 0): groupview.uid = '0' if groupview.uid not in self.groups: logger.error('Group iter %s not found!' % (groupview.uid)) return giter = self.__search_by_id(groupview.uid) self._model.set_value(giter, 1, groupview) self._model.set_value( giter, 2, '<b>%s</b>' % common.escape_pango(str(groupview.name))) try: cuids = self.contacts[groupview.uid] except: cuids = [] self.contacts[groupview.uid] = groupview.contact_ids.copy() for cid in groupview.contact_ids: if cid not in cuids: giter = self.__search_by_id(groupview.uid) self._model.append(giter, [None, None, cid, cid, True]) # Remove unused contacts for cid in cuids: if cid not in self.contacts[groupview.uid]: citers = self.__search_by_id(cid) citer = [ c for c in citers if self._model.is_ancestor(giter, c) ] self._model.remove(citer[0])
def groupUpdated(self, groupview): if (groupview.uid == 0): groupview.uid = '0' if groupview.uid not in self.groups: return giter = self.__search_by_id(groupview.uid) self._model.set_value(giter, 1, groupview) self._model.set_value(giter, 2, '<b>%s</b>' % common.escape_pango( groupview.name.toString())) try: cuids = self.contacts[groupview.uid] except: cuids = [] self.contacts[groupview.uid] = [] for cid in groupview.contact_ids: if cid not in cuids: giter = self.__search_by_id(groupview.uid) self.contacts[groupview.uid].append(cid) self._model.append(giter, [None, None, cid, cid, True]) # Remove unused contacts for cid in cuids: if cid not in self.contacts[groupview.uid]: citer = self.__search_by_id(cid) self._model.remove(citer) self.contacts[groupview.uid].remove(cid)
def groupUpdated(self, groupview): if (groupview.uid == 0): groupview.uid = '0' if groupview.uid not in self.groups: logger.error('Group iter %s not found!' %(contactview.uid)) return giter = self.__search_by_id(groupview.uid) self._model.set_value(giter, 1, groupview) self._model.set_value(giter, 2, '<b>%s</b>' % common.escape_pango( str(groupview.name))) try: cuids = self.contacts[groupview.uid] except: cuids = [] self.contacts[groupview.uid] = groupview.contact_ids.copy() for cid in groupview.contact_ids: if cid not in cuids: giter = self.__search_by_id(groupview.uid) self._model.append(giter, [None, None, cid, cid, True]) # Remove unused contacts for cid in cuids: if cid not in self.contacts[groupview.uid]: citers = self.__search_by_id(cid) citer = [c for c in citers if self._model.is_ancestor(giter, c)] self._model.remove(citer[0])
def groupUpdated(self, groupview): if (groupview.uid == 0): groupview.uid = '0' if groupview.uid not in self.groups: return giter = self.__search_by_id(groupview.uid) self._model.set_value(giter, 1, groupview) self._model.set_value( giter, 2, '<b>%s</b>' % common.escape_pango(str(groupview.name))) try: cuids = self.contacts[groupview.uid] except: cuids = [] self.contacts[groupview.uid] = groupview.contact_ids.copy() for cid in groupview.contact_ids: if cid not in cuids: giter = self.__search_by_id(groupview.uid) self._model.append(giter, [None, None, cid, cid, True]) # Remove unused contacts for cid in cuids: if cid not in self.contacts[groupview.uid]: citer = self.__search_by_id(cid) self._model.remove(citer)
def groupUpdated(self, groupview): if groupview.uid == 0: groupview.uid = "0" if groupview.uid not in self.groups: return giter = self.__search_by_id(groupview.uid) self._model.set_value(giter, 1, groupview) self._model.set_value(giter, 2, "<b>%s</b>" % common.escape_pango(str(groupview.name))) try: cuids = self.contacts[groupview.uid] except: cuids = [] self.contacts[groupview.uid] = groupview.contact_ids.copy() for cid in groupview.contact_ids: if cid not in cuids: giter = self.__search_by_id(groupview.uid) self._model.append(giter, [None, None, cid, cid, True]) # Remove unused contacts for cid in cuids: if cid not in self.contacts[groupview.uid]: citer = self.__search_by_id(cid) self._model.remove(citer)
def contactUpdated(self, contactview): citer = self.__search_by_id(contactview.uid) if citer is None: return # TODO: Verify if DP exist img = Image(self._cwin._skin, contactview.dp) dp = img.to_pixbuf(32) ###img = Image(self._main_win._skin, contactview.icon) ###dp = img.to_pixbuf(28) self._model.set_value(citer, 0, dp) self._model.set_value(citer, 1, contactview) self._model.set_value(citer, 2, common.escape_pango( contactview.name.toString()))
def contactUpdated(self, contactview): citer = self.__search_by_id(contactview.uid) if citer is None: return img = Image(self._cwin._theme_manager, contactview.dp) #img = Image(self._cwin._theme_manager, contactview.icon) dp = img.to_pixbuf(28, 28) self._model.set_value(citer, 0, dp) self._model.set_value(citer, 1, contactview) self._model.set_value(citer, 2, common.escape_pango( str(contactview.name))) del dp gc.collect()
def contactUpdated(self, contactview): """ @type contactview: ContactView """ citer = self.__search_by_id(contactview.uid) if citer is None: return img = Image(self._cwin._theme_manager, contactview.dp) #img = Image(self._cwin._theme_manager, contactview.icon) dp = img.to_pixbuf(28, 28) self._model.set_value(citer, 0, dp) self._model.set_value(citer, 1, contactview) self._model.set_value(citer, 2, common.escape_pango(str(contactview.name))) del dp gc.collect()
def contactUpdated(self, contactview): """ @type contactview: ContactView """ citers = self.__search_by_id(contactview.uid) if citers is None: logger.error('Contact iter %s not found!' %(contactview.uid)) return img = Image(self._cwin._theme_manager, contactview.dp) #img = Image(self._cwin._theme_manager, contactview.icon) dp = img.to_pixbuf(28, 28) for citer in citers: self._model.set_value(citer, 0, dp) self._model.set_value(citer, 1, contactview) self._model.set_value(citer, 2, common.escape_pango( str(contactview.name))) del dp gc.collect()
def contact_updated(self, contactview): """ @type contactview: ContactView """ citers = self.__search_by_id(contactview.uid) if citers is None: logger.error('Contact iter %s not found!' % (contactview.uid)) return img = Image(self._cwin._theme_manager, contactview.dp) #img = Image(self._cwin._theme_manager, contactview.icon) dp = img.to_pixbuf(28, 28) for citer in citers: self._model.set_value(citer, 0, dp) self._model.set_value(citer, 1, contactview) self._model.set_value(citer, 2, common.escape_pango(str(contactview.name))) del dp gc.collect()