Commit a914136c authored by Philipp Hörist's avatar Philipp Hörist

AccountWizard: Don't forget proxy and custom host settings

parent d1d5dd34
Pipeline #5237 failed with stages
in 1 minute and 39 seconds
......@@ -282,10 +282,16 @@ class AccountWizard(Assistant):
def _on_login_successful(self, client, _signal_name):
account = self._generate_account_name(client.domain)
proxy_name = None
if client.proxy is not None:
proxy_name = self.get_page('advanced').get_proxy()
app.interface.create_account(account,
client.username,
client.domain,
client.password)
client.password,
proxy_name,
client.custom_host)
self.get_page('success').set_account(account)
self.show_page('success', Gtk.StackTransitionType.SLIDE_LEFT)
......@@ -399,10 +405,17 @@ class AccountWizard(Assistant):
username, password = self.get_page('form').get_credentials()
account = self._generate_account_name(self._client.domain)
proxy_name = None
if self._client.proxy is not None:
proxy_name = self.get_page('advanced').get_proxy()
app.interface.create_account(account,
username,
self._client.domain,
password)
password,
proxy_name,
self._client.custom_host)
self.get_page('success').set_account(account)
self.show_page('success', Gtk.StackTransitionType.SLIDE_LEFT)
......
......@@ -1653,6 +1653,8 @@ class Interface:
username,
domain,
password,
proxy_name,
custom_host,
anonymous=False):
if not account or not username or not domain:
......@@ -1671,10 +1673,17 @@ class Interface:
config['anonymous_auth'] = anonymous
config['autoconnect'] = True
config['sync_with_global_status'] = True
config['proxy'] = ''
config['use_custom_host'] = False
config['custom_port'] = 0
config['custom_host'] = ''
if proxy_name is not None:
config['proxy'] = proxy_name
use_custom_host = custom_host is not None
config['use_custom_host'] = use_custom_host
if custom_host:
host, _protocol, type_ = custom_host
host, port = host.split(':')
config['custom_port'] = int(port)
config['custom_host'] = host
app.config.add_per('accounts', account)
for opt in config:
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment