Exemplo n.º 1
0
 def __addInvites(self):
     model = self._model()
     if model is None:
         return
     model.removeNotificationsByType(NOTIFICATION_TYPE.INVITE)
     invites = self.prbInvites.getReceivedInvites()
     invites = sorted(
         invites,
         cmp=lambda invite, other: cmp(invite.createTime, other.createTime))
     for invite in invites:
         model.addNotification(PrbInviteDecorator(invite))
Exemplo n.º 2
0
    def __onInviteListModified(self, added, changed, deleted):
        showInvitationInWindowsBar()
        model = self._model()
        if model is None:
            return
        for inviteID in added:
            invite = self.prbInvites.getInvite(inviteID)
            if invite:
                model.addNotification(PrbInviteDecorator(invite))

        for inviteID in deleted:
            model.removeNotification(NOTIFICATION_TYPE.INVITE, inviteID)

        for inviteID in changed:
            invite = self.prbInvites.getInvite(inviteID)
            if invite:
                model.updateNotification(NOTIFICATION_TYPE.INVITE, inviteID,
                                         invite, True)