|
|
@ -10,6 +10,7 @@ |
|
|
|
#include <cstdio> |
|
|
|
#include <cstdio> |
|
|
|
|
|
|
|
|
|
|
|
#include <QHBoxLayout> |
|
|
|
#include <QHBoxLayout> |
|
|
|
|
|
|
|
#include <QLabel> |
|
|
|
|
|
|
|
|
|
|
|
WalletFrame::WalletFrame(BitcoinGUI *_gui) : |
|
|
|
WalletFrame::WalletFrame(BitcoinGUI *_gui) : |
|
|
|
QFrame(_gui), |
|
|
|
QFrame(_gui), |
|
|
@ -21,6 +22,10 @@ WalletFrame::WalletFrame(BitcoinGUI *_gui) : |
|
|
|
walletStack = new QStackedWidget(this); |
|
|
|
walletStack = new QStackedWidget(this); |
|
|
|
walletFrameLayout->setContentsMargins(0,0,0,0); |
|
|
|
walletFrameLayout->setContentsMargins(0,0,0,0); |
|
|
|
walletFrameLayout->addWidget(walletStack); |
|
|
|
walletFrameLayout->addWidget(walletStack); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QLabel *noWallet = new QLabel(tr("No wallet has been loaded.")); |
|
|
|
|
|
|
|
noWallet->setAlignment(Qt::AlignCenter); |
|
|
|
|
|
|
|
walletStack->addWidget(noWallet); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
WalletFrame::~WalletFrame() |
|
|
|
WalletFrame::~WalletFrame() |
|
|
@ -85,7 +90,7 @@ void WalletFrame::removeAllWallets() |
|
|
|
|
|
|
|
|
|
|
|
bool WalletFrame::handlePaymentRequest(const SendCoinsRecipient &recipient) |
|
|
|
bool WalletFrame::handlePaymentRequest(const SendCoinsRecipient &recipient) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (!walletView) |
|
|
|
if (!walletView) |
|
|
|
return false; |
|
|
|
return false; |
|
|
|
|
|
|
|
|
|
|
@ -130,56 +135,62 @@ void WalletFrame::gotoSendCoinsPage(QString addr) |
|
|
|
|
|
|
|
|
|
|
|
void WalletFrame::gotoSignMessageTab(QString addr) |
|
|
|
void WalletFrame::gotoSignMessageTab(QString addr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (walletView) |
|
|
|
if (walletView) |
|
|
|
walletView->gotoSignMessageTab(addr); |
|
|
|
walletView->gotoSignMessageTab(addr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletFrame::gotoVerifyMessageTab(QString addr) |
|
|
|
void WalletFrame::gotoVerifyMessageTab(QString addr) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (walletView) |
|
|
|
if (walletView) |
|
|
|
walletView->gotoVerifyMessageTab(addr); |
|
|
|
walletView->gotoVerifyMessageTab(addr); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletFrame::encryptWallet(bool status) |
|
|
|
void WalletFrame::encryptWallet(bool status) |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (walletView) |
|
|
|
if (walletView) |
|
|
|
walletView->encryptWallet(status); |
|
|
|
walletView->encryptWallet(status); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletFrame::backupWallet() |
|
|
|
void WalletFrame::backupWallet() |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (walletView) |
|
|
|
if (walletView) |
|
|
|
walletView->backupWallet(); |
|
|
|
walletView->backupWallet(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletFrame::changePassphrase() |
|
|
|
void WalletFrame::changePassphrase() |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (walletView) |
|
|
|
if (walletView) |
|
|
|
walletView->changePassphrase(); |
|
|
|
walletView->changePassphrase(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletFrame::unlockWallet() |
|
|
|
void WalletFrame::unlockWallet() |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (walletView) |
|
|
|
if (walletView) |
|
|
|
walletView->unlockWallet(); |
|
|
|
walletView->unlockWallet(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletFrame::usedSendingAddresses() |
|
|
|
void WalletFrame::usedSendingAddresses() |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (walletView) |
|
|
|
if (walletView) |
|
|
|
walletView->usedSendingAddresses(); |
|
|
|
walletView->usedSendingAddresses(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void WalletFrame::usedReceivingAddresses() |
|
|
|
void WalletFrame::usedReceivingAddresses() |
|
|
|
{ |
|
|
|
{ |
|
|
|
WalletView *walletView = (WalletView*)walletStack->currentWidget(); |
|
|
|
WalletView *walletView = currentWalletView(); |
|
|
|
if (walletView) |
|
|
|
if (walletView) |
|
|
|
walletView->usedReceivingAddresses(); |
|
|
|
walletView->usedReceivingAddresses(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
WalletView *WalletFrame::currentWalletView() |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
return qobject_cast<WalletView*>(walletStack->currentWidget()); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|