Exemple #1
0
 def __init__(self, tweet=None, without=(), parent=None):
     super(SingleTweetWidget, self).__init__(parent)
     self.errorWindow = APIErrorWindow(self)
     self.tweet = tweet
     self.client = const.client
     self.without = without
     self.setObjectName("SingleTweetWidget")
     try:
         self.setupUi()
     except RuntimeError:
         return
     self.fetcher = AsyncFetcher("".join(
         (cache_path, str(WeRuntimeInfo()["uid"]))))
     self.download_lock = False
     self.__favorite_queue = []
Exemple #2
0
    def __init__(self, parent=None):
        super(WAsyncLabel, self).__init__(parent)
        self._url = ""
        self._image = None

        self.fetcher = AsyncFetcher("".join(
            (down_path, str(WeRuntimeInfo()["uid"]))))

        busyIconPixmap = WObjectCache().open(QtGui.QPixmap,
                                             ":/IMG/img/busy.gif")
        self.minimumImageHeight = busyIconPixmap.height()
        self.minimumImageWidth = busyIconPixmap.width()

        self.setContextMenuPolicy(QtCore.Qt.CustomContextMenu)
        self.customContextMenuRequested.connect(self.contextMenu)
Exemple #3
0
    def _setupUserTab(self, uid, switch=True, myself=False):
        index = self._getSameTab("uid", uid)
        if index:
            if switch:
                self.tabWidget.setCurrentIndex(index)
            return

        view = TweetListWidget()
        _timeline = TweetUserModel(self.client.api("statuses/user_timeline"),
                                   uid, view)
        timeline = TweetFilterModel(_timeline)
        timeline.setModel(_timeline)
        tab = self._setupCommonTab(timeline, view, switch, myself)

        def setAvatar(f):
            self._setTabIcon(tab, WObjectCache().open(QtGui.QPixmap, f))

        fetcher = AsyncFetcher("".join(
            (path.cache_path, str(self.info["uid"]))))
        fetcher.addTask(
            self.client.api("users/show").get(uid=uid)["profile_image_url"],
            setAvatar)