summaryrefslogtreecommitdiffstats
path: root/pyLoadGui.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-28 20:44:49 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-28 20:44:49 +0100
commitc225a31e70e85c6e400a7ed4407a1fa53de29689 (patch)
tree94d3d610b719b997c2c851917a2b3e8a04231fcc /pyLoadGui.py
parentfixed webserver bug (thx nCID) (diff)
downloadpyload-c225a31e70e85c6e400a7ed4407a1fa53de29689.tar.xz
you can now drop single links directly into a package
Diffstat (limited to 'pyLoadGui.py')
-rwxr-xr-xpyLoadGui.py17
1 files changed, 16 insertions, 1 deletions
diff --git a/pyLoadGui.py b/pyLoadGui.py
index 5ce098fa0..7ef267fcb 100755
--- a/pyLoadGui.py
+++ b/pyLoadGui.py
@@ -166,7 +166,15 @@ class main(QObject):
event.accept()
view = event.source()
if view == klass:
- event.ignore()
+ items = view.selectedItems()
+ for item in items:
+ if not hasattr(item.parent(), "getPackData"):
+ continue
+ target = view.itemAt(event.pos())
+ if not hasattr(target, "getPackData"):
+ target = target.parent()
+ klass.emit(SIGNAL("droppedToPack"), target.getPackData()["id"], item.getFileData()["id"])
+ event.accept()
return
items = view.selectedItems()
for item in items:
@@ -192,6 +200,7 @@ class main(QObject):
view.setDragDropMode(QAbstractItemView.DragDrop)
view.setDropIndicatorShown(True)
view.setDragDropOverwriteMode(True)
+ self.connect(view, SIGNAL("droppedToPack"), self.slotAddFileToPackage)
self.packageCollector = PackageCollector(view, self.connector)
self.packageCollector.start()
@@ -427,6 +436,12 @@ class main(QObject):
self.connector.addFileToPackage(fileid, packid)
self.mainWindow.lastAddedID = packid
+ def slotAddFileToPackage(self, pid, fid):
+ """
+ emitted from collector view after a drop action
+ """
+ self.connector.addFileToPackage(fid, pid)
+
def slotAddContainer(self, path):
"""
emitted from main window