Bitcoin ABC  0.24.7
P2P Digital Currency
createwalletdialog.cpp
Go to the documentation of this file.
1 // Copyright (c) 2019 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #if defined(HAVE_CONFIG_H)
6 #include <config/bitcoin-config.h>
7 #endif
8 
10 #include <qt/forms/ui_createwalletdialog.h>
11 
12 #include <QPushButton>
13 
15  : QDialog(parent), ui(new Ui::CreateWalletDialog) {
16  ui->setupUi(this);
17  ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Create"));
18  ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
19  ui->wallet_name_line_edit->setFocus(Qt::ActiveWindowFocusReason);
20 
21  connect(ui->wallet_name_line_edit, &QLineEdit::textEdited,
22  [this](const QString &text) {
23  ui->buttonBox->button(QDialogButtonBox::Ok)
24  ->setEnabled(!text.isEmpty());
25  });
26 
27  connect(ui->encrypt_wallet_checkbox, &QCheckBox::toggled,
28  [this](bool checked) {
29  // Disable disable_privkeys_checkbox when
30  // isEncryptWalletChecked is set to true, enable it when
31  // encrypt is false
32  ui->disable_privkeys_checkbox->setEnabled(!checked);
33 
34  // When the disable_privkeys_checkbox is disabled, uncheck it.
35  if (!ui->disable_privkeys_checkbox->isEnabled()) {
36  ui->disable_privkeys_checkbox->setChecked(false);
37  }
38  });
39 }
40 
42  delete ui;
43 }
44 
46  return ui->wallet_name_line_edit->text();
47 }
48 
50  return ui->encrypt_wallet_checkbox->isChecked();
51 }
52 
54  return ui->disable_privkeys_checkbox->isChecked();
55 }
56 
58  return ui->blank_wallet_checkbox->isChecked();
59 }
60 
62  return ui->descriptor_checkbox->isChecked();
63 }
CreateWalletDialog::isMakeBlankWalletChecked
bool isMakeBlankWalletChecked() const
Definition: createwalletdialog.cpp:57
CreateWalletDialog::isDisablePrivateKeysChecked
bool isDisablePrivateKeysChecked() const
Definition: createwalletdialog.cpp:53
CreateWalletDialog::isEncryptWalletChecked
bool isEncryptWalletChecked() const
Definition: createwalletdialog.cpp:49
createwalletdialog.h
CreateWalletDialog::ui
Ui::CreateWalletDialog * ui
Definition: createwalletdialog.h:33
Ui
Definition: addressbookpage.h:14
CreateWalletDialog
Dialog for creating wallets.
Definition: createwalletdialog.h:19
CreateWalletDialog::isDescriptorWalletChecked
bool isDescriptorWalletChecked() const
Definition: createwalletdialog.cpp:61
CreateWalletDialog::~CreateWalletDialog
virtual ~CreateWalletDialog()
Definition: createwalletdialog.cpp:41
CreateWalletDialog::walletName
QString walletName() const
Definition: createwalletdialog.cpp:45
CreateWalletDialog::CreateWalletDialog
CreateWalletDialog(QWidget *parent)
Definition: createwalletdialog.cpp:14