summaryrefslogtreecommitdiffstats
path: root/module
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-26 22:35:20 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-26 22:35:20 +0100
commitb5d1c47ac2590fe4314d7e96d58443c30463746c (patch)
treebf35105179c5fc841edc26b86b8ed96f148f2b35 /module
parentpluginconfig now in xml (diff)
downloadpyload-b5d1c47ac2590fe4314d7e96d58443c30463746c.tar.xz
gui contaoner upload, closes #39
Diffstat (limited to 'module')
-rw-r--r--module/gui/MainWindow.py11
-rw-r--r--module/gui/connector.py13
2 files changed, 24 insertions, 0 deletions
diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py
index 53de8cd54..744518adb 100644
--- a/module/gui/MainWindow.py
+++ b/module/gui/MainWindow.py
@@ -122,9 +122,11 @@ class MainWindow(QMainWindow):
self.addMenu = QMenu()
packageAction = self.addMenu.addAction("Package")
linkAction = self.addMenu.addAction("Links")
+ containerAction = self.addMenu.addAction("Container")
self.connect(self.actions["add"], SIGNAL("triggered()"), self.slotAdd)
self.connect(packageAction, SIGNAL("triggered()"), self.slotShowAddPackage)
self.connect(linkAction, SIGNAL("triggered()"), self.slotShowAddLinks)
+ self.connect(containerAction, SIGNAL("triggered()"), self.slotShowAddContainer)
def init_tabs(self):
"""
@@ -230,6 +232,15 @@ class MainWindow(QMainWindow):
"""
self.emit(SIGNAL("addPackage"), name, ids)
+ def slotShowAddContainer(self):
+ """
+ action from add-menu
+ show file selector, emit upload
+ """
+ fileNames = QFileDialog.getOpenFileNames(self, "Container Öffnen", "", "All Container Types (*.dlc *.ccf *.rsdf *.txt);;DLC (*.dlc);;CCF (*.ccf);;RSDF (*.rsdf);;Text Files (*.txt)")
+ for name in fileNames:
+ self.emit(SIGNAL("addContainer"), str(name))
+
def slotPushPackageToQueue(self):
"""
push collector pack to queue
diff --git a/module/gui/connector.py b/module/gui/connector.py
index 4ac635200..e52cf42ff 100644
--- a/module/gui/connector.py
+++ b/module/gui/connector.py
@@ -304,3 +304,16 @@ class connector(QThread):
self.emit(SIGNAL("proxy_error"), "removeFile")
finally:
self.mutex.unlock()
+
+ def uploadContainer(self, filename, type, content):
+ """
+ upload a container
+ """
+ self.mutex.lock()
+ try:
+ self.proxy.upload_container(filename, type, content)
+ except:
+ self.emit(SIGNAL("proxy_error"), "uploadContainer")
+ finally:
+ self.mutex.unlock()
+