commit 7b0903d81c37bca3bc7e78c2e61442d868c1bf49
parent 271a27fc83121e206631ebac95490973f6e96adb
Author: ThomasV <thomasv@gitorious>
Date: Fri, 6 Feb 2015 07:37:09 +0100
fix #1010 and cleanup
Diffstat:
1 file changed, 4 insertions(+), 10 deletions(-)
diff --git a/gui/qt/network_dialog.py b/gui/qt/network_dialog.py
@@ -201,9 +201,12 @@ class NetworkDialog(QDialog):
def change_server(self, host, protocol):
pp = self.servers.get(host, DEFAULT_PORTS)
+ if protocol and protocol not in protocol_letters:
+ protocol = None
if protocol:
port = pp.get(protocol)
- if not port: protocol = None
+ if port is None:
+ protocol = None
if not protocol:
if 's' in pp.keys():
@@ -217,15 +220,6 @@ class NetworkDialog(QDialog):
self.server_port.setText( port )
self.server_protocol.setCurrentIndex(protocol_letters.index(protocol))
- if not self.servers: return
- for p in protocol_letters:
- i = protocol_letters.index(p)
- j = self.server_protocol.model().index(i,0)
- #if p not in pp.keys(): # and self.interface.is_connected:
- # self.server_protocol.model().setData(j, QVariant(0), Qt.UserRole-1)
- #else:
- # self.server_protocol.model().setData(j, QVariant(33), Qt.UserRole-1)
-
def do_exec(self):