From 5bff82540b90d899ceac6390c008d653e6b665c3 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 18 Sep 2020 10:12:23 +0200 Subject: [PATCH 1/3] [gui] create wallet: smarter checkbox toggling --- src/qt/createwalletdialog.cpp | 27 ++++++++++++++++++++++----- src/qt/forms/createwalletdialog.ui | 4 ++-- 2 files changed, 24 insertions(+), 7 deletions(-) diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp index 38c6bfe56a..2ded6a1d89 100644 --- a/src/qt/createwalletdialog.cpp +++ b/src/qt/createwalletdialog.cpp @@ -35,11 +35,28 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) : } }); -#ifndef USE_SQLITE - ui->descriptor_checkbox->setToolTip(tr("Compiled without sqlite support (required for descriptor wallets)")); - ui->descriptor_checkbox->setEnabled(false); - ui->descriptor_checkbox->setChecked(false); -#endif + connect(ui->disable_privkeys_checkbox, &QCheckBox::toggled, [this](bool checked) { + // Disable the encrypt_wallet_checkbox when isDisablePrivateKeysChecked is + // set to true, enable it when isDisablePrivateKeysChecked is false. + ui->encrypt_wallet_checkbox->setEnabled(!checked); + + // Wallets without private keys start out blank + if (checked) { + ui->blank_wallet_checkbox->setChecked(true); + } + + // When the encrypt_wallet_checkbox is disabled, uncheck it. + if (!ui->encrypt_wallet_checkbox->isEnabled()) { + ui->encrypt_wallet_checkbox->setChecked(false); + } + }); + + #ifndef USE_SQLITE + ui->descriptor_checkbox->setToolTip(tr("Compiled without sqlite support (required for descriptor wallets)")); + ui->descriptor_checkbox->setEnabled(false); + ui->descriptor_checkbox->setChecked(false); + #endif + } CreateWalletDialog::~CreateWalletDialog() diff --git a/src/qt/forms/createwalletdialog.ui b/src/qt/forms/createwalletdialog.ui index b592140dd7..f5dcbbd83d 100644 --- a/src/qt/forms/createwalletdialog.ui +++ b/src/qt/forms/createwalletdialog.ui @@ -68,12 +68,12 @@ Encrypt Wallet - true + false - false + true From c99d6f644aa45d1bd929790f23a36d0dd7c29004 Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 18 Sep 2020 10:13:03 +0200 Subject: [PATCH 2/3] gui: create wallet: name placeholder --- src/qt/forms/createwalletdialog.ui | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/qt/forms/createwalletdialog.ui b/src/qt/forms/createwalletdialog.ui index f5dcbbd83d..ef3a8ed5b6 100644 --- a/src/qt/forms/createwalletdialog.ui +++ b/src/qt/forms/createwalletdialog.ui @@ -38,6 +38,9 @@ 24 + + Wallet + From ac64cec4ce35cb7e6fbf3678c1ffeac0137791ae Mon Sep 17 00:00:00 2001 From: Sjors Provoost Date: Fri, 18 Sep 2020 12:20:42 +0200 Subject: [PATCH 3/3] gui: create wallet: add advanced section --- src/qt/forms/createwalletdialog.ui | 25 +++++++++++++++++++++---- 1 file changed, 21 insertions(+), 4 deletions(-) diff --git a/src/qt/forms/createwalletdialog.ui b/src/qt/forms/createwalletdialog.ui index ef3a8ed5b6..ea713e1abd 100644 --- a/src/qt/forms/createwalletdialog.ui +++ b/src/qt/forms/createwalletdialog.ui @@ -74,6 +74,22 @@ false + + + + 20 + 90 + 130 + 21 + + + + font-weight:bold; + + + Advanced options + + true @@ -81,7 +97,7 @@ 20 - 80 + 115 171 22 @@ -97,8 +113,8 @@ 20 - 110 - 171 + 135 + 220 22 @@ -113,7 +129,7 @@ 20 - 140 + 155 171 22 @@ -131,6 +147,7 @@ encrypt_wallet_checkbox disable_privkeys_checkbox blank_wallet_checkbox + descriptor_checkbox