From 19f7b0e65505541da5772073a70db97b225732c8 Mon Sep 17 00:00:00 2001 From: timemarkovqtum Date: Fri, 17 May 2024 12:56:47 +0200 Subject: [PATCH] Fix create hardware wallet checkbox --- src/qt/createwalletdialog.cpp | 27 ++++++++++++--------------- src/qt/forms/createwalletdialog.ui | 2 +- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp index e654949653..27a53af87e 100644 --- a/src/qt/createwalletdialog.cpp +++ b/src/qt/createwalletdialog.cpp @@ -50,6 +50,10 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) : }); connect(ui->external_signer_checkbox, &QCheckBox::toggled, [this](bool checked) { + ui->hardware_wallet_checkbox->blockSignals(true); + if (checked) ui->hardware_wallet_checkbox->setChecked(false); + ui->hardware_wallet_checkbox->blockSignals(false); + ui->encrypt_wallet_checkbox->setEnabled(!checked); ui->blank_wallet_checkbox->setEnabled(!checked); ui->disable_privkeys_checkbox->setEnabled(!checked); @@ -96,26 +100,19 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) : #endif connect(ui->hardware_wallet_checkbox, &QCheckBox::toggled, [this](bool checked) { #ifdef ENABLE_EXTERNAL_SIGNER - // Uncheck external signer when hardware wallet is checked - if(checked) { - ui->external_signer_checkbox->setChecked(false); - } + ui->external_signer_checkbox->blockSignals(true); + if (checked) ui->external_signer_checkbox->setChecked(false); + ui->external_signer_checkbox->blockSignals(false); #endif - // Disable and uncheck encrypt_wallet_checkbox when isHardwareWalletChecked is true, - // enable and check it if isHardwareWalletChecked is false - ui->encrypt_wallet_checkbox->setChecked(!checked); ui->encrypt_wallet_checkbox->setEnabled(!checked); + ui->blank_wallet_checkbox->setEnabled(!checked); + ui->disable_privkeys_checkbox->setEnabled(!checked); - // Disable disable_privkeys_checkbox - // and check it if isHardwareWalletChecked is true or uncheck if isHardwareWalletChecked is false - ui->disable_privkeys_checkbox->setEnabled(false); + // Toggling it restores the other options to their default. + ui->encrypt_wallet_checkbox->setChecked(false); ui->disable_privkeys_checkbox->setChecked(checked); - - // Disable and check blank_wallet_checkbox if isHardwareWalletChecked is true and - // enable and uncheck it if isHardwareWalletChecked is false - ui->blank_wallet_checkbox->setEnabled(!checked); - ui->blank_wallet_checkbox->setChecked(checked); + ui->blank_wallet_checkbox->setChecked(false); }); } diff --git a/src/qt/forms/createwalletdialog.ui b/src/qt/forms/createwalletdialog.ui index 204c479f8f..c9570e78f8 100644 --- a/src/qt/forms/createwalletdialog.ui +++ b/src/qt/forms/createwalletdialog.ui @@ -166,7 +166,7 @@ - Make a blank wallet. Blank wallets do not initially have private keys or scripts. Private keys and addresses can be imported, or an HD seed can be set, at a later time. + Use a hardware wallet device for signing. Configure the HWI tool path in main preferences first. Use a hardware device