summaryrefslogtreecommitdiffstats
path: root/pyLoadGui.py
diff options
context:
space:
mode:
authorGravatar mkaay <mkaay@mkaay.de> 2009-12-17 22:10:29 +0100
committerGravatar mkaay <mkaay@mkaay.de> 2009-12-17 22:10:29 +0100
commit56580326ede51efe9369858636b97dadbff52a5c (patch)
treebbbfb436f98d4327381825b4c02e1b5bea6fbc33 /pyLoadGui.py
parentfixed with statement (python2.5) (diff)
downloadpyload-56580326ede51efe9369858636b97dadbff52a5c.tar.xz
GUI: local connection support
Diffstat (limited to 'pyLoadGui.py')
-rw-r--r--pyLoadGui.py30
1 files changed, 20 insertions, 10 deletions
diff --git a/pyLoadGui.py b/pyLoadGui.py
index 3b8658e1b..c213b4fa7 100644
--- a/pyLoadGui.py
+++ b/pyLoadGui.py
@@ -246,22 +246,32 @@ class main(QObject):
self.connData = data
if data["type"] == "local":
self.slotPasswordTyped("")
- self.pwWindow.show()
+ else:
+ self.pwWindow.show()
def slotPasswordTyped(self, pw):
data = self.connData
data["password"] = pw
- if data["type"] == "remote":
- if data["ssl"]:
- data["ssl"] = "s"
+ if not data["type"] == "remote":
+ coreparser = XMLParser("module/config/core.xml")
+ sections = coreparser.parseNode(coreparser.root, "dict")
+ conf = coreparser.parseNode(sections["remote"], "dict")
+ ssl = coreparser.parseNode(sections["ssl"], "dict")
+ data["port"] = conf["port"].text()
+ data["user"] = conf["username"].text()
+ data["password"] = conf["password"].text()
+ data["host"] = "127.0.0.1"
+ if str(ssl["activated"].text()).lower() == "true":
+ data["ssl"] = True
else:
- data["ssl"] = ""
- server_url = "http%(ssl)s://%(user)s:%(password)s@%(host)s:%(port)s/" % data
- self.connector.setAddr(server_url)
- self.startMain()
+ data["ssl"] = False
+ if data["ssl"]:
+ data["ssl"] = "s"
else:
- print "comming soon ;)"
- self.quit()
+ data["ssl"] = ""
+ server_url = "http%(ssl)s://%(user)s:%(password)s@%(host)s:%(port)s/" % data
+ self.connector.setAddr(server_url)
+ self.startMain()
def refreshConnections(self):
self.parser.loadData()