Skip to content

Commit 3fd913a

Browse files
Merge dashpay#5894: backport: partial Merge bitcoin-core/gui#96: Slight improve create wallet dialog
a50f20d backport: partial Merge bitcoin-core/gui#96: Slight improve create wallet dialog (Konstantin Akimov) Pull request description: ## Issue being fixed or feature implemented It fixes strange behaviour of enable/disable checkboxes and checking/unchecking them kudos to thephez to found an issue. ## What was done? Partial backport bitcoin-core/gui#96 ## How Has This Been Tested? Build & run `dash-qt` ## Breaking Changes No actual code changed for creating wallet, only UI for it ## Checklist: - [x] I have performed a self-review of my own code - [ ] I have commented my code, particularly in hard-to-understand areas - [ ] I have added or updated relevant unit/integration/functional/e2e tests - [ ] I have made corresponding changes to the documentation - [x] I have assigned this pull request to a milestone Top commit has no ACKs. Tree-SHA512: 7b16d33af181e44ef5b77dbb0eabb3a435e5f0b3c0a5a5c4ce17c95bb5949a5a41d605f7e6100d0f994b50edf087b777cbed6fe6d29952c2446ac9f8229f1a3a
2 parents d64ec8b + a50f20d commit 3fd913a

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

src/qt/createwalletdialog.cpp

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,21 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
3636
ui->disable_privkeys_checkbox->setChecked(false);
3737
}
3838
});
39+
connect(ui->disable_privkeys_checkbox, &QCheckBox::toggled, [this](bool checked) {
40+
// Disable the encrypt_wallet_checkbox when isDisablePrivateKeysChecked is
41+
// set to true, enable it when isDisablePrivateKeysChecked is false.
42+
ui->encrypt_wallet_checkbox->setEnabled(!checked);
43+
44+
// Wallets without private keys start out blank
45+
if (checked) {
46+
ui->blank_wallet_checkbox->setChecked(true);
47+
}
48+
49+
// When the encrypt_wallet_checkbox is disabled, uncheck it.
50+
if (!ui->encrypt_wallet_checkbox->isEnabled()) {
51+
ui->encrypt_wallet_checkbox->setChecked(false);
52+
}
53+
});
3954
}
4055

4156
CreateWalletDialog::~CreateWalletDialog()

0 commit comments

Comments
 (0)