aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletframe.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/qt/walletframe.cpp')
-rw-r--r--src/qt/walletframe.cpp36
1 files changed, 5 insertions, 31 deletions
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
index 02b3c62867..a1f357e0db 100644
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -4,10 +4,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>
@@ -19,9 +16,8 @@
#include <QPushButton>
#include <QVBoxLayout>
-WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, BitcoinGUI* _gui)
- : QFrame(_gui),
- gui(_gui),
+WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, QWidget* parent)
+ : QFrame(parent),
platformStyle(_platformStyle),
m_size_hint(OverviewPage{platformStyle, nullptr}.sizeHint())
{
@@ -42,11 +38,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);
@@ -66,17 +58,15 @@ void WalletFrame::setClientModel(ClientModel *_clientModel)
}
}
-bool WalletFrame::addWallet(WalletModel *walletModel)
+bool WalletFrame::addWallet(WalletModel* walletModel, WalletView* walletView)
{
- if (!gui || !clientModel || !walletModel) return false;
+ if (!clientModel || !walletModel) return false;
if (mapWalletViews.count(walletModel) > 0) return false;
- WalletView *walletView = new WalletView(platformStyle, this);
walletView->setClientModel(clientModel);
walletView->setWalletModel(walletModel);
walletView->showOutOfSyncWarning(bOutOfSync);
- walletView->setPrivacy(gui->isPrivacyModeActivated());
WalletView* current_wallet_view = currentWalletView();
if (current_wallet_view) {
@@ -88,17 +78,6 @@ bool WalletFrame::addWallet(WalletModel *walletModel)
walletStack->addWidget(walletView);
mapWalletViews[walletModel] = walletView;
- connect(walletView, &WalletView::outOfSyncWarningClicked, this, &WalletFrame::outOfSyncWarningClicked);
- connect(walletView, &WalletView::transactionClicked, gui, &BitcoinGUI::gotoHistoryPage);
- connect(walletView, &WalletView::coinsSent, gui, &BitcoinGUI::gotoHistoryPage);
- connect(walletView, &WalletView::message, [this](const QString& title, const QString& message, unsigned int style) {
- gui->message(title, message, style);
- });
- connect(walletView, &WalletView::encryptionStatusChanged, gui, &BitcoinGUI::updateWalletStatus);
- connect(walletView, &WalletView::incomingTransaction, gui, &BitcoinGUI::incomingTransaction);
- connect(walletView, &WalletView::hdEnabledStatusChanged, gui, &BitcoinGUI::updateWalletStatus);
- connect(gui, &BitcoinGUI::setPrivacy, walletView, &WalletView::setPrivacy);
-
return true;
}
@@ -263,8 +242,3 @@ WalletModel* WalletFrame::currentWalletModel() const
WalletView* wallet_view = currentWalletView();
return wallet_view ? wallet_view->getWalletModel() : nullptr;
}
-
-void WalletFrame::outOfSyncWarningClicked()
-{
- Q_EMIT requestedSyncWarningInfo();
-}