0
0
Fork 0
mirror of https://github.com/bitcoin/bitcoin.git synced 2025-03-04 13:55:23 -05:00

[gui] create wallet: smarter checkbox toggling

This commit is contained in:
Sjors Provoost 2020-09-18 10:12:23 +02:00
parent 42b66a6b81
commit 5bff82540b
No known key found for this signature in database
GPG key ID: 57FF9BDBCC301009
2 changed files with 24 additions and 7 deletions

View file

@ -35,11 +35,28 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
} }
}); });
#ifndef USE_SQLITE connect(ui->disable_privkeys_checkbox, &QCheckBox::toggled, [this](bool checked) {
ui->descriptor_checkbox->setToolTip(tr("Compiled without sqlite support (required for descriptor wallets)")); // Disable the encrypt_wallet_checkbox when isDisablePrivateKeysChecked is
ui->descriptor_checkbox->setEnabled(false); // set to true, enable it when isDisablePrivateKeysChecked is false.
ui->descriptor_checkbox->setChecked(false); ui->encrypt_wallet_checkbox->setEnabled(!checked);
#endif
// 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() CreateWalletDialog::~CreateWalletDialog()

View file

@ -68,12 +68,12 @@
<string>Encrypt Wallet</string> <string>Encrypt Wallet</string>
</property> </property>
<property name="checked"> <property name="checked">
<bool>true</bool> <bool>false</bool>
</property> </property>
</widget> </widget>
<widget class="QCheckBox" name="disable_privkeys_checkbox"> <widget class="QCheckBox" name="disable_privkeys_checkbox">
<property name="enabled"> <property name="enabled">
<bool>false</bool> <bool>true</bool>
</property> </property>
<property name="geometry"> <property name="geometry">
<rect> <rect>