Beispiel #1
0
 def __addClubInvites(self):
     model = self._model()
     profile = self.clubsCtrl.getProfile()
     if model is None or not profile.isInvitesAvailable():
         return
     model.removeNotificationsByType(NOTIFICATION_TYPE.CLUB_INVITE)
     invites = profile.getInvites().values()
     invites = sorted(invites, cmp=lambda invite, other: cmp(invite.getTimestamp(), other.getTimestamp()))
     activeInvites = filter(operator.methodcaller('isActive'), invites)
     if len(activeInvites):
         showInvitationInWindowsBar()
     for invite in invites:
         model.addNotification(ClubInviteDecorator(invite))
Beispiel #2
0
    def onAccountClubInvitesChanged(self, added, removed, changed):
        model = self._model()
        if model is None:
            return
        if len(added):
            showInvitationInWindowsBar()
        for invite in removed:
            model.removeNotification(NOTIFICATION_TYPE.CLUB_INVITE, invite.getID())

        for invite in added:
            model.addNotification(ClubInviteDecorator(invite))

        for invite in changed:
            model.updateNotification(NOTIFICATION_TYPE.CLUB_INVITE, invite.getID(), invite, True)
    def __doNotify(self):
        haveInvites = False
        for invite in prb_seqs.AutoInvitesIterator():
            prbID = invite.prbID
            haveInvites = True
            if prbID in self.__notified:
                continue
            if not len(invite.description):
                continue
            g_eventDispatcher.fireAutoInviteReceived(invite)
            showInvitationInWindowsBar()
            self.__notified.add(prbID)

        if not haveInvites:
            self.__notified.clear()
Beispiel #4
0
    def __doNotify(self):
        haveInvites = False
        for invite in prb_seqs.AutoInvitesIterator():
            prbID = invite.prbID
            haveInvites = True
            if prbID in self.__notified:
                continue
            if not invite.description:
                continue
            g_eventDispatcher.fireAutoInviteReceived(invite)
            showInvitationInWindowsBar()
            self.__notified.add(prbID)

        if not haveInvites:
            self.__notified.clear()
Beispiel #5
0
 def __addClubInvites(self):
     model = self._model()
     profile = self.clubsCtrl.getProfile()
     if model is None or not profile.isInvitesAvailable():
         return
     model.removeNotificationsByType(NOTIFICATION_TYPE.CLUB_INVITE)
     invites = profile.getInvites().values()
     invites = sorted(invites,
                      cmp=lambda invite, other: cmp(invite.getTimestamp(),
                                                    other.getTimestamp()))
     activeInvites = filter(operator.methodcaller('isActive'), invites)
     if len(activeInvites):
         showInvitationInWindowsBar()
     for invite in invites:
         model.addNotification(ClubInviteDecorator(invite))
Beispiel #6
0
    def onAccountClubInvitesChanged(self, added, removed, changed):
        model = self._model()
        if model is None:
            return
        if len(added):
            showInvitationInWindowsBar()
        for invite in removed:
            model.removeNotification(NOTIFICATION_TYPE.CLUB_INVITE,
                                     invite.getID())

        for invite in added:
            model.addNotification(ClubInviteDecorator(invite))

        for invite in changed:
            model.updateNotification(NOTIFICATION_TYPE.CLUB_INVITE,
                                     invite.getID(), invite, True)
Beispiel #7
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)
Beispiel #8
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)
Beispiel #9
0
 def __onInviteListInited(self):
     if self.prbInvites.getUnreadCount() > 0:
         showInvitationInWindowsBar()
     self.__addInvites()
Beispiel #10
0
 def __onInviteListInited(self):
     if self.prbInvites.getUnreadCount() > 0:
         showInvitationInWindowsBar()
     self.__addInvites()
 def loadPreArenaUnit(self, prbType, modeFlags=0):
     utils.showInvitationInWindowsBar()
     self.app.containerManager.clear()
     self.showUnitPreArenaWindow(prbType, modeFlags)
Beispiel #12
0
 def loadPreArenaUnit(self, prbType, modeFlags=0):
     utils.showInvitationInWindowsBar()
     self.app.containerManager.clear()
     self.showUnitPreArenaWindow(prbType, modeFlags)
Beispiel #13
0
 def blinkTaskbar(self, cmd):
     showInvitationInWindowsBar()