File tree Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Expand file tree Collapse file tree 3 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 6
6
#include < config/bitcoin-config.h>
7
7
#endif
8
8
9
+ #include < external_signer.h>
9
10
#include < qt/createwalletdialog.h>
10
11
#include < qt/forms/ui_createwalletdialog.h>
11
12
@@ -111,6 +112,28 @@ CreateWalletDialog::~CreateWalletDialog()
111
112
delete ui;
112
113
}
113
114
115
+ #ifdef ENABLE_EXTERNAL_SIGNER
116
+ void CreateWalletDialog::setSigners (std::vector<ExternalSigner>& signers)
117
+ {
118
+ if (!signers.empty ()) {
119
+ ui->external_signer_checkbox ->setEnabled (true );
120
+ ui->external_signer_checkbox ->setChecked (true );
121
+ ui->encrypt_wallet_checkbox ->setEnabled (false );
122
+ ui->encrypt_wallet_checkbox ->setChecked (false );
123
+ // The order matters, because connect() is called when toggling a checkbox:
124
+ ui->blank_wallet_checkbox ->setEnabled (false );
125
+ ui->blank_wallet_checkbox ->setChecked (false );
126
+ ui->disable_privkeys_checkbox ->setEnabled (false );
127
+ ui->disable_privkeys_checkbox ->setChecked (true );
128
+ const std::string label = signers[0 ].m_name ;
129
+ ui->wallet_name_line_edit ->setText (QString::fromStdString (label));
130
+ ui->buttonBox ->button (QDialogButtonBox::Ok)->setEnabled (true );
131
+ } else {
132
+ ui->external_signer_checkbox ->setEnabled (false );
133
+ }
134
+ }
135
+ #endif
136
+
114
137
QString CreateWalletDialog::walletName () const
115
138
{
116
139
return ui->wallet_name_line_edit ->text ();
Original file line number Diff line number Diff line change 9
9
10
10
class WalletModel ;
11
11
12
+ #ifdef ENABLE_EXTERNAL_SIGNER
13
+ class ExternalSigner ;
14
+ #endif
15
+
12
16
namespace Ui {
13
17
class CreateWalletDialog ;
14
18
}
@@ -23,6 +27,10 @@ class CreateWalletDialog : public QDialog
23
27
explicit CreateWalletDialog (QWidget* parent);
24
28
virtual ~CreateWalletDialog ();
25
29
30
+ #ifdef ENABLE_EXTERNAL_SIGNER
31
+ void setSigners (std::vector<ExternalSigner>& signers);
32
+ #endif
33
+
26
34
QString walletName () const ;
27
35
bool isEncryptWalletChecked () const ;
28
36
bool isDisablePrivateKeysChecked () const ;
Original file line number Diff line number Diff line change @@ -291,6 +291,17 @@ void CreateWalletActivity::finish()
291
291
void CreateWalletActivity::create ()
292
292
{
293
293
m_create_wallet_dialog = new CreateWalletDialog (m_parent_widget);
294
+
295
+ #ifdef ENABLE_EXTERNAL_SIGNER
296
+ std::vector<ExternalSigner> signers;
297
+ try {
298
+ signers = node ().externalSigners ();
299
+ } catch (const std::runtime_error& e) {
300
+ QMessageBox::critical (nullptr , tr (" Can't list signers" ), e.what ());
301
+ }
302
+ m_create_wallet_dialog->setSigners (signers);
303
+ #endif
304
+
294
305
m_create_wallet_dialog->setWindowModality (Qt::ApplicationModal);
295
306
m_create_wallet_dialog->show ();
296
307
You can’t perform that action at this time.
0 commit comments