add missing accept handler for welcome page
This commit is contained in:
@@ -12,9 +12,11 @@ WizardComponent {
|
|||||||
|
|
||||||
function apply() {
|
function apply() {
|
||||||
wizard_data['use_defaults'] = use_defaults.checked
|
wizard_data['use_defaults'] = use_defaults.checked
|
||||||
|
wizard_data['want_proxy'] = false
|
||||||
if (use_defaults.checked) {
|
if (use_defaults.checked) {
|
||||||
wizard_data['autoconnect'] = true
|
wizard_data['autoconnect'] = true
|
||||||
wizard_data['want_proxy'] = false
|
} else {
|
||||||
|
wizard_data['autoconnect'] = undefined
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -66,9 +66,11 @@ class WCWelcome(WizardComponent):
|
|||||||
|
|
||||||
def apply(self):
|
def apply(self):
|
||||||
self.wizard_data['use_defaults'] = self.use_defaults_w.isChecked()
|
self.wizard_data['use_defaults'] = self.use_defaults_w.isChecked()
|
||||||
|
self.wizard_data['want_proxy'] = False
|
||||||
if self.use_defaults_w.isChecked():
|
if self.use_defaults_w.isChecked():
|
||||||
self.wizard_data['autoconnect'] = True
|
self.wizard_data['autoconnect'] = True
|
||||||
self.wizard_data['want_proxy'] = False
|
else:
|
||||||
|
self.wizard_data['autoconnect'] = None
|
||||||
|
|
||||||
|
|
||||||
class WCAutoConnect(WizardComponent):
|
class WCAutoConnect(WizardComponent):
|
||||||
|
|||||||
@@ -656,6 +656,7 @@ class ServerConnectWizard(AbstractWizard):
|
|||||||
self.navmap = {
|
self.navmap = {
|
||||||
'welcome': {
|
'welcome': {
|
||||||
'next': 'proxy_ask',
|
'next': 'proxy_ask',
|
||||||
|
'accept': self.do_configure_autoconnect,
|
||||||
'last': lambda d: d['use_defaults']
|
'last': lambda d: d['use_defaults']
|
||||||
},
|
},
|
||||||
'proxy_ask': {
|
'proxy_ask': {
|
||||||
@@ -704,7 +705,8 @@ class ServerConnectWizard(AbstractWizard):
|
|||||||
def do_configure_autoconnect(self, wizard_data: dict):
|
def do_configure_autoconnect(self, wizard_data: dict):
|
||||||
self._logger.debug(f'configuring autoconnect: {wizard_data!r}')
|
self._logger.debug(f'configuring autoconnect: {wizard_data!r}')
|
||||||
if self._daemon.config.cv.NETWORK_AUTO_CONNECT.is_modifiable():
|
if self._daemon.config.cv.NETWORK_AUTO_CONNECT.is_modifiable():
|
||||||
self._daemon.config.NETWORK_AUTO_CONNECT = wizard_data['autoconnect']
|
if autoconnect := wizard_data.get('autoconnect') is not None:
|
||||||
|
self._daemon.config.NETWORK_AUTO_CONNECT = autoconnect
|
||||||
|
|
||||||
def start(self, initial_data: dict = None) -> WizardViewState:
|
def start(self, initial_data: dict = None) -> WizardViewState:
|
||||||
if initial_data is None:
|
if initial_data is None:
|
||||||
|
|||||||
Reference in New Issue
Block a user