|
|
|
@ -7,9 +7,11 @@
@@ -7,9 +7,11 @@
|
|
|
|
|
#include "walletframe.h" |
|
|
|
|
#include "bitcoingui.h" |
|
|
|
|
#include "walletstack.h" |
|
|
|
|
#include "walletview.h" |
|
|
|
|
|
|
|
|
|
#include <QHBoxLayout> |
|
|
|
|
#include <QMessageBox> |
|
|
|
|
#include <QLabel> |
|
|
|
|
|
|
|
|
|
WalletFrame::WalletFrame(BitcoinGUI *_gui) : |
|
|
|
|
QFrame(_gui), |
|
|
|
@ -23,6 +25,10 @@ WalletFrame::WalletFrame(BitcoinGUI *_gui) :
@@ -23,6 +25,10 @@ WalletFrame::WalletFrame(BitcoinGUI *_gui) :
|
|
|
|
|
walletStack->setBitcoinGUI(gui); |
|
|
|
|
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() |
|
|
|
@ -54,6 +60,10 @@ void WalletFrame::removeAllWallets()
@@ -54,6 +60,10 @@ void WalletFrame::removeAllWallets()
|
|
|
|
|
|
|
|
|
|
bool WalletFrame::handleURI(const QString &uri) |
|
|
|
|
{ |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (!walletView) |
|
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
return walletStack->handleURI(uri); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
@ -80,7 +90,9 @@ void WalletFrame::gotoHistoryPage()
@@ -80,7 +90,9 @@ void WalletFrame::gotoHistoryPage()
|
|
|
|
|
|
|
|
|
|
void WalletFrame::gotoAddressBookPage() |
|
|
|
|
{ |
|
|
|
|
walletStack->gotoAddressBookPage(); |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (walletView) |
|
|
|
|
walletStack->gotoAddressBookPage(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WalletFrame::gotoReceiveCoinsPage() |
|
|
|
@ -95,35 +107,55 @@ void WalletFrame::gotoSendCoinsPage(QString addr)
@@ -95,35 +107,55 @@ void WalletFrame::gotoSendCoinsPage(QString addr)
|
|
|
|
|
|
|
|
|
|
void WalletFrame::gotoSignMessageTab(QString addr) |
|
|
|
|
{ |
|
|
|
|
walletStack->gotoSignMessageTab(addr); |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (walletView) |
|
|
|
|
walletView->gotoSignMessageTab(addr); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WalletFrame::gotoVerifyMessageTab(QString addr) |
|
|
|
|
{ |
|
|
|
|
walletStack->gotoSignMessageTab(addr); |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (walletView) |
|
|
|
|
walletView->gotoVerifyMessageTab(addr); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WalletFrame::encryptWallet(bool status) |
|
|
|
|
{ |
|
|
|
|
walletStack->encryptWallet(status); |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (walletView) |
|
|
|
|
walletView->encryptWallet(status); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WalletFrame::backupWallet() |
|
|
|
|
{ |
|
|
|
|
walletStack->backupWallet(); |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (walletView) |
|
|
|
|
walletView->backupWallet(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WalletFrame::changePassphrase() |
|
|
|
|
{ |
|
|
|
|
walletStack->changePassphrase(); |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (walletView) |
|
|
|
|
walletView->changePassphrase(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WalletFrame::unlockWallet() |
|
|
|
|
{ |
|
|
|
|
walletStack->unlockWallet(); |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (walletView) |
|
|
|
|
walletView->unlockWallet(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
void WalletFrame::setEncryptionStatus() |
|
|
|
|
{ |
|
|
|
|
walletStack->setEncryptionStatus(); |
|
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
|
if (walletView) |
|
|
|
|
walletStack->setEncryptionStatus(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
WalletView *WalletFrame::currentWalletView() |
|
|
|
|
{ |
|
|
|
|
return qobject_cast<WalletView*>(walletStack->currentWidget()); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|