summaryrefslogtreecommitdiffstats
path: root/pyLoadGui.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-21 17:07:16 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-21 17:07:16 +0100
commitff7fa4a0d1aa1c09e563d2086704aa7e2acea716 (patch)
tree4024d973724e1243842477b3c26b95cf591d5847 /pyLoadGui.py
parentpause/start button works (diff)
downloadpyload-ff7fa4a0d1aa1c09e563d2086704aa7e2acea716.tar.xz
package creation works
Diffstat (limited to 'pyLoadGui.py')
-rwxr-xr-xpyLoadGui.py19
1 files changed, 19 insertions, 0 deletions
diff --git a/pyLoadGui.py b/pyLoadGui.py
index 6c3bae1dd..ccab8ba64 100755
--- a/pyLoadGui.py
+++ b/pyLoadGui.py
@@ -88,6 +88,7 @@ class main(QObject):
self.connect(self.pwWindow, SIGNAL("cancel"), self.quit)
self.connect(self.mainWindow, SIGNAL("connector"), self.slotShowConnector)
self.connect(self.mainWindow, SIGNAL("addLinks"), self.slotAddLinks)
+ self.connect(self.mainWindow, SIGNAL("addPackage"), self.slotAddPackage)
self.connect(self.mainWindow, SIGNAL("setDownloadStatus"), self.slotSetDownloadStatus)
def slotShowConnector(self):
@@ -120,6 +121,19 @@ class main(QObject):
view = self.mainWindow.tabs["collector"]["link_view"]
view.setColumnCount(1)
view.setHeaderLabels(["Name"])
+ view.setSelectionBehavior(QAbstractItemView.SelectRows)
+ view.setSelectionMode(QAbstractItemView.SingleSelection)
+ def event(klass, event):
+ event.setDropAction(Qt.CopyAction)
+ event.accept()
+ view = event.source()
+ row = view.currentIndex().row()
+ view.takeTopLevelItem(row)
+ view.dropEvent = event
+ view.setDragEnabled(True)
+ view.setDragDropMode(QAbstractItemView.DragDrop)
+ view.setDropIndicatorShown(True)
+ view.setDragDropOverwriteMode(True)
self.linkCollector = LinkCollector(view, self.connector)
self.linkCollector.start()
@@ -274,6 +288,11 @@ class main(QObject):
def slotSetDownloadStatus(self, status):
self.connector.setPause(not status)
+ def slotAddPackage(self, name, ids):
+ packid = self.connector.newPackage(str(name))
+ for fileid in ids:
+ self.connector.addFileToPackage(fileid, packid)
+
class Loop(QThread):
def __init__(self, parent):
QThread.__init__(self)