aboutsummaryrefslogtreecommitdiff
path: root/src/qt/walletframe.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2013-11-12 14:54:43 +0100
committerWladimir J. van der Laan <laanwj@gmail.com>2013-11-13 09:22:00 +0100
commit146ba964e4b784171c29600e959a0fae3e2e0c03 (patch)
treec94ccf87d3a0386adc0e8b07ac35353995ad4e29 /src/qt/walletframe.cpp
parente6b7e3dc79e91db7a9e20ec8fd593145f6c3ac41 (diff)
qt: GUI support for -disablewallet mode
Diffstat (limited to 'src/qt/walletframe.cpp')
-rw-r--r--src/qt/walletframe.cpp29
1 files changed, 20 insertions, 9 deletions
diff --git a/src/qt/walletframe.cpp b/src/qt/walletframe.cpp
index 04eea59169..fead022928 100644
--- a/src/qt/walletframe.cpp
+++ b/src/qt/walletframe.cpp
@@ -10,6 +10,7 @@
#include <cstdio>
#include <QHBoxLayout>
+#include <QLabel>
WalletFrame::WalletFrame(BitcoinGUI *_gui) :
QFrame(_gui),
@@ -21,6 +22,10 @@ WalletFrame::WalletFrame(BitcoinGUI *_gui) :
walletStack = new QStackedWidget(this);
walletFrameLayout->setContentsMargins(0,0,0,0);
walletFrameLayout->addWidget(walletStack);
+
+ QLabel *noWallet = new QLabel(tr("No wallet has been loaded."));
+ noWallet->setAlignment(Qt::AlignCenter);
+ walletStack->addWidget(noWallet);
}
WalletFrame::~WalletFrame()
@@ -85,7 +90,7 @@ void WalletFrame::removeAllWallets()
bool WalletFrame::handlePaymentRequest(const SendCoinsRecipient &recipient)
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (!walletView)
return false;
@@ -130,56 +135,62 @@ void WalletFrame::gotoSendCoinsPage(QString addr)
void WalletFrame::gotoSignMessageTab(QString addr)
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (walletView)
walletView->gotoSignMessageTab(addr);
}
void WalletFrame::gotoVerifyMessageTab(QString addr)
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (walletView)
walletView->gotoVerifyMessageTab(addr);
}
void WalletFrame::encryptWallet(bool status)
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (walletView)
walletView->encryptWallet(status);
}
void WalletFrame::backupWallet()
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (walletView)
walletView->backupWallet();
}
void WalletFrame::changePassphrase()
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (walletView)
walletView->changePassphrase();
}
void WalletFrame::unlockWallet()
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (walletView)
walletView->unlockWallet();
}
void WalletFrame::usedSendingAddresses()
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (walletView)
walletView->usedSendingAddresses();
}
void WalletFrame::usedReceivingAddresses()
{
- WalletView *walletView = (WalletView*)walletStack->currentWidget();
+ WalletView *walletView = currentWalletView();
if (walletView)
walletView->usedReceivingAddresses();
}
+
+WalletView *WalletFrame::currentWalletView()
+{
+ return qobject_cast<WalletView*>(walletStack->currentWidget());
+}
+