Skip to content

Commit f73e5c9

Browse files
committed
qt: Move CreateWalletActivity connection from WalletFrame to BitcoinGUI
This changes remove some pointers to the BitcoinGUI instance that is required for the next commits. This commit does not change behavior.
1 parent 20e2e24 commit f73e5c9

File tree

3 files changed

+8
-7
lines changed

3 files changed

+8
-7
lines changed

src/qt/bitcoingui.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,11 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
104104
{
105105
/** Create wallet frame and make it the central widget */
106106
walletFrame = new WalletFrame(_platformStyle, this);
107+
connect(walletFrame, &WalletFrame::createWalletButtonClicked, [this] {
108+
auto activity = new CreateWalletActivity(getWalletController(), this);
109+
connect(activity, &CreateWalletActivity::finished, activity, &QObject::deleteLater);
110+
activity->create();
111+
});
107112
setCentralWidget(walletFrame);
108113
} else
109114
#endif // ENABLE_WALLET

src/qt/walletframe.cpp

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,9 +5,7 @@
55
#include <qt/walletframe.h>
66

77
#include <qt/bitcoingui.h>
8-
#include <qt/createwalletdialog.h>
98
#include <qt/overviewpage.h>
10-
#include <qt/walletcontroller.h>
119
#include <qt/walletmodel.h>
1210
#include <qt/walletview.h>
1311

@@ -42,11 +40,7 @@ WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, BitcoinGUI* _gui)
4240

4341
// A button for create wallet dialog
4442
QPushButton* create_wallet_button = new QPushButton(tr("Create a new wallet"), walletStack);
45-
connect(create_wallet_button, &QPushButton::clicked, [this] {
46-
auto activity = new CreateWalletActivity(gui->getWalletController(), this);
47-
connect(activity, &CreateWalletActivity::finished, activity, &QObject::deleteLater);
48-
activity->create();
49-
});
43+
connect(create_wallet_button, &QPushButton::clicked, this, &WalletFrame::createWalletButtonClicked);
5044
no_wallet_layout->addWidget(create_wallet_button, 0, Qt::AlignHCenter | Qt::AlignTop);
5145
no_wallet_group->setLayout(no_wallet_layout);
5246

src/qt/walletframe.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,8 @@ class WalletFrame : public QFrame
5151
/** Notify that the user has requested more information about the out-of-sync warning */
5252
void requestedSyncWarningInfo();
5353

54+
void createWalletButtonClicked();
55+
5456
private:
5557
QStackedWidget *walletStack;
5658
BitcoinGUI *gui;

0 commit comments

Comments
 (0)