summaryrefslogtreecommitdiffstats
path: root/module/gui
diff options
context:
space:
mode:
Diffstat (limited to 'module/gui')
-rw-r--r--module/gui/MainWindow.py2
-rw-r--r--module/gui/Overview.py18
-rw-r--r--module/gui/Queue.py15
3 files changed, 23 insertions, 12 deletions
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py
index fc594dd06..b5ec345cb 100644
--- a/module/gui/MainWindow.py
+++ b/module/gui/MainWindow.py
@@ -41,7 +41,7 @@ class MainWindow(QMainWindow):
#window stuff
self.setWindowTitle(_("pyLoad Client"))
self.setWindowIcon(QIcon(join(pypath, "icons","logo.png")))
- self.resize(900,500)
+ self.resize(1000,600)
#layout version
self.version = 3
diff --git a/module/gui/Overview.py b/module/gui/Overview.py
index 533c6faa8..1ac790515 100644
--- a/module/gui/Overview.py
+++ b/module/gui/Overview.py
@@ -50,13 +50,19 @@ class OverviewModel(QAbstractListModel):
return f
def maxSize(p):
- s = 0
+ ms = 0
+ cs = 0
for c in p.children:
try:
- s += c.data["downloading"]["size"]
+ s = c.data["downloading"]["size"]
except:
- s += c.data["size"]
- return s
+ s = c.data["size"]
+ if c.data["downloading"]:
+ cs += s - c.data["downloading"]["bleft"]
+ elif self.queue.getProgress(c, False) == 100:
+ cs += s
+ ms += s
+ return ms, cs
def getProgress(p):
for c in p.children:
@@ -67,7 +73,7 @@ class OverviewModel(QAbstractListModel):
d = self.queue._data
for p in d:
status, progress = getProgress(p)
- maxsize = maxSize(p)
+ maxsize, currentsize = maxSize(p)
speed = self.queue.getSpeed(p)
if speed:
eta = (maxsize - (maxsize * (progress/100.0)))/1024/speed
@@ -82,7 +88,7 @@ class OverviewModel(QAbstractListModel):
OverviewModel.Parts: len(p.children),
OverviewModel.ETA: int(eta),
OverviewModel.Speed: speed,
- OverviewModel.CurrentSize: int(maxsize * (progress/100.0)),
+ OverviewModel.CurrentSize: currentsize,
OverviewModel.MaxSize: maxsize,
OverviewModel.Status: status,
}
diff --git a/module/gui/Queue.py b/module/gui/Queue.py
index c1944eb54..d2541f024 100644
--- a/module/gui/Queue.py
+++ b/module/gui/Queue.py
@@ -27,7 +27,7 @@ def formatSize(size):
"""formats size of bytes"""
size = int(size)
steps = 0
- sizes = ["B", "KB", "MB", "GB", "TB"]
+ sizes = ["B", "KiB", "MiB", "GiB", "TiB"]
while size > 1000:
size /= 1024.0
@@ -222,18 +222,23 @@ class QueueModel(CollectorModel):
if speed is None or status == 7 or status == 10 or status == 5:
return QVariant(self.translateStatus(statusMapReverse[status]))
else:
- return QVariant("%s (%s KB/s)" % (self.translateStatus(statusMapReverse[status]), speed))
+ return QVariant("%s (%s KiB/s)" % (self.translateStatus(statusMapReverse[status]), speed))
elif index.column() == 3:
item = index.internalPointer()
if isinstance(item, Package):
return QVariant(item.data["priority"])
+ else:
+ return QVariant(item.package.data["priority"])
elif index.column() == 4:
item = index.internalPointer()
if isinstance(item, Link):
if self.getProgress(item, False) == 100:
return QVariant(formatSize(item.data["size"]))
elif self.getProgress(item, False) == 0:
- return QVariant("0 B / %s" % formatSize(item.data["size"]))
+ try:
+ return QVariant("%s / %s" % (formatSize(item.data["size"]-item.data["downloading"]["bleft"]), formatSize(item.data["size"])))
+ except:
+ return QVariant("0 B / %s" % formatSize(item.data["size"]))
else:
try:
return QVariant("%s / %s" % (formatSize(item.data["size"]-item.data["downloading"]["bleft"]), formatSize(item.data["size"])))
@@ -278,9 +283,9 @@ class QueueView(CollectorView):
self.setColumnWidth(0, 300)
self.setColumnWidth(1, 100)
- self.setColumnWidth(2, 120)
+ self.setColumnWidth(2, 130)
self.setColumnWidth(3, 50)
- self.setColumnWidth(4, 100)
+ self.setColumnWidth(4, 120)
self.setColumnWidth(5, 70)
self.setEditTriggers(QAbstractItemView.NoEditTriggers)