diff options
author | Jeix <devnull@localhost> | 2010-11-19 17:08:25 +0100 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-11-19 17:08:25 +0100 |
commit | f9b0874511f9fca0b7378c01449cc0c88c9d796e (patch) | |
tree | 1b1081f9fe169143f679aff6c30dae4b7fdaf529 /module/gui | |
parent | missing update event (diff) | |
download | pyload-f9b0874511f9fca0b7378c01449cc0c88c9d796e.tar.xz |
gui: add links to existing packages
Diffstat (limited to 'module/gui')
-rw-r--r-- | module/gui/LinkDock.py | 2 | ||||
-rw-r--r-- | module/gui/MainWindow.py | 25 |
2 files changed, 24 insertions, 3 deletions
diff --git a/module/gui/LinkDock.py b/module/gui/LinkDock.py index 99429d04b..ac2d4aae5 100644 --- a/module/gui/LinkDock.py +++ b/module/gui/LinkDock.py @@ -42,11 +42,13 @@ class NewLinkWindow(QWidget): self.setLayout(QVBoxLayout()) layout = self.layout() + explanationLabel = QLabel("Select a package and then click Add button.") boxLabel = QLabel("Paste URLs here:") self.box = QTextEdit() save = QPushButton("Add") + layout.addWidget(explanationLabel) layout.addWidget(boxLabel) layout.addWidget(self.box) layout.addWidget(save) diff --git a/module/gui/MainWindow.py b/module/gui/MainWindow.py index 95d8787ad..103dd8d7a 100644 --- a/module/gui/MainWindow.py +++ b/module/gui/MainWindow.py @@ -51,6 +51,9 @@ class MainWindow(QMainWindow): self.connect(self.newPackDock, SIGNAL("done"), self.slotAddPackage) self.captchaDock = CaptchaDock() self.addDockWidget(Qt.BottomDockWidgetArea, self.captchaDock) + self.newLinkDock = NewLinkDock() + self.addDockWidget(Qt.RightDockWidgetArea, self.newLinkDock) + self.connect(self.newLinkDock, SIGNAL("done"), self.slotAddLinksToPackage) #central widget, layout self.masterlayout = QVBoxLayout() @@ -165,10 +168,12 @@ class MainWindow(QMainWindow): packageAction = self.addMenu.addAction(_("Package")) containerAction = self.addMenu.addAction(_("Container")) accountAction = self.addMenu.addAction(_("Account")) + linksAction = self.addMenu.addAction(_("Links")) self.connect(self.actions["add"], SIGNAL("triggered()"), self.slotAdd) self.connect(packageAction, SIGNAL("triggered()"), self.slotShowAddPackage) self.connect(containerAction, SIGNAL("triggered()"), self.slotShowAddContainer) self.connect(accountAction, SIGNAL("triggered()"), self.slotNewAccount) + self.connect(linksAction, SIGNAL("triggered()"), self.slotShowAddLinks) def init_tabs(self, connector): """ @@ -326,9 +331,8 @@ class MainWindow(QMainWindow): action from add-menu show new-links dock """ - pass - #self.tabw.setCurrentIndex(1) - #self.newLinkDock.show() + self.tabw.setCurrentIndex(1) + self.newLinkDock.show() def slotShowConnector(self): """ @@ -343,6 +347,21 @@ class MainWindow(QMainWindow): let main to the stuff """ self.emit(SIGNAL("addPackage"), name, links, password) + + def slotAddLinksToPackage(self, links): + """ + adds links to currently selected package + only in collector + """ + if self.tabw.currentIndex() != 1: + return + + smodel = self.tabs["collector"]["package_view"].selectionModel() + for index in smodel.selectedRows(0): + item = index.internalPointer() + if isinstance(item, Package): + self.connector.proxy.add_files(item.id, links) + break def slotShowAddContainer(self): """ |