From b5d1c47ac2590fe4314d7e96d58443c30463746c Mon Sep 17 00:00:00 2001 From: mkaay Date: Sat, 26 Dec 2009 22:35:20 +0100 Subject: gui contaoner upload, closes #39 --- pyLoadGui.py | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'pyLoadGui.py') diff --git a/pyLoadGui.py b/pyLoadGui.py index 5e13dd080..f075db710 100755 --- a/pyLoadGui.py +++ b/pyLoadGui.py @@ -28,6 +28,8 @@ from PyQt4.QtGui import * from uuid import uuid4 as uuid +from os.path import basename + from module.gui.ConnectionManager import * from module.gui.connector import * from module.gui.MainWindow import * @@ -109,6 +111,7 @@ class main(QObject): self.connect(self.mainWindow, SIGNAL("pushPackageToQueue"), self.slotPushPackageToQueue) self.connect(self.mainWindow, SIGNAL("restartDownload"), self.slotRestartDownload) self.connect(self.mainWindow, SIGNAL("removeDownload"), self.slotRemoveDownload) + self.connect(self.mainWindow, SIGNAL("addContainer"), self.slotAddContainer) def slotShowConnector(self): """ @@ -377,6 +380,18 @@ class main(QObject): for fileid in ids: self.connector.addFileToPackage(fileid, packid) + def slotAddContainer(self, path): + """ + emitted from main window + add container + """ + filename = basename(path) + type = "".join(filename.split(".")[-1]) + fh = open(path, "r") + content = fh.read() + fh.close() + self.connector.uploadContainer(filename, type, content) + def slotSaveMainWindow(self, state, geo): """ save the window geometry and toolbar/dock position to config file -- cgit v1.2.3