summaryrefslogtreecommitdiffstats
path: root/pyLoadGui.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-23 00:04:36 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-23 00:04:36 +0100
commita5ff0482ede8bd7bd932482887f2f7cdae5039d9 (patch)
tree0d59800acd09c72ddb9c1e360d6a9c065cf184b7 /pyLoadGui.py
parentmore docstrings, small design changes (diff)
downloadpyload-a5ff0482ede8bd7bd932482887f2f7cdae5039d9.tar.xz
core: downloadlimit is not far away ;) gui: restart download action
Diffstat (limited to 'pyLoadGui.py')
-rwxr-xr-xpyLoadGui.py16
1 files changed, 14 insertions, 2 deletions
diff --git a/pyLoadGui.py b/pyLoadGui.py
index 9ff070027..997a2f781 100755
--- a/pyLoadGui.py
+++ b/pyLoadGui.py
@@ -107,6 +107,7 @@ class main(QObject):
self.connect(self.mainWindow, SIGNAL("setDownloadStatus"), self.slotSetDownloadStatus)
self.connect(self.mainWindow, SIGNAL("saveMainWindow"), self.slotSaveMainWindow)
self.connect(self.mainWindow, SIGNAL("pushPackageToQueue"), self.slotPushPackageToQueue)
+ self.connect(self.mainWindow, SIGNAL("restartDownload"), self.slotRestartDownload)
def slotShowConnector(self):
"""
@@ -380,7 +381,8 @@ class main(QObject):
"""
mainWindowNode = self.parser.xml.elementsByTagName("mainWindow").item(0)
if mainWindowNode.isNull():
- raise Exception("null")
+ mainWindowNode = self.parser.xml.createElement("mainWindow")
+ self.parser.root.appendChild(mainWindowNode)
stateNode = mainWindowNode.toElement().elementsByTagName("state").item(0)
geoNode = mainWindowNode.toElement().elementsByTagName("geometry").item(0)
newStateNode = self.parser.xml.createTextNode(state)
@@ -399,7 +401,7 @@ class main(QObject):
"""
mainWindowNode = self.parser.xml.elementsByTagName("mainWindow").item(0)
if mainWindowNode.isNull():
- raise Exception("null")
+ return
nodes = self.parser.parseNode(mainWindowNode, "dict")
state = str(nodes["state"].text())
@@ -414,6 +416,16 @@ class main(QObject):
"""
self.connector.pushPackageToQueue(id)
+ def slotRestartDownload(self, id, isPack):
+ """
+ emitted from main window
+ restart download
+ """
+ if isPack:
+ self.connector.restartPackage(id)
+ else:
+ self.connector.restartFile(id)
+
class Loop(QThread):
"""
main loop (not application loop)