LCOV - code coverage report
Current view: top level - src/qt - createwalletdialog.cpp (source / functions) Hit Total Coverage
Test: total_coverage.info Lines: 0 32 0.0 %
Date: 2020-09-26 01:30:44 Functions: 0 12 0.0 %

          Line data    Source code
       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             : 
       9             : #include <qt/createwalletdialog.h>
      10             : #include <qt/forms/ui_createwalletdialog.h>
      11             : 
      12             : #include <QPushButton>
      13             : 
      14           0 : CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
      15           0 :     QDialog(parent),
      16           0 :     ui(new Ui::CreateWalletDialog)
      17           0 : {
      18           0 :     ui->setupUi(this);
      19           0 :     ui->buttonBox->button(QDialogButtonBox::Ok)->setText(tr("Create"));
      20           0 :     ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(false);
      21           0 :     ui->wallet_name_line_edit->setFocus(Qt::ActiveWindowFocusReason);
      22             : 
      23           0 :     connect(ui->wallet_name_line_edit, &QLineEdit::textEdited, [this](const QString& text) {
      24           0 :         ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(!text.isEmpty());
      25           0 :     });
      26             : 
      27           0 :     connect(ui->encrypt_wallet_checkbox, &QCheckBox::toggled, [this](bool checked) {
      28             :         // Disable the disable_privkeys_checkbox when isEncryptWalletChecked is
      29             :         // set to true, enable it when isEncryptWalletChecked is false.
      30           0 :         ui->disable_privkeys_checkbox->setEnabled(!checked);
      31             : 
      32             :         // When the disable_privkeys_checkbox is disabled, uncheck it.
      33           0 :         if (!ui->disable_privkeys_checkbox->isEnabled()) {
      34           0 :             ui->disable_privkeys_checkbox->setChecked(false);
      35           0 :         }
      36           0 :     });
      37           0 : }
      38             : 
      39           0 : CreateWalletDialog::~CreateWalletDialog()
      40           0 : {
      41           0 :     delete ui;
      42           0 : }
      43             : 
      44           0 : QString CreateWalletDialog::walletName() const
      45             : {
      46           0 :     return ui->wallet_name_line_edit->text();
      47             : }
      48             : 
      49           0 : bool CreateWalletDialog::isEncryptWalletChecked() const
      50             : {
      51           0 :     return ui->encrypt_wallet_checkbox->isChecked();
      52             : }
      53             : 
      54           0 : bool CreateWalletDialog::isDisablePrivateKeysChecked() const
      55             : {
      56           0 :     return ui->disable_privkeys_checkbox->isChecked();
      57             : }
      58             : 
      59           0 : bool CreateWalletDialog::isMakeBlankWalletChecked() const
      60             : {
      61           0 :     return ui->blank_wallet_checkbox->isChecked();
      62             : }
      63             : 
      64           0 : bool CreateWalletDialog::isDescriptorWalletChecked() const
      65             : {
      66           0 :     return ui->descriptor_checkbox->isChecked();
      67             : }

Generated by: LCOV version 1.15