From 2adf03477109f774b92e87529b06fd3b71861c8c Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Mon, 24 Oct 2022 13:04:46 +0200 Subject: [PATCH] use apply() function on every wizard page, making sure wizard_data is always available to wizard navigation evaluation --- electrum/gui/qml/components/wizard/WCBIP39Refine.qml | 3 ++- electrum/gui/qml/components/wizard/WCCreateSeed.qml | 2 +- electrum/gui/qml/components/wizard/WCHaveMasterKey.qml | 2 +- electrum/gui/qml/components/wizard/WCImport.qml | 2 +- electrum/gui/qml/components/wizard/WCKeystoreType.qml | 2 +- electrum/gui/qml/components/wizard/WCProxyConfig.qml | 2 +- electrum/gui/qml/components/wizard/WCServerConfig.qml | 2 +- electrum/gui/qml/components/wizard/WCWalletName.qml | 2 +- electrum/gui/qml/components/wizard/WCWalletPassword.qml | 2 +- electrum/gui/qml/components/wizard/WCWalletType.qml | 2 +- 10 files changed, 11 insertions(+), 10 deletions(-) diff --git a/electrum/gui/qml/components/wizard/WCBIP39Refine.qml b/electrum/gui/qml/components/wizard/WCBIP39Refine.qml index cef0d198d..2c4dc8ef2 100644 --- a/electrum/gui/qml/components/wizard/WCBIP39Refine.qml +++ b/electrum/gui/qml/components/wizard/WCBIP39Refine.qml @@ -10,10 +10,11 @@ import "../controls" WizardComponent { valid: false - onAccept: { + function apply() { wizard_data['script_type'] = scripttypegroup.checkedButton.scripttype wizard_data['derivation_path'] = derivationpathtext.text } + function getScriptTypePurposeDict() { return { 'p2pkh': 44, diff --git a/electrum/gui/qml/components/wizard/WCCreateSeed.qml b/electrum/gui/qml/components/wizard/WCCreateSeed.qml index b7ac856b5..ee8c3ba1e 100644 --- a/electrum/gui/qml/components/wizard/WCCreateSeed.qml +++ b/electrum/gui/qml/components/wizard/WCCreateSeed.qml @@ -10,7 +10,7 @@ import "../controls" WizardComponent { valid: seedtext.text != '' - onAccept: { + function apply() { wizard_data['seed'] = seedtext.text wizard_data['seed_extend'] = extendcb.checked wizard_data['seed_extra_words'] = extendcb.checked ? customwordstext.text : '' diff --git a/electrum/gui/qml/components/wizard/WCHaveMasterKey.qml b/electrum/gui/qml/components/wizard/WCHaveMasterKey.qml index 904432fde..f97abd7f1 100644 --- a/electrum/gui/qml/components/wizard/WCHaveMasterKey.qml +++ b/electrum/gui/qml/components/wizard/WCHaveMasterKey.qml @@ -11,7 +11,7 @@ WizardComponent { valid: false - onAccept: { + function apply() { wizard_data['master_key'] = masterkey_ta.text } diff --git a/electrum/gui/qml/components/wizard/WCImport.qml b/electrum/gui/qml/components/wizard/WCImport.qml index 7f479f9ee..5158d3fd5 100644 --- a/electrum/gui/qml/components/wizard/WCImport.qml +++ b/electrum/gui/qml/components/wizard/WCImport.qml @@ -11,7 +11,7 @@ WizardComponent { valid: false - onAccept: { + function apply() { if (bitcoin.isAddressList(import_ta.text)) { wizard_data['address_list'] = import_ta.text } else if (bitcoin.isPrivateKeyList(import_ta.text)) { diff --git a/electrum/gui/qml/components/wizard/WCKeystoreType.qml b/electrum/gui/qml/components/wizard/WCKeystoreType.qml index e8837fe9d..30cb41a9d 100644 --- a/electrum/gui/qml/components/wizard/WCKeystoreType.qml +++ b/electrum/gui/qml/components/wizard/WCKeystoreType.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.1 WizardComponent { valid: keystoregroup.checkedButton !== null - onAccept: { + function apply() { wizard_data['keystore_type'] = keystoregroup.checkedButton.keystoretype } diff --git a/electrum/gui/qml/components/wizard/WCProxyConfig.qml b/electrum/gui/qml/components/wizard/WCProxyConfig.qml index ddc0fc60d..2943e1b3d 100644 --- a/electrum/gui/qml/components/wizard/WCProxyConfig.qml +++ b/electrum/gui/qml/components/wizard/WCProxyConfig.qml @@ -3,7 +3,7 @@ import "../controls" WizardComponent { valid: true - onAccept: { + function apply() { wizard_data['proxy'] = pc.toProxyDict() } diff --git a/electrum/gui/qml/components/wizard/WCServerConfig.qml b/electrum/gui/qml/components/wizard/WCServerConfig.qml index b1a3afea5..939eb1f06 100644 --- a/electrum/gui/qml/components/wizard/WCServerConfig.qml +++ b/electrum/gui/qml/components/wizard/WCServerConfig.qml @@ -4,7 +4,7 @@ WizardComponent { valid: true last: true - onAccept: { + function apply() { wizard_data['oneserver'] = !sc.auto_server wizard_data['server'] = sc.address } diff --git a/electrum/gui/qml/components/wizard/WCWalletName.qml b/electrum/gui/qml/components/wizard/WCWalletName.qml index 6f7cbf784..07d12f8bb 100644 --- a/electrum/gui/qml/components/wizard/WCWalletName.qml +++ b/electrum/gui/qml/components/wizard/WCWalletName.qml @@ -7,7 +7,7 @@ import org.electrum 1.0 WizardComponent { valid: wallet_name.text.length > 0 - onAccept: { + function apply() { wizard_data['wallet_name'] = wallet_name.text } diff --git a/electrum/gui/qml/components/wizard/WCWalletPassword.qml b/electrum/gui/qml/components/wizard/WCWalletPassword.qml index b6c55c69d..5e4921ac5 100644 --- a/electrum/gui/qml/components/wizard/WCWalletPassword.qml +++ b/electrum/gui/qml/components/wizard/WCWalletPassword.qml @@ -7,7 +7,7 @@ import "../controls" WizardComponent { valid: password1.text === password2.text && password1.text.length > 4 - onAccept: { + function apply() { wizard_data['password'] = password1.text wizard_data['encrypt'] = password1.text != '' } diff --git a/electrum/gui/qml/components/wizard/WCWalletType.qml b/electrum/gui/qml/components/wizard/WCWalletType.qml index 1c0ee0c7a..a8fc832a4 100644 --- a/electrum/gui/qml/components/wizard/WCWalletType.qml +++ b/electrum/gui/qml/components/wizard/WCWalletType.qml @@ -4,7 +4,7 @@ import QtQuick.Controls 2.1 WizardComponent { valid: wallettypegroup.checkedButton !== null - onAccept: { + function apply() { wizard_data['wallet_type'] = wallettypegroup.checkedButton.wallettype if (wizard_data['wallet_type'] == 'standard') wizard_data['seed_type'] = 'segwit'