diff --git a/lib/gui_qt.py b/lib/gui_qt.py index 1be3f86b..9ed25d25 100644 --- a/lib/gui_qt.py +++ b/lib/gui_qt.py @@ -1791,6 +1791,12 @@ class ElectrumWindow(QMainWindow): if not wallet.config.is_modifiable('server'): for w in [server_host, server_port, server_protocol, servers_list_widget]: w.setEnabled(False) + # auto cycle + autocycle_cb = QCheckBox('Try random servers if disconnected') + autocycle_cb.setChecked(wallet.config.get('auto_cycle', False)) + grid.addWidget(autocycle_cb, 3, 1, 3, 2) + if not wallet.config.is_modifiable('auto_cycle'): autocycle_cb.setEnabled(False) + # proxy setting proxy_mode = QComboBox() proxy_host = QLineEdit() @@ -1838,7 +1844,7 @@ class ElectrumWindow(QMainWindow): wallet.config.set_key("proxy", proxy, True) wallet.config.set_key("server", server, True) interface.set_server(server, proxy) - + wallet.config.set_key('auto_cycle', autocycle_cb.isChecked(), True) return True def closeEvent(self, event): diff --git a/lib/interface.py b/lib/interface.py index 9caa88d3..c79762b0 100644 --- a/lib/interface.py +++ b/lib/interface.py @@ -382,9 +382,12 @@ class Interface(threading.Thread): def init_interface(self): if self.config.get('server'): self.init_with_server(self.config) + else: + if self.config.get('auto_cycle') is None: + self.config.set_key('auto_cycle', True, False) - if not self.is_connected: - print "Using random server..." + if not self.is_connected and self.config.get('auto_cycle'): + print_msg("Using random server...") servers = DEFAULT_SERVERS[:] while servers: server = random.choice( servers )