|
@ -1406,11 +1406,11 @@ class ElectrumWindow(QMainWindow): |
|
|
proxy_port.setFixedWidth(50) |
|
|
proxy_port.setFixedWidth(50) |
|
|
proxy_mode.addItems(['NONE', 'SOCKS4', 'SOCKS5', 'HTTP']) |
|
|
proxy_mode.addItems(['NONE', 'SOCKS4', 'SOCKS5', 'HTTP']) |
|
|
|
|
|
|
|
|
cfg = SimpleConfig() |
|
|
proxy_config = interface.proxy if interface.proxy else { "mode":"none", "host":"localhost", "port":"8080"} |
|
|
proxy_config = cfg.config['proxy'] |
|
|
proxy_mode.setCurrentIndex(proxy_mode.findText(str(proxy_config.get("mode").upper()))) |
|
|
proxy_mode.setCurrentIndex(proxy_mode.findText(str(proxy_config["mode"]).upper())) |
|
|
proxy_host.setText(proxy_config.get("host")) |
|
|
proxy_host.setText(proxy_config["host"]) |
|
|
proxy_port.setText(proxy_config.get("port")) |
|
|
proxy_port.setText(proxy_config["port"]) |
|
|
|
|
|
hbox.addWidget(QLabel(_('Proxy') + ':')) |
|
|
hbox.addWidget(QLabel(_('Proxy') + ':')) |
|
|
hbox.addWidget(proxy_mode) |
|
|
hbox.addWidget(proxy_mode) |
|
|
hbox.addWidget(proxy_host) |
|
|
hbox.addWidget(proxy_host) |
|
@ -1451,11 +1451,14 @@ class ElectrumWindow(QMainWindow): |
|
|
server = unicode( host_line.text() ) |
|
|
server = unicode( host_line.text() ) |
|
|
|
|
|
|
|
|
try: |
|
|
try: |
|
|
cfg.set_key("proxy", { u'mode':unicode(proxy_mode.currentText()).lower(), u'host':unicode(proxy_host.text()), u'port':unicode(proxy_port.text()) }, True) |
|
|
if proxy_mode.currentText() != 'NONE': |
|
|
if cfg.config["proxy"]["mode"] != "none": |
|
|
proxy = { u'mode':unicode(proxy_mode.currentText()).lower(), u'host':unicode(proxy_host.text()), u'port':unicode(proxy_port.text()) } |
|
|
wallet.set_server(server, cfg.config["proxy"]) |
|
|
|
|
|
else: |
|
|
else: |
|
|
wallet.set_server(server) |
|
|
proxy = None |
|
|
|
|
|
|
|
|
|
|
|
cfg = SimpleConfig() |
|
|
|
|
|
cfg.set_key("proxy", proxy, True) |
|
|
|
|
|
wallet.set_server(server, proxy) |
|
|
|
|
|
|
|
|
except Exception as err: |
|
|
except Exception as err: |
|
|
QMessageBox.information(None, _('Error'), str(err), _('OK')) |
|
|
QMessageBox.information(None, _('Error'), str(err), _('OK')) |
|
|