diff options
author | Sjors Provoost <sjors@sprovoost.nl> | 2019-11-07 19:06:40 +0100 |
---|---|---|
committer | Sjors Provoost <sjors@sprovoost.nl> | 2021-05-27 14:01:54 +0200 |
commit | 24815c6309431cb0797defaf7add1150bcf4b567 (patch) | |
tree | de34411cd292d8beab69d7cdee6399c95fbe8bc2 /src/qt/createwalletdialog.cpp | |
parent | 3f845ea2994f53e29abeb3fa158c35f1ee56e7e8 (diff) |
gui: wallet creation detects external signer
Diffstat (limited to 'src/qt/createwalletdialog.cpp')
-rw-r--r-- | src/qt/createwalletdialog.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/qt/createwalletdialog.cpp b/src/qt/createwalletdialog.cpp index 6f5ca95d1b..e593697b46 100644 --- a/src/qt/createwalletdialog.cpp +++ b/src/qt/createwalletdialog.cpp @@ -6,6 +6,7 @@ #include <config/bitcoin-config.h> #endif +#include <external_signer.h> #include <qt/createwalletdialog.h> #include <qt/forms/ui_createwalletdialog.h> @@ -111,6 +112,28 @@ CreateWalletDialog::~CreateWalletDialog() delete ui; } +#ifdef ENABLE_EXTERNAL_SIGNER +void CreateWalletDialog::setSigners(std::vector<ExternalSigner>& signers) +{ + if (!signers.empty()) { + ui->external_signer_checkbox->setEnabled(true); + ui->external_signer_checkbox->setChecked(true); + ui->encrypt_wallet_checkbox->setEnabled(false); + ui->encrypt_wallet_checkbox->setChecked(false); + // The order matters, because connect() is called when toggling a checkbox: + ui->blank_wallet_checkbox->setEnabled(false); + ui->blank_wallet_checkbox->setChecked(false); + ui->disable_privkeys_checkbox->setEnabled(false); + ui->disable_privkeys_checkbox->setChecked(true); + const std::string label = signers[0].m_name; + ui->wallet_name_line_edit->setText(QString::fromStdString(label)); + ui->buttonBox->button(QDialogButtonBox::Ok)->setEnabled(true); + } else { + ui->external_signer_checkbox->setEnabled(false); + } +} +#endif + QString CreateWalletDialog::walletName() const { return ui->wallet_name_line_edit->text(); |