22// Distributed under the MIT software license, see the accompanying
33// file COPYING or http://www.opensource.org/licenses/mit-license.php.
44
5+ #include < qt/createwalletdialog.h>
6+ #include < qt/walletcontroller.h>
57#include < qt/walletframe.h>
68#include < qt/walletmodel.h>
79
1012
1113#include < cassert>
1214
15+ #include < QGroupBox>
1316#include < QHBoxLayout>
1417#include < QLabel>
18+ #include < QPushButton>
19+ #include < QVBoxLayout>
1520
1621WalletFrame::WalletFrame (const PlatformStyle *_platformStyle, BitcoinGUI *_gui) :
1722 QFrame(_gui),
@@ -25,9 +30,25 @@ WalletFrame::WalletFrame(const PlatformStyle *_platformStyle, BitcoinGUI *_gui)
2530 walletFrameLayout->setContentsMargins (0 ,0 ,0 ,0 );
2631 walletFrameLayout->addWidget (walletStack);
2732
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 -" ));
2938 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);
3152}
3253
3354WalletFrame::~WalletFrame ()
0 commit comments