From ddc6c0c15c132933e9676d563bad37288a3212f5 Mon Sep 17 00:00:00 2001 From: mkaay Date: Sun, 12 Dec 2010 17:45:40 +0100 Subject: universal progress (ex. unrar progress), link info now emits update event, updated .pot --- module/gui/Queue.py | 16 ++-------------- 1 file changed, 2 insertions(+), 14 deletions(-) (limited to 'module/gui/Queue.py') 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 -- cgit v1.2.3