diff options
author | Jeix <devnull@localhost> | 2010-11-19 14:15:17 +0100 |
---|---|---|
committer | Jeix <devnull@localhost> | 2010-11-19 14:15:17 +0100 |
commit | c881b83f107e3c5b28bfcc06508d4db128d37e20 (patch) | |
tree | fd3a463b0f5bf3ee45fdfa30db4270609c78dbf3 /module/gui/PackageDock.py | |
parent | closed #153 (diff) | |
download | pyload-c881b83f107e3c5b28bfcc06508d4db128d37e20.tar.xz |
sharecx fix and gui package edit
Diffstat (limited to 'module/gui/PackageDock.py')
-rw-r--r-- | module/gui/PackageDock.py | 39 |
1 files changed, 32 insertions, 7 deletions
diff --git a/module/gui/PackageDock.py b/module/gui/PackageDock.py index 8bd965f16..e29c624a2 100644 --- a/module/gui/PackageDock.py +++ b/module/gui/PackageDock.py @@ -27,18 +27,38 @@ class NewPackageDock(QDockWidget): self.setWidget(self.widget) self.setAllowedAreas(Qt.RightDockWidgetArea|Qt.LeftDockWidgetArea) self.hide() + + self.currentPackId = None + + def fillWithPackage(self, packData=None): + if not packData: + self.widget.nameInput.setText("") + self.widget.passwordInput.setText("") + self.widget.box.clear() + self.currentPackId = None + return + + self.widget.box.setPlainText("\n".join(packData["links"])) + self.widget.nameInput.setText(packData["name"]) + self.widget.passwordInput.setText(packData["password"]) + self.currentPackId = packData["id"] def slotDone(self): text = str(self.widget.box.toPlainText()) + pw = str(self.widget.passwordInput.text()) + if not pw: + pw = None lines = [] for line in text.splitlines(): line = line.strip() if not line: continue lines.append(line) - self.emit(SIGNAL("done"), str(self.widget.nameInput.text()), lines) - self.widget.nameInput.setText("") - self.widget.box.clear() + self.emit(SIGNAL("done"), str(self.widget.nameInput.text()), lines, pw, self.currentPackId) + # self.widget.nameInput.setText("") + # self.widget.passwordInput.setText("") + # self.widget.box.clear() + #self.currentPackId = None self.hide() class NewPackageWindow(QWidget): @@ -50,18 +70,23 @@ class NewPackageWindow(QWidget): nameLabel = QLabel(_("Name")) nameInput = QLineEdit() + passwordLabel = QLabel(_("Password")) + passwordInput = QLineEdit() linksLabel = QLabel(_("Links in this Package")) self.box = QTextEdit() self.nameInput = nameInput + self.passwordInput = passwordInput - save = QPushButton(_("Create")) + save = QPushButton(_("Save")) layout.addWidget(nameLabel, 0, 0) layout.addWidget(nameInput, 0, 1) - layout.addWidget(linksLabel, 1, 0, 1, 2) - layout.addWidget(self.box, 2, 0, 1, 2) - layout.addWidget(save, 3, 0, 1, 2) + layout.addWidget(passwordLabel, 1, 0) + layout.addWidget(passwordInput, 1, 1) + layout.addWidget(linksLabel, 2, 0, 1, 2) + layout.addWidget(self.box, 3, 0, 1, 2) + layout.addWidget(save, 4, 0, 1, 2) self.connect(save, SIGNAL("clicked()"), self.dock.slotDone) |