Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F12428707
D10244.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
2 KB
Subscribers
None
D10244.diff
View Options
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -86,6 +86,7 @@
interfaces::BlockAndHeaderTipInfo *tip_info = nullptr);
#ifdef ENABLE_WALLET
void setWalletController(WalletController *wallet_controller);
+ WalletController *getWalletController();
#endif
#ifdef ENABLE_WALLET
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -750,6 +750,10 @@
}
}
+WalletController *BitcoinGUI::getWalletController() {
+ return m_wallet_controller;
+}
+
void BitcoinGUI::addWallet(WalletModel *walletModel) {
if (!walletFrame) {
return;
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -2,14 +2,19 @@
// Distributed under the MIT software license, see the accompanying
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
+#include <qt/createwalletdialog.h>
+#include <qt/walletcontroller.h>
#include <qt/walletframe.h>
#include <qt/bitcoingui.h>
#include <qt/walletmodel.h>
#include <qt/walletview.h>
+#include <QGroupBox>
#include <QHBoxLayout>
#include <QLabel>
+#include <QPushButton>
+#include <QVBoxLayout>
#include <cassert>
@@ -22,9 +27,31 @@
walletFrameLayout->setContentsMargins(0, 0, 0, 0);
walletFrameLayout->addWidget(walletStack);
- QLabel *noWallet = new QLabel(tr("No wallet has been loaded."));
+ // hbox for no wallet
+ QGroupBox *no_wallet_group = new QGroupBox(walletStack);
+ QVBoxLayout *no_wallet_layout = new QVBoxLayout(no_wallet_group);
+
+ QLabel *noWallet = new QLabel(tr("No wallet has been loaded.\nGo to File > "
+ "Open Wallet to load a wallet.\n- OR -"));
noWallet->setAlignment(Qt::AlignCenter);
- walletStack->addWidget(noWallet);
+ no_wallet_layout->addWidget(noWallet, 0,
+ Qt::AlignHCenter | Qt::AlignBottom);
+
+ // 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();
+ });
+ no_wallet_layout->addWidget(create_wallet_button, 0,
+ Qt::AlignHCenter | Qt::AlignTop);
+ no_wallet_group->setLayout(no_wallet_layout);
+
+ walletStack->addWidget(no_wallet_group);
}
WalletFrame::~WalletFrame() {}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Dec 28, 19:20 (8 h, 5 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
4844924
Default Alt Text
D10244.diff (2 KB)
Attached To
D10244: Tell users how to load or create a wallet when no wallet is loaded
Event Timeline
Log In to Comment