diff options
-rw-r--r-- | module/gui/ConnectionManager.py | 37 | ||||
-rwxr-xr-x | pyLoadCore.py | 4 |
2 files changed, 36 insertions, 5 deletions
diff --git a/module/gui/ConnectionManager.py b/module/gui/ConnectionManager.py index d0050e69d..d96916338 100644 --- a/module/gui/ConnectionManager.py +++ b/module/gui/ConnectionManager.py @@ -39,8 +39,32 @@ class ConnectionManager(QWidget): edit = QPushButton(_("Edit")) remove = QPushButton(_("Remove")) connect = QPushButton(_("Connect")) - - mainLayout.addWidget(connList) + + #box = QFrame() + boxLayout = QVBoxLayout() + #box.setLayout(boxLayout) + + boxLayout.addWidget(QLabel(_("Connect:"))) + boxLayout.addWidget(connList) + + line = QFrame() + #line.setFixedWidth(100) + line.setFrameShape(line.HLine) + line.setFrameShadow(line.Sunken) + + boxLayout.addWidget(line) + + form = QFormLayout() + form.setMargin(5) + form.setSpacing(20) + + form.setAlignment(Qt.AlignRight) + checkbox = QCheckBox() + form.addRow(_("Use internal Core"), checkbox) + + boxLayout.addLayout(form) + + mainLayout.addLayout(boxLayout) mainLayout.addLayout(buttonLayout) buttonLayout.addWidget(new) @@ -50,7 +74,8 @@ class ConnectionManager(QWidget): buttonLayout.addWidget(connect) self.setLayout(mainLayout) - + + self.internal = checkbox self.new = new self.connectb = connect self.remove = remove @@ -69,6 +94,7 @@ class ConnectionManager(QWidget): self.connect(self.connectb, SIGNAL("clicked()"), self.slotConnect) self.connect(self.edit, SIGNAL("save"), self.slotSave) self.connect(self.connList, SIGNAL("itemDoubleClicked(QListWidgetItem *)"), self.slotItemDoubleClicked) + self.connect(self.internal, SIGNAL("clicked()"), self.slotInternal) def setConnections(self, connections): self.connList.clear() @@ -126,6 +152,9 @@ class ConnectionManager(QWidget): if self.cleanDict(data)["id"] == did: continue self.setDefault(data, False) + + def slotInternal(self): + self.connList.clearSelection() def setDefault(self, data, state): data = self.cleanDict(data) @@ -198,6 +227,8 @@ class ConnectionManager(QWidget): self.default = None def setData(self, data): + if not data: return + self.id = data["id"] self.default = data["default"] self.controls["name"].setText(data["name"]) diff --git a/pyLoadCore.py b/pyLoadCore.py index 5d28c534e..073cab191 100755 --- a/pyLoadCore.py +++ b/pyLoadCore.py @@ -258,7 +258,7 @@ class Core(object): f = open(link_file, "rb") links = [x.strip() for x in f.readlines() if x.strip()] if links: - self.server_methods.add_package("links.txt", links) + self.server_methods.add_package("links.txt", links, 1) f.close() try: f = open(link_file, "wb") @@ -271,7 +271,7 @@ class Core(object): f = open(link_file, "rb") links = [x.strip() for x in f.readlines() if x.strip()] if links: - self.server_methods.add_package("links.txt", links) + self.server_methods.add_package("links.txt", links, 1) f.close() f = open(link_file, "wb") f.close() |