Пример #1
0
    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])
Пример #2
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)
Пример #3
0
    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])
Пример #4
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)
Пример #5
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)
Пример #6
0
 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()))
Пример #7
0
    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()
Пример #8
0
    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()
Пример #9
0
    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()
Пример #10
0
    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()