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))
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))
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)
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)
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)