diff options
author | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-04 22:09:00 +0200 |
---|---|---|
committer | RaNaN <Mast3rRaNaN@hotmail.de> | 2010-09-04 22:09:00 +0200 |
commit | c62e04da03e34c9a0ee16c3f47e9f86209a1eb65 (patch) | |
tree | 231133520a0b3dcdc0b5276df0e5e841ba392a0c /module | |
parent | netload fix (diff) | |
download | pyload-c62e04da03e34c9a0ee16c3f47e9f86209a1eb65.tar.xz |
internal core feature
Diffstat (limited to 'module')
-rw-r--r-- | module/gui/ConnectionManager.py | 15 | ||||
-rw-r--r-- | module/gui/connector.py | 9 |
2 files changed, 18 insertions, 6 deletions
diff --git a/module/gui/ConnectionManager.py b/module/gui/ConnectionManager.py index d96916338..2a63698a0 100644 --- a/module/gui/ConnectionManager.py +++ b/module/gui/ConnectionManager.py @@ -126,10 +126,14 @@ class ConnectionManager(QWidget): self.emit(SIGNAL("removeConnection"), data) def slotConnect(self): - item = self.connList.currentItem() - data = item.data(Qt.UserRole).toPyObject() - data = self.cleanDict(data) - self.emit(SIGNAL("connect"), data) + if self.internal.checkState() == 2: + data = {"type": "internal"} + self.emit(SIGNAL("connect"), data) + else: + item = self.connList.currentItem() + data = item.data(Qt.UserRole).toPyObject() + data = self.cleanDict(data) + self.emit(SIGNAL("connect"), data) def cleanDict(self, data): tmp = {} @@ -154,7 +158,8 @@ class ConnectionManager(QWidget): self.setDefault(data, False) def slotInternal(self): - self.connList.clearSelection() + if self.internal.checkState() == 2: + self.connList.clearSelection() def setDefault(self, data, state): data = self.cleanDict(data) diff --git a/module/gui/connector.py b/module/gui/connector.py index 975e1ca1b..28bfaacc4 100644 --- a/module/gui/connector.py +++ b/module/gui/connector.py @@ -46,7 +46,14 @@ class Connector(QThread): self.mutex.unlock() def connectProxy(self): - self.proxy = DispatchRPC(self.mutex, ServerProxy(self.addr, allow_none=True, verbose=False)) + if isinstance(self.addr, tuple): + while not hasattr(self.addr[1], "server_methods"): + sleep(1) + + self.proxy = DispatchRPC(self.mutex, self.addr[1].server_methods) + else: + self.proxy = DispatchRPC(self.mutex, ServerProxy(self.addr, allow_none=True, verbose=False)) + self.connect(self.proxy, SIGNAL("proxy_error"), self._proxyError) self.connect(self.proxy, SIGNAL("connectionLost"), self, SIGNAL("connectionLost")) try: |