2
2
// Distributed under the MIT software license, see the accompanying
3
3
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
4
5
+ #include < qt/createwalletdialog.h>
6
+ #include < qt/walletcontroller.h>
5
7
#include < qt/walletframe.h>
6
8
#include < qt/walletmodel.h>
7
9
10
12
11
13
#include < cassert>
12
14
15
+ #include < QGroupBox>
13
16
#include < QHBoxLayout>
14
17
#include < QLabel>
18
+ #include < QPushButton>
19
+ #include < QVBoxLayout>
15
20
16
21
WalletFrame::WalletFrame (const PlatformStyle *_platformStyle, BitcoinGUI *_gui) :
17
22
QFrame(_gui),
@@ -25,9 +30,25 @@ WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui)
25
30
walletFrameLayout->setContentsMargins (0 ,0 ,0 ,0 );
26
31
walletFrameLayout->addWidget (walletStack);
27
32
28
- QLabel *noWallet = new QLabel (tr (" No wallet has been loaded." ));
33
+ // hbox for no wallet
34
+ QGroupBox* no_wallet_group = new QGroupBox (walletStack);
35
+ QVBoxLayout* no_wallet_layout = new QVBoxLayout (no_wallet_group);
36
+
37
+ QLabel *noWallet = new QLabel (tr (" No wallet has been loaded.\n Go to File > Open Wallet to load a wallet.\n - OR -" ));
29
38
noWallet->setAlignment (Qt::AlignCenter);
30
- walletStack->addWidget (noWallet);
39
+ no_wallet_layout->addWidget (noWallet, 0 , Qt::AlignHCenter | Qt::AlignBottom);
40
+
41
+ // A button for create wallet dialog
42
+ QPushButton* create_wallet_button = new QPushButton (tr (" Create a new wallet" ), walletStack);
43
+ connect (create_wallet_button, &QPushButton::clicked, [this ] {
44
+ auto activity = new CreateWalletActivity (gui->getWalletController (), this );
45
+ connect (activity, &CreateWalletActivity::finished, activity, &QObject::deleteLater);
46
+ activity->create ();
47
+ });
48
+ no_wallet_layout->addWidget (create_wallet_button, 0 , Qt::AlignHCenter | Qt::AlignTop);
49
+ no_wallet_group->setLayout (no_wallet_layout);
50
+
51
+ walletStack->addWidget (no_wallet_group);
31
52
}
32
53
33
54
WalletFrame::~WalletFrame ()
0 commit comments