fix: (QT network dialog) don't keep resetting proxy settings
This commit is contained in:
parent
f6cc37d1d2
commit
404584bfe6
|
@ -316,6 +316,8 @@ class NetworkChoiceLayout(object):
|
||||||
self.td = td = TorDetector()
|
self.td = td = TorDetector()
|
||||||
td.found_proxy.connect(self.suggest_proxy)
|
td.found_proxy.connect(self.suggest_proxy)
|
||||||
td.start()
|
td.start()
|
||||||
|
|
||||||
|
self.fill_in_proxy_settings()
|
||||||
self.update()
|
self.update()
|
||||||
|
|
||||||
def check_disable_proxy(self, b):
|
def check_disable_proxy(self, b):
|
||||||
|
@ -352,17 +354,6 @@ class NetworkChoiceLayout(object):
|
||||||
self.servers_list.update(self.servers, self.protocol, self.tor_cb.isChecked())
|
self.servers_list.update(self.servers, self.protocol, self.tor_cb.isChecked())
|
||||||
self.enable_set_server()
|
self.enable_set_server()
|
||||||
|
|
||||||
# proxy tab
|
|
||||||
b = proxy_config.get('mode') != "none"
|
|
||||||
self.check_disable_proxy(b)
|
|
||||||
if b:
|
|
||||||
self.proxy_cb.setChecked(True)
|
|
||||||
self.proxy_mode.setCurrentIndex(self.proxy_mode.findText(str(proxy_config.get("mode").upper())))
|
|
||||||
self.proxy_host.setText(proxy_config.get("host"))
|
|
||||||
self.proxy_port.setText(proxy_config.get("port"))
|
|
||||||
self.proxy_user.setText(proxy_config.get("user", ""))
|
|
||||||
self.proxy_password.setText(proxy_config.get("password", ""))
|
|
||||||
|
|
||||||
height_str = "%d "%(self.network.get_local_height()) + _('blocks')
|
height_str = "%d "%(self.network.get_local_height()) + _('blocks')
|
||||||
self.height_label.setText(height_str)
|
self.height_label.setText(height_str)
|
||||||
n = len(self.network.get_interfaces())
|
n = len(self.network.get_interfaces())
|
||||||
|
@ -381,6 +372,23 @@ class NetworkChoiceLayout(object):
|
||||||
self.split_label.setText(msg)
|
self.split_label.setText(msg)
|
||||||
self.nodes_list_widget.update(self.network)
|
self.nodes_list_widget.update(self.network)
|
||||||
|
|
||||||
|
def fill_in_proxy_settings(self):
|
||||||
|
host, port, protocol, proxy_config, auto_connect = self.network.get_parameters()
|
||||||
|
if not proxy_config:
|
||||||
|
proxy_config = {"mode": "none", "host": "localhost", "port": "9050"}
|
||||||
|
|
||||||
|
b = proxy_config.get('mode') != "none"
|
||||||
|
self.check_disable_proxy(b)
|
||||||
|
if b:
|
||||||
|
self.proxy_cb.setChecked(True)
|
||||||
|
self.proxy_mode.setCurrentIndex(
|
||||||
|
self.proxy_mode.findText(str(proxy_config.get("mode").upper())))
|
||||||
|
|
||||||
|
self.proxy_host.setText(proxy_config.get("host"))
|
||||||
|
self.proxy_port.setText(proxy_config.get("port"))
|
||||||
|
self.proxy_user.setText(proxy_config.get("user", ""))
|
||||||
|
self.proxy_password.setText(proxy_config.get("password", ""))
|
||||||
|
|
||||||
def layout(self):
|
def layout(self):
|
||||||
return self.layout_
|
return self.layout_
|
||||||
|
|
||||||
|
@ -482,6 +490,7 @@ class NetworkChoiceLayout(object):
|
||||||
self.proxy_password.setText("")
|
self.proxy_password.setText("")
|
||||||
self.tor_cb.setChecked(True)
|
self.tor_cb.setChecked(True)
|
||||||
self.proxy_cb.setChecked(True)
|
self.proxy_cb.setChecked(True)
|
||||||
|
self.check_disable_proxy(use_it)
|
||||||
self.set_proxy()
|
self.set_proxy()
|
||||||
|
|
||||||
def proxy_settings_changed(self):
|
def proxy_settings_changed(self):
|
||||||
|
|
Loading…
Reference in New Issue