1
0

qml: show option for single server in ServerConfig

This commit is contained in:
Sander van Grieken
2024-10-10 10:05:38 +02:00
parent 8396a22286
commit 1dfe2ccec0
6 changed files with 40 additions and 2 deletions

View File

@@ -745,6 +745,7 @@ class ServerConnectWizard(AbstractWizard):
self._logger.debug(f'configuring server: {wizard_data!r}')
net_params = self._daemon.network.get_parameters()
server = ''
oneserver = wizard_data.get('one_server', False)
if not wizard_data['autoconnect']:
try:
server = ServerAddr.from_str_with_inference(wizard_data['server'])
@@ -752,7 +753,9 @@ class ServerConnectWizard(AbstractWizard):
raise Exception('failed to parse server %s' % wizard_data['server'])
except Exception:
return
net_params = net_params._replace(server=server, auto_connect=wizard_data['autoconnect'])
else:
oneserver = False
net_params = net_params._replace(server=server, auto_connect=wizard_data['autoconnect'], oneserver=oneserver)
self._daemon.network.run_from_another_thread(self._daemon.network.set_parameters(net_params))
def do_configure_autoconnect(self, wizard_data: dict):