From ff7fa4a0d1aa1c09e563d2086704aa7e2acea716 Mon Sep 17 00:00:00 2001 From: mkaay Date: Mon, 21 Dec 2009 17:07:16 +0100 Subject: package creation works --- pyLoadGui.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) (limited to 'pyLoadGui.py') 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) -- cgit v1.2.3