aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Chow <github@achow101.com>2023-06-13 15:52:03 -0400
committerAndrew Chow <github@achow101.com>2023-06-23 13:40:41 -0400
commit9ea31eba04ff8dcb9d7d993ce28bb10731a35177 (patch)
treec40d675aa9bb3c597c7fac87e3126464723a71f3
parentda494186f2c0863a294029a5af9c4b57aeb03b40 (diff)
downloadbitcoin-9ea31eba04ff8dcb9d7d993ce28bb10731a35177.tar.xz
gui: Disable and uncheck blank when private keys are disabled
Unify the GUI's create wallet with the RPC createwallet so that the blank flag is not set when private keys are disabled.
-rw-r--r--src/qt/createwalletdialog.cpp17
1 files changed, 9 insertions, 8 deletions
diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp
index 5b3c8bcf48..3e8be3e675 100644
--- a/src/qt/createwalletdialog.cpp
+++ b/src/qt/createwalletdialog.cpp
@@ -58,10 +58,7 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
ui->descriptor_checkbox->setChecked(checked);
ui->encrypt_wallet_checkbox->setChecked(false);
ui->disable_privkeys_checkbox->setChecked(checked);
- // The blank check box is ambiguous. This flag is always true for a
- // watch-only wallet, even though we immedidately fetch keys from the
- // external signer.
- ui->blank_wallet_checkbox->setChecked(checked);
+ ui->blank_wallet_checkbox->setChecked(false);
});
connect(ui->disable_privkeys_checkbox, &QCheckBox::toggled, [this](bool checked) {
@@ -69,9 +66,10 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
// set to true, enable it when isDisablePrivateKeysChecked is false.
ui->encrypt_wallet_checkbox->setEnabled(!checked);
- // Wallets without private keys start out blank
+ // Wallets without private keys cannot set blank
+ ui->blank_wallet_checkbox->setEnabled(!checked);
if (checked) {
- ui->blank_wallet_checkbox->setChecked(true);
+ ui->blank_wallet_checkbox->setChecked(false);
}
// When the encrypt_wallet_checkbox is disabled, uncheck it.
@@ -81,8 +79,11 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
});
connect(ui->blank_wallet_checkbox, &QCheckBox::toggled, [this](bool checked) {
- if (!checked) {
- ui->disable_privkeys_checkbox->setChecked(false);
+ // Disable the disable_privkeys_checkbox when blank_wallet_checkbox is checked
+ // as blank-ness only pertains to wallets with private keys.
+ ui->disable_privkeys_checkbox->setEnabled(!checked);
+ if (checked) {
+ ui->disable_privkeys_checkbox->setChecked(false);
}
});