diff options
author | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-08-06 19:14:51 +0300 |
---|---|---|
committer | Hennadii Stepanov <32963518+hebasto@users.noreply.github.com> | 2021-08-06 19:17:09 +0300 |
commit | 03826aecc56c5c5c76570805897c2ddf92e11ab6 (patch) | |
tree | 34734f08d955a64707a981a2a7736b9e690af2a5 /src/qt | |
parent | 7ebc4c668968da084d7258b32c5f3b2aceefc232 (diff) | |
parent | a9b9ca82daefc77ee3c884d3f250460d7cf734a5 (diff) |
Merge bitcoin-core/gui#396: Ensure external signer option remains disabled without signers
a9b9ca82daefc77ee3c884d3f250460d7cf734a5 gui: ensure external signer option remains disabled without signers (Andrew Chow)
Pull request description:
When no external signers are available, the option to enable external signers should always be disabled. However the encrypt wallet checkbox can erroneously re-enable the external signer checkbox. To avoid this, CreateWalletDialog now stores whether signers were available during setSigners so that future calls to external_signer_checkbox->setEnabled can account for whether signers are available.
Fixes #395
ACKs for top commit:
hebasto:
ACK a9b9ca82daefc77ee3c884d3f250460d7cf734a5, tested on Linux Mint 20.2 (Qt 5.12.8).
Sjors:
tACK a9b9ca82daefc77ee3c884d3f250460d7cf734a5
jarolrod:
ACK a9b9ca82daefc77ee3c884d3f250460d7cf734a5
Tree-SHA512: 98951bcadc23fce99a66ea2d367c44360989e888c253845a767e1f7085c594562d0f099de4130f4a078c5072aa7806294097d976ee6407291f3d3c5a4a608b44
Diffstat (limited to 'src/qt')
-rw-r--r-- | src/qt/createwalletdialog.cpp | 5 | ||||
-rw-r--r-- | src/qt/createwalletdialog.h | 1 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp index dc24bbc6a6..f9a61c3e60 100644 --- a/src/qt/createwalletdialog.cpp +++ b/src/qt/createwalletdialog.cpp @@ -32,7 +32,7 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) : // set to true, enable it when isEncryptWalletChecked is false. ui->disable_privkeys_checkbox->setEnabled(!checked); #ifdef ENABLE_EXTERNAL_SIGNER - ui->external_signer_checkbox->setEnabled(!checked); + ui->external_signer_checkbox->setEnabled(m_has_signers && !checked); #endif // When the disable_privkeys_checkbox is disabled, uncheck it. if (!ui->disable_privkeys_checkbox->isEnabled()) { @@ -115,7 +115,8 @@ CreateWalletDialog::~CreateWalletDialog() void CreateWalletDialog::setSigners(const std::vector<ExternalSigner>& signers) { - if (!signers.empty()) { + m_has_signers = !signers.empty(); + if (m_has_signers) { ui->external_signer_checkbox->setEnabled(true); ui->external_signer_checkbox->setChecked(true); ui->encrypt_wallet_checkbox->setEnabled(false); diff --git a/src/qt/createwalletdialog.h b/src/qt/createwalletdialog.h index 25ddf97585..fc13cc44eb 100644 --- a/src/qt/createwalletdialog.h +++ b/src/qt/createwalletdialog.h @@ -35,6 +35,7 @@ public: private: Ui::CreateWalletDialog *ui; + bool m_has_signers = false; }; #endif // BITCOIN_QT_CREATEWALLETDIALOG_H |