mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-08-02 19:35:04 +02:00
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.
This commit is contained in:
@@ -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
|
||||
|
@@ -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);
|
||||
|
||||
|
@@ -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;
|
||||
|
Reference in New Issue
Block a user