summaryrefslogtreecommitdiffstats
path: root/module/gui
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-12-12 17:45:40 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2010-12-12 17:45:40 +0100
commitddc6c0c15c132933e9676d563bad37288a3212f5 (patch)
treea5d6ecbcc4b96be9f8aead14262f3aa3ec69a5df /module/gui
parentfixed progress when resuming (diff)
downloadpyload-ddc6c0c15c132933e9676d563bad37288a3212f5.tar.xz
universal progress (ex. unrar progress), link info now emits update event, updated .pot
Diffstat (limited to 'module/gui')
-rw-r--r--module/gui/Collector.py5
-rw-r--r--module/gui/Queue.py16
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