From a6aff1ec07c786abe6f2c481c7c591899a6a2119 Mon Sep 17 00:00:00 2001 From: Sander van Grieken Date: Tue, 1 Aug 2023 14:33:04 +0200 Subject: [PATCH] qml: check passphrase not empty when checked --- electrum/gui/qml/components/wizard/WCCreateSeed.qml | 2 +- electrum/gui/qml/components/wizard/WCHaveSeed.qml | 3 +++ .../wizard/{WCBIP39Refine.qml => WCScriptAndDerivation.qml} | 0 electrum/gui/qml/qewizard.py | 2 +- 4 files changed, 5 insertions(+), 2 deletions(-) rename electrum/gui/qml/components/wizard/{WCBIP39Refine.qml => WCScriptAndDerivation.qml} (100%) diff --git a/electrum/gui/qml/components/wizard/WCCreateSeed.qml b/electrum/gui/qml/components/wizard/WCCreateSeed.qml index ab15e26fa..83b43f2ff 100644 --- a/electrum/gui/qml/components/wizard/WCCreateSeed.qml +++ b/electrum/gui/qml/components/wizard/WCCreateSeed.qml @@ -9,7 +9,7 @@ import "../controls" WizardComponent { securePage: true - valid: seedtext.text != '' + valid: seedtext.text != '' && extendcb.checked ? customwordstext.text != '' : true function apply() { wizard_data['seed'] = seedtext.text diff --git a/electrum/gui/qml/components/wizard/WCHaveSeed.qml b/electrum/gui/qml/components/wizard/WCHaveSeed.qml index bd61daa86..86da1d924 100644 --- a/electrum/gui/qml/components/wizard/WCHaveSeed.qml +++ b/electrum/gui/qml/components/wizard/WCHaveSeed.qml @@ -68,6 +68,9 @@ WizardComponent { valid = false validationtext.text = '' + if (extendcb.checked && customwordstext.text == '') + return + var validSeed = bitcoin.verifySeed(seedtext.text, seed_variant_cb.currentValue, wizard_data['wallet_type']) if (!cosigner || !validSeed) { valid = validSeed diff --git a/electrum/gui/qml/components/wizard/WCBIP39Refine.qml b/electrum/gui/qml/components/wizard/WCScriptAndDerivation.qml similarity index 100% rename from electrum/gui/qml/components/wizard/WCBIP39Refine.qml rename to electrum/gui/qml/components/wizard/WCScriptAndDerivation.qml diff --git a/electrum/gui/qml/qewizard.py b/electrum/gui/qml/qewizard.py index 57a08cfce..5de1a9d8d 100644 --- a/electrum/gui/qml/qewizard.py +++ b/electrum/gui/qml/qewizard.py @@ -58,7 +58,7 @@ class QENewWalletWizard(NewWalletWizard, QEAbstractWizard): 'create_seed': { 'gui': 'WCCreateSeed' }, 'confirm_seed': { 'gui': 'WCConfirmSeed' }, 'have_seed': { 'gui': 'WCHaveSeed' }, - 'script_and_derivation': { 'gui': 'WCBIP39Refine' }, + 'script_and_derivation': { 'gui': 'WCScriptAndDerivation' }, 'have_master_key': { 'gui': 'WCHaveMasterKey' }, 'multisig': { 'gui': 'WCMultisig' }, 'multisig_cosigner_keystore': { 'gui': 'WCCosignerKeystore' },