Beispiel #1
0
    def finishRequest(self, reply):

        if reply.url().toString() in self.avatars :
            img = QtGui.QImage()
            img.loadFromData(reply.readAll())
            pix = QtGui.QPixmap(img)
            self.avatars[reply.url().toString()].setIcon(QtGui.QIcon(pix))   
            self.avatars[reply.url().toString()].setIconSize(pix.rect().size())     
        
            util.addrespix(reply.url().toString(), QtGui.QPixmap(img))
Beispiel #2
0
    def finish_request(self, reply):

        if reply.url().toString() in self.avatars:
            img = QtGui.QImage()
            img.loadFromData(reply.readAll())
            pix = QtGui.QPixmap(img)
            self.avatars[reply.url().toString()].setIcon(QtGui.QIcon(pix))
            self.avatars[reply.url().toString()].setIconSize(pix.rect().size())

            util.addrespix(reply.url().toString(), QtGui.QPixmap(img))
Beispiel #3
0
    def finishDownloadAvatar(self, reply):
        ''' this take care of updating the avatars of players once they are downloaded '''
        img = QtGui.QImage()
        img.loadFromData(reply.readAll())
        pix = util.respix(reply.url().toString())
        if pix :
            pix = QtGui.QIcon(QtGui.QPixmap(img))
        else :
            util.addrespix(reply.url().toString(), QtGui.QPixmap(img))

        for player in util.curDownloadAvatar(reply.url().toString()) :
            for channel in self.channels :
                if player in self.channels[channel].chatters :
                    self.channels[channel].chatters[player].avatarItem.setIcon(QtGui.QIcon(util.respix(reply.url().toString())))
                    self.channels[channel].chatters[player].avatarItem.setToolTip(self.channels[channel].chatters[player].avatarTip)
Beispiel #4
0
    def finish_download_avatar(self, reply):
        """ this take care of updating the avatars of players once they are downloaded """
        img = QtGui.QImage()
        img.loadFromData(reply.readAll())
        url = reply.url().toString()
        if not util.respix(url):
            util.addrespix(url, QtGui.QPixmap(img))

        for chatter in util.curDownloadAvatar(url):
            # FIXME - hack to prevent touching chatter if it was removed
            channel = chatter.channel
            ircuser = chatter.user
            if ircuser in channel.chatters:
                chatter.update_avatar()
        util.delDownloadAvatar(url)
Beispiel #5
0
    def finishDownloadAvatar(self, reply):
        ''' this take care of updating the avatars of players once they are downloaded '''
        img = QtGui.QImage()
        img.loadFromData(reply.readAll())
        pix = util.respix(reply.url().toString())
        if pix:
            pix = QtGui.QIcon(QtGui.QPixmap(img))
        else:
            util.addrespix(reply.url().toString(), QtGui.QPixmap(img))

        for player in util.curDownloadAvatar(reply.url().toString()):
            for channel in self.channels:
                if player in self.channels[channel].chatters:
                    self.channels[channel].chatters[player].avatarItem.setIcon(
                        QtGui.QIcon(util.respix(reply.url().toString())))
                    self.channels[channel].chatters[
                        player].avatarItem.setToolTip(
                            self.channels[channel].chatters[player].avatarTip)