4
4
5
5
#include < qt/walletframe.h>
6
6
7
- #include < qt/bitcoingui.h>
8
- #include < qt/createwalletdialog.h>
9
7
#include < qt/overviewpage.h>
10
- #include < qt/walletcontroller.h>
11
8
#include < qt/walletmodel.h>
12
9
#include < qt/walletview.h>
13
10
19
16
#include < QPushButton>
20
17
#include < QVBoxLayout>
21
18
22
- WalletFrame::WalletFrame (const PlatformStyle* _platformStyle, BitcoinGUI* _gui)
23
- : QFrame(_gui),
24
- gui(_gui),
19
+ WalletFrame::WalletFrame (const PlatformStyle* _platformStyle, QWidget* parent)
20
+ : QFrame(parent),
25
21
platformStyle(_platformStyle),
26
22
m_size_hint(OverviewPage{platformStyle, nullptr }.sizeHint())
27
23
{
@@ -42,11 +38,7 @@ WalletFrame::WalletFrame(const PlatformStyle* _platformStyle, BitcoinGUI* _gui)
42
38
43
39
// A button for create wallet dialog
44
40
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
- });
41
+ connect (create_wallet_button, &QPushButton::clicked, this , &WalletFrame::createWalletButtonClicked);
50
42
no_wallet_layout->addWidget (create_wallet_button, 0 , Qt::AlignHCenter | Qt::AlignTop);
51
43
no_wallet_group->setLayout (no_wallet_layout);
52
44
@@ -66,17 +58,15 @@ void WalletFrame::setClientModel(ClientModel *_clientModel)
66
58
}
67
59
}
68
60
69
- bool WalletFrame::addWallet (WalletModel * walletModel)
61
+ bool WalletFrame::addWallet (WalletModel* walletModel, WalletView* walletView )
70
62
{
71
- if (!gui || ! clientModel || !walletModel) return false ;
63
+ if (!clientModel || !walletModel) return false ;
72
64
73
65
if (mapWalletViews.count (walletModel) > 0 ) return false ;
74
66
75
- WalletView *walletView = new WalletView (platformStyle, this );
76
67
walletView->setClientModel (clientModel);
77
68
walletView->setWalletModel (walletModel);
78
69
walletView->showOutOfSyncWarning (bOutOfSync);
79
- walletView->setPrivacy (gui->isPrivacyModeActivated ());
80
70
81
71
WalletView* current_wallet_view = currentWalletView ();
82
72
if (current_wallet_view) {
@@ -88,17 +78,6 @@ bool WalletFrame::addWallet(WalletModel *walletModel)
88
78
walletStack->addWidget (walletView);
89
79
mapWalletViews[walletModel] = walletView;
90
80
91
- connect (walletView, &WalletView::outOfSyncWarningClicked, this , &WalletFrame::outOfSyncWarningClicked);
92
- connect (walletView, &WalletView::transactionClicked, gui, &BitcoinGUI::gotoHistoryPage);
93
- connect (walletView, &WalletView::coinsSent, gui, &BitcoinGUI::gotoHistoryPage);
94
- connect (walletView, &WalletView::message, [this ](const QString& title, const QString& message, unsigned int style) {
95
- gui->message (title, message, style);
96
- });
97
- connect (walletView, &WalletView::encryptionStatusChanged, gui, &BitcoinGUI::updateWalletStatus);
98
- connect (walletView, &WalletView::incomingTransaction, gui, &BitcoinGUI::incomingTransaction);
99
- connect (walletView, &WalletView::hdEnabledStatusChanged, gui, &BitcoinGUI::updateWalletStatus);
100
- connect (gui, &BitcoinGUI::setPrivacy, walletView, &WalletView::setPrivacy);
101
-
102
81
return true ;
103
82
}
104
83
0 commit comments