summaryrefslogtreecommitdiffstats
path: root/pyLoadGui.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-27 14:45:22 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-27 14:45:22 +0100
commit757f025247d77b085b6168d5f625d2bbfa7c4c0d (patch)
tree5458f45d3c45d6e7da4945a376df8433ccf1e5bf /pyLoadGui.py
parentFixed reconnect loop (easy doing) (diff)
downloadpyload-757f025247d77b085b6168d5f625d2bbfa7c4c0d.tar.xz
stop button works, closes #59
Diffstat (limited to 'pyLoadGui.py')
-rwxr-xr-xpyLoadGui.py21
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