diff options
author | mkaay <mkaay@mkaay.de> | 2009-12-27 14:45:22 +0100 |
---|---|---|
committer | mkaay <mkaay@mkaay.de> | 2009-12-27 14:45:22 +0100 |
commit | 757f025247d77b085b6168d5f625d2bbfa7c4c0d (patch) | |
tree | 5458f45d3c45d6e7da4945a376df8433ccf1e5bf /pyLoadGui.py | |
parent | Fixed reconnect loop (easy doing) (diff) | |
download | pyload-757f025247d77b085b6168d5f625d2bbfa7c4c0d.tar.xz |
stop button works, closes #59
Diffstat (limited to 'pyLoadGui.py')
-rwxr-xr-x | pyLoadGui.py | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/pyLoadGui.py b/pyLoadGui.py index f075db710..0f76e6429 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -112,6 +112,7 @@ class main(QObject): self.connect(self.mainWindow, SIGNAL("restartDownload"), self.slotRestartDownload) self.connect(self.mainWindow, SIGNAL("removeDownload"), self.slotRemoveDownload) self.connect(self.mainWindow, SIGNAL("addContainer"), self.slotAddContainer) + self.connect(self.mainWindow, SIGNAL("stopAllDownloads"), self.slotStopAllDownloads) def slotShowConnector(self): """ @@ -215,6 +216,18 @@ class main(QObject): self.mainWindow.actions["toggle_status"].setChecked(not status["pause"]) self.mainWindow.serverStatus.setText(text) + def refreshLog(self): + offset = self.mainWindow.tabs["log"]["text"].logOffset + lines = self.connector.getLog(offset) + if not lines: + return + self.mainWindow.tabs["log"]["text"].logOffset += len(lines) + for line in lines: + self.mainWindow.tabs["log"]["text"].emit(SIGNAL("append(QString)"), line) + cursor = self.mainWindow.tabs["log"]["text"].textCursor() + cursor.movePosition(QTextCursor.End, QTextCursor.MoveAnchor) + self.mainWindow.tabs["log"]["text"].setTextCursor(cursor) + def getConnections(self): """ parse all connections in the config file @@ -453,6 +466,13 @@ class main(QObject): else: self.connector.removeFile(id) + def slotStopAllDownloads(self): + """ + emitted from main window + stop all running downloads + """ + self.connector.stopAllDownloads() + class Loop(QThread): """ main loop (not application loop) @@ -473,6 +493,7 @@ class main(QObject): methods to call """ self.parent.refreshServerStatus() + self.parent.refreshLog() def stop(self): self.running = False |