summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2010-09-02 18:55:34 +0200
committerGravatar mkaay <mkaay@mkaay.de> 2010-09-02 18:55:34 +0200
commitef049ef51d2e32290af0eb14ece03ef981b4783d (patch)
tree3e41695f4114e640545ac648f6a9907df789f48f /module
parentdb fixes (diff)
downloadpyload-ef049ef51d2e32290af0eb14ece03ef981b4783d.tar.xz
gui: minimize to tray, eta
Diffstat (limited to 'module')
-rw-r--r--module/gui/MainWindow.py6
-rw-r--r--module/gui/Queue.py16
2 files changed, 15 insertions, 7 deletions
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py
index 0c8953595..21227bdf5 100644
--- a/module/gui/MainWindow.py
+++ b/module/gui/MainWindow.py
@@ -113,7 +113,6 @@ class MainWindow(QMainWindow):
#signals..
self.connect(self.mactions["manager"], SIGNAL("triggered()"), self.slotShowConnector)
- self.connect(self.mactions["exit"], SIGNAL("triggered()"), self.close)
self.connect(self.tabs["queue"]["view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotQueueContextMenu)
self.connect(self.tabs["collector"]["package_view"], SIGNAL('customContextMenuRequested(const QPoint &)'), self.slotCollectorContextMenu)
@@ -346,8 +345,9 @@ class MainWindow(QMainWindow):
let me first save my state
"""
self.saveWindow()
- event.accept()
- self.emit(SIGNAL("quit"))
+ event.ignore()
+ self.hide()
+ self.emit(SIGNAL("hidden"))
def restoreWindow(self, state, geo):
"""
diff --git a/module/gui/Queue.py b/module/gui/Queue.py
index 988f532d7..42e92c61a 100644
--- a/module/gui/Queue.py
+++ b/module/gui/Queue.py
@@ -26,7 +26,7 @@ from module.gui.Collector import CollectorModel, Package, Link, CollectorView, s
class QueueModel(CollectorModel):
def __init__(self, view, connector):
CollectorModel.__init__(self, view, connector)
- self.cols = 5
+ self.cols = 6
self.wait_dict = {}
self.updater = self.QueueUpdater(self.interval)
@@ -84,6 +84,8 @@ class QueueModel(CollectorModel):
elif section == 3:
return QVariant(_("Priority"))
elif section == 4:
+ return QVariant(_("ETA"))
+ elif section == 5:
return QVariant(_("Progress"))
return QVariant()
@@ -190,6 +192,11 @@ class QueueModel(CollectorModel):
item = index.internalPointer()
if isinstance(item, Package):
return QVariant(item.data["priority"])
+ elif index.column() == 4:
+ item = index.internalPointer()
+ if isinstance(item, Link):
+ if item.data["downloading"]:
+ return QVariant(item.data["downloading"]["format_eta"])
elif role == Qt.EditRole:
if index.column() == 0:
return QVariant(index.internalPointer().data["name"])
@@ -209,12 +216,13 @@ class QueueView(CollectorView):
self.setColumnWidth(1, 100)
self.setColumnWidth(2, 150)
self.setColumnWidth(3, 50)
- self.setColumnWidth(4, 100)
+ self.setColumnWidth(4, 50)
+ self.setColumnWidth(5, 100)
self.setEditTriggers(QAbstractItemView.NoEditTriggers)
self.delegate = QueueProgressBarDelegate(self, self.model())
- self.setItemDelegateForColumn(4, self.delegate)
+ self.setItemDelegateForColumn(5, self.delegate)
class QueueProgressBarDelegate(QItemDelegate):
def __init__(self, parent, queue):
@@ -224,7 +232,7 @@ class QueueProgressBarDelegate(QItemDelegate):
def paint(self, painter, option, index):
if not index.isValid():
return
- if index.column() == 4:
+ if index.column() == 5:
item = index.internalPointer()
w = self.queue.getWaitingProgress(item)
wait = None