File tree Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Expand file tree Collapse file tree 3 files changed +25
-4
lines changed Original file line number Diff line number Diff line change 1111
1212#include < QPushButton>
1313
14- CreateWalletDialog::CreateWalletDialog (QWidget* parent) :
14+ CreateWalletDialog::CreateWalletDialog (ExternalSignerList signers, QWidget* parent) :
1515 QDialog(parent),
1616 ui(new Ui::CreateWalletDialog)
1717{
@@ -56,6 +56,20 @@ CreateWalletDialog::CreateWalletDialog(QWidget* parent) :
5656 ui->descriptor_checkbox ->setEnabled (!checked);
5757 });
5858
59+ if (!signers.empty ()) {
60+ ui->external_signer_checkbox ->setEnabled (true );
61+ ui->external_signer_checkbox ->setChecked (true );
62+ ui->encrypt_wallet_checkbox ->setEnabled (false );
63+ ui->encrypt_wallet_checkbox ->setChecked (false );
64+ ui->disable_privkeys_checkbox ->setEnabled (false );
65+ ui->disable_privkeys_checkbox ->setChecked (true );
66+ ui->blank_wallet_checkbox ->setEnabled (false );
67+ ui->blank_wallet_checkbox ->setChecked (false );
68+ const std::string label = signers[0 ].second ;
69+ ui->wallet_name_line_edit ->setText (QString::fromStdString (label));
70+ ui->buttonBox ->button (QDialogButtonBox::Ok)->setEnabled (true );
71+ }
72+
5973}
6074
6175CreateWalletDialog::~CreateWalletDialog ()
Original file line number Diff line number Diff line change @@ -13,14 +13,16 @@ namespace Ui {
1313 class CreateWalletDialog ;
1414}
1515
16+ typedef std::vector<std::pair<std::string, std::string>> ExternalSignerList; // TODO: figure out where to define this
17+
1618/* * Dialog for creating wallets
1719 */
1820class CreateWalletDialog : public QDialog
1921{
2022 Q_OBJECT
2123
2224public:
23- explicit CreateWalletDialog (QWidget* parent);
25+ explicit CreateWalletDialog (ExternalSignerList signers, QWidget* parent);
2426 virtual ~CreateWalletDialog ();
2527
2628 QString walletName () const ;
Original file line number Diff line number Diff line change @@ -282,9 +282,14 @@ void CreateWalletActivity::finish()
282282void CreateWalletActivity::create ()
283283{
284284 // Check for external signers
285+ ExternalSignerList signers;
286+ try {
287+ signers = node ().walletClient ().ExternalSigners ();
288+ } catch (const ExternalSignerException& e) {
289+ QMessageBox::critical (nullptr , tr (" Can't list signers" ), e.what ());
290+ }
285291
286-
287- m_create_wallet_dialog = new CreateWalletDialog (m_parent_widget);
292+ m_create_wallet_dialog = new CreateWalletDialog (signers, m_parent_widget);
288293 m_create_wallet_dialog->setWindowModality (Qt::ApplicationModal);
289294 m_create_wallet_dialog->show ();
290295
You can’t perform that action at this time.
0 commit comments