diff options
author | mkaay <mkaay@mkaay.de> | 2010-12-19 14:12:03 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2010-12-19 14:12:03 +0100 |
commit | 5120d1a26cac79ab283f38db8d7f18c9c010e786 (patch) | |
tree | 219f8874869ac6f9c1656fea9df8db17b55ce034 /module/gui | |
parent | acc manager fix (diff) | |
download | pyload-5120d1a26cac79ab283f38db8d7f18c9c010e786.tar.xz |
new experimental backend, new gui status (unfinished)
Diffstat (limited to 'module/gui')
-rw-r--r-- | module/gui/MainWindow.py | 46 | ||||
-rw-r--r-- | module/gui/Queue.py | 16 |
2 files changed, 51 insertions, 11 deletions
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index c0fe6e804..a02ea7989 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -62,16 +62,40 @@ class MainWindow(QMainWindow): self.setCentralWidget(lw) #status - #@TODO: build a fancy box - - #self.statusw = QFrame() - #self.statusw.setFrameStyle(QFrame.StyledPanel | QFrame.Raised) - #self.statusw.setLineWidth(2) - #self.statusw.setLayout(QGridLayout()) - #l = self.statusw.layout() - #l.addWidget(QLabel("Status:"), 0, 0) - #l.addWidget(QLabel("Speed:"), 0, 3) - #l.addWidget(QLabel("Space:"), 0, 5) + self.statusw = QFrame() + self.statusw.setFrameStyle(QFrame.StyledPanel | QFrame.Raised) + self.statusw.setLineWidth(2) + self.statusw.setLayout(QGridLayout()) + l = self.statusw.layout() + l.addWidget(QLabel(_("packages:")), 0, 0) + l.addWidget(QLabel(_("files:")), 1, 0) + self.packageCount = QLabel("0") + self.fileCount = QLabel("0") + l.addWidget(self.packageCount, 0, 1) + l.addWidget(self.fileCount, 1, 1) + + l.addWidget(QLabel(_("status:")), 0, 3) + l.addWidget(QLabel(_("ip:")), 1, 3) + self.status = QLabel("running") + self.ip = QLabel("") + l.addWidget(self.status, 0, 4) + l.addWidget(self.ip, 1, 4) + + l.addWidget(QLabel(_("speed:")), 0, 5) + l.addWidget(QLabel(_("space:")), 1, 5) + self.speed = QLabel("") + self.space = QLabel("") + l.addWidget(self.speed, 0, 6) + l.addWidget(self.space, 1, 6) + + l.addWidget(QLabel(_("max. downloads:")), 0, 7) + l.addWidget(QLabel(_("max. chunks:")), 1, 7) + self.maxDownloads = QSpinBox() + self.maxDownloads.setEnabled(False) + self.maxChunks = QSpinBox() + self.maxChunks.setEnabled(False) + l.addWidget(self.maxDownloads, 0, 8) + l.addWidget(self.maxChunks, 1, 8) #set menubar and statusbar self.menubar = self.menuBar() @@ -126,7 +150,7 @@ class MainWindow(QMainWindow): #layout self.masterlayout.addWidget(self.tabw) - #self.masterlayout.addWidget(self.statusw) + self.masterlayout.addWidget(self.statusw) #signals.. self.connect(self.mactions["manager"], SIGNAL("triggered()"), self.slotShowConnector) diff --git a/module/gui/Queue.py b/module/gui/Queue.py index d60858e34..7c5c59f15 100644 --- a/module/gui/Queue.py +++ b/module/gui/Queue.py @@ -61,6 +61,22 @@ class QueueModel(CollectorModel): self._data.append(package) self._data = sorted(self._data, key=lambda p: p.data["order"]) self.endInsertRows() + self.updateCount() + + def insertEvent(self, event): + CollectorModel.insertEvent(self, event) + self.updateCount() + + def removeEvent(self, event): + CollectorModel.removeEvent(self, event) + self.updateCount() + + def updateCount(self): + packageCount = len(self._data) + fileCount = 0 + for p in self._data: + fileCount += len(p.children) + self.emit(SIGNAL("updateCount"), packageCount, fileCount) def update(self): locker = QMutexLocker(self.mutex) |