-
Notifications
You must be signed in to change notification settings - Fork 326
UI external signer support (e.g. hardware wallet) #4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
6cdbc83
eef8d64
450cb40
62ac119
3f845ea
24815c6
1c4b456
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -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; | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Could add comment "TODO show available signers in combobox, for now use 1st signer name"?
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @promag it is just the name of the wallet so I don't think it would be worth adding a combobox tbh. That might be confusing because it wouldn't actually change between signers, it would just change the 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(); | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -9,6 +9,10 @@ | |
|
|
||
| class WalletModel; | ||
|
|
||
| #ifdef ENABLE_EXTERNAL_SIGNER | ||
| class ExternalSigner; | ||
| #endif | ||
|
|
||
| namespace Ui { | ||
| class CreateWalletDialog; | ||
| } | ||
|
|
@@ -23,6 +27,10 @@ class CreateWalletDialog : public QDialog | |
| explicit CreateWalletDialog(QWidget* parent); | ||
| virtual ~CreateWalletDialog(); | ||
|
|
||
| #ifdef ENABLE_EXTERNAL_SIGNER | ||
| void setSigners(std::vector<ExternalSigner>& signers); | ||
|
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. nit
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm adding that to: bitcoin/bitcoin#21935 |
||
| #endif | ||
|
|
||
| QString walletName() const; | ||
| bool isEncryptWalletChecked() const; | ||
| bool isDisablePrivateKeysChecked() const; | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: to be consistent with
gui: create wallet with external signer, this should betrue(modulo comment about it being ambiguous anyway).