aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-15 22:58:08 +0300
committerHennadii Stepanov <32963518+hebasto@users.noreply.github.com>2021-05-29 15:49:30 +0300
commitf73e5c972ab096e0f80cb9e753fa221d17313358 (patch)
tree603d0246540f0fea8b369da95894d7b4a1b7e072
parent20e2e24e90d782219e853ef0676ac66dc6a9de6a (diff)
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.
-rw-r--r--src/qt/bitcoingui.cpp5
-rw-r--r--src/qt/walletframe.cpp8
-rw-r--r--src/qt/walletframe.h2
3 files changed, 8 insertions, 7 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 4fb693cc6e..eaacacb053 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -104,6 +104,11 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
{
/** Create wallet frame and make it the central widget */
walletFrame = new WalletFrame(_platformStyle, this);
+ connect(walletFrame, &WalletFrame::createWalletButtonClicked, [this] {
+ auto activity = new CreateWalletActivity(getWalletController(), this);
+ connect(activity, &CreateWalletActivity::finished, activity, &QObject::deleteLater);
+ activity->create();
+ });
setCentralWidget(walletFrame);
} else
#endif // ENABLE_WALLET
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
index af8eb4006a..f85a882eed 100644
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -5,9 +5,7 @@
#include <qt/walletframe.h>
#include <qt/bitcoingui.h>
-#include <qt/createwalletdialog.h>
#include <qt/overviewpage.h>
-#include <qt/walletcontroller.h>
#include <qt/walletmodel.h>
#include <qt/walletview.h>
@@ -42,11 +40,7 @@ WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, BitcoinGUI* _gui)
// A button for create wallet dialog
QPushButton* create_wallet_button = new QPushButton(tr("Create a new wallet"), walletStack);
- connect(create_wallet_button, &QPushButton::clicked, [this] {
- auto activity = new CreateWalletActivity(gui->getWalletController(), this);
- connect(activity, &CreateWalletActivity::finished, activity, &QObject::deleteLater);
- activity->create();
- });
+ connect(create_wallet_button, &QPushButton::clicked, this, &WalletFrame::createWalletButtonClicked);
no_wallet_layout->addWidget(create_wallet_button, 0, Qt::AlignHCenter | Qt::AlignTop);
no_wallet_group->setLayout(no_wallet_layout);
diff --git a/src/qt/walletframe.h b/src/qt/walletframe.h
index fcea4b3d22..74bdef40df 100644
--- a/src/qt/walletframe.h
+++ b/src/qt/walletframe.h
@@ -51,6 +51,8 @@ Q_SIGNALS:
/** Notify that the user has requested more information about the out-of-sync warning */
void requestedSyncWarningInfo();
+ void createWalletButtonClicked();
+
private:
QStackedWidget *walletStack;
BitcoinGUI *gui;