5#include <bitcoin-build-config.h>
9#include <qt/forms/ui_createwalletdialog.h>
20 ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr(
"Create"));
21 ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
false);
22 ui->wallet_name_line_edit->setFocus(Qt::ActiveWindowFocusReason);
24 connect(
ui->wallet_name_line_edit, &QLineEdit::textEdited, [
this](
const QString& text) {
25 ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty());
28 connect(
ui->encrypt_wallet_checkbox, &QCheckBox::toggled, [
this](
bool checked) {
31 ui->disable_privkeys_checkbox->setEnabled(!checked);
32#ifdef ENABLE_EXTERNAL_SIGNER
33 ui->external_signer_checkbox->setEnabled(m_has_signers && !checked);
36 if (!ui->disable_privkeys_checkbox->isEnabled()) {
37 ui->disable_privkeys_checkbox->setChecked(false);
41 if (!
ui->external_signer_checkbox->isEnabled()) {
42 ui->external_signer_checkbox->setChecked(false);
47 connect(ui->external_signer_checkbox, &QCheckBox::toggled, [
this](
bool checked) {
48 ui->encrypt_wallet_checkbox->setEnabled(!checked);
49 ui->blank_wallet_checkbox->setEnabled(!checked);
50 ui->disable_privkeys_checkbox->setEnabled(!checked);
55 ui->encrypt_wallet_checkbox->setChecked(false);
56 ui->disable_privkeys_checkbox->setChecked(checked);
57 ui->blank_wallet_checkbox->setChecked(false);
60 connect(ui->disable_privkeys_checkbox, &QCheckBox::toggled, [
this](
bool checked) {
63 ui->encrypt_wallet_checkbox->setEnabled(!checked);
66 ui->blank_wallet_checkbox->setEnabled(!checked);
68 ui->blank_wallet_checkbox->setChecked(false);
72 if (!ui->encrypt_wallet_checkbox->isEnabled()) {
73 ui->encrypt_wallet_checkbox->setChecked(false);
77 connect(ui->blank_wallet_checkbox, &QCheckBox::toggled, [
this](
bool checked) {
80 ui->disable_privkeys_checkbox->setEnabled(!checked);
82 ui->disable_privkeys_checkbox->setChecked(false);
86#ifndef ENABLE_EXTERNAL_SIGNER
88 ui->external_signer_checkbox->setToolTip(tr(
"Compiled without external signing support (required for external signing)"));
89 ui->external_signer_checkbox->setEnabled(
false);
90 ui->external_signer_checkbox->setChecked(
false);
104 ui->external_signer_checkbox->setEnabled(
true);
105 ui->external_signer_checkbox->setChecked(
true);
106 ui->encrypt_wallet_checkbox->setEnabled(
false);
107 ui->encrypt_wallet_checkbox->setChecked(
false);
109 ui->blank_wallet_checkbox->setEnabled(
false);
110 ui->blank_wallet_checkbox->setChecked(
false);
111 ui->disable_privkeys_checkbox->setEnabled(
false);
112 ui->disable_privkeys_checkbox->setChecked(
true);
113 const std::string label = signers[0]->getName();
114 ui->wallet_name_line_edit->setText(QString::fromStdString(label));
115 ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(
true);
117 ui->external_signer_checkbox->setEnabled(
false);
123 return ui->wallet_name_line_edit->text();
128 return ui->encrypt_wallet_checkbox->isChecked();
133 return ui->disable_privkeys_checkbox->isChecked();
138 return ui->blank_wallet_checkbox->isChecked();
143 return ui->external_signer_checkbox->isChecked();
Dialog for creating wallets.
bool isMakeBlankWalletChecked() const
virtual ~CreateWalletDialog()
QString walletName() const
Ui::CreateWalletDialog * ui
bool isDisablePrivateKeysChecked() const
bool isEncryptWalletChecked() const
void setSigners(const std::vector< std::unique_ptr< interfaces::ExternalSigner > > &signers)
bool isExternalSignerChecked() const
CreateWalletDialog(QWidget *parent)
Utility functions used by the Bitcoin Qt UI.
constexpr auto dialog_flags