diff options
Diffstat (limited to 'module/gui')
-rw-r--r-- | module/gui/Collector.py | 5 | ||||
-rw-r--r-- | module/gui/Queue.py | 16 |
2 files changed, 5 insertions, 16 deletions
diff --git a/module/gui/Collector.py b/module/gui/Collector.py index 5fc041a8e..87d433566 100644 --- a/module/gui/Collector.py +++ b/module/gui/Collector.py @@ -142,8 +142,9 @@ class CollectorModel(QAbstractItemModel): if package.id == int(info["package"]): for k, child in enumerate(package.children): if child.id == int(event[3]): - child.data = info - child.data["downloading"] = None + child.data.update(info) + if not info["status"] == 12: + child.data["downloading"] = None self.emit(SIGNAL("dataChanged(const QModelIndex &, const QModelIndex &)"), self.index(k, 0, self.index(p, 0)), self.index(k, self.cols, self.index(p, self.cols))) break else: diff --git a/module/gui/Queue.py b/module/gui/Queue.py index 5489f85ce..eb13415f0 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -116,24 +116,12 @@ class QueueModel(CollectorModel): def getProgress(self, item): locker = QMutexLocker(self.mutex) if isinstance(item, Link): - if item.data["downloading"]: - return int(item.data["downloading"]["percent"]) - if item.data["statusmsg"] == "finished" or \ - item.data["statusmsg"] == "failed" or \ - item.data["statusmsg"] == "aborted": - return 100 + return int(item.data["progress"]) elif isinstance(item, Package): count = len(item.children) perc_sum = 0 for child in item.children: - val = 0 - if child.data["downloading"]: - val = int(child.data["downloading"]["percent"]) - elif child.data["statusmsg"] == "finished" or \ - child.data["statusmsg"] == "failed" or \ - child.data["statusmsg"] == "aborted": - val = 100 - perc_sum += val + perc_sum += int(child.data["progress"]) if count == 0: return 0 return perc_sum/count |