2013-03-22 18:32:49 +01:00
|
|
|
/*
|
|
|
|
* Qt4 bitcoin GUI.
|
|
|
|
*
|
|
|
|
* W.J. van der Laan 2011-2012
|
|
|
|
* The Bitcoin Developers 2011-2013
|
|
|
|
*/
|
|
|
|
#include "walletframe.h"
|
|
|
|
#include "bitcoingui.h"
|
|
|
|
#include "walletstack.h"
|
|
|
|
|
2013-05-31 14:02:24 +02:00
|
|
|
#include <QHBoxLayout>
|
2013-03-22 18:32:49 +01:00
|
|
|
#include <QMessageBox>
|
|
|
|
|
|
|
|
WalletFrame::WalletFrame(BitcoinGUI *_gui) :
|
2013-08-02 13:53:03 +02:00
|
|
|
QFrame(_gui)
|
2013-03-22 18:32:49 +01:00
|
|
|
{
|
|
|
|
// Leave HBox hook for adding a list view later
|
|
|
|
QHBoxLayout *walletFrameLayout = new QHBoxLayout(this);
|
2013-04-26 07:38:24 +02:00
|
|
|
setContentsMargins(0,0,0,0);
|
2013-03-22 18:32:49 +01:00
|
|
|
walletStack = new WalletStack(this);
|
2013-08-02 13:53:03 +02:00
|
|
|
walletStack->setBitcoinGUI(_gui);
|
2013-04-26 07:38:24 +02:00
|
|
|
walletFrameLayout->setContentsMargins(0,0,0,0);
|
2013-03-22 18:32:49 +01:00
|
|
|
walletFrameLayout->addWidget(walletStack);
|
|
|
|
}
|
|
|
|
|
|
|
|
WalletFrame::~WalletFrame()
|
|
|
|
{
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::setClientModel(ClientModel *clientModel)
|
|
|
|
{
|
2013-08-02 13:53:03 +02:00
|
|
|
if (clientModel)
|
|
|
|
walletStack->setClientModel(clientModel);
|
2013-03-22 18:32:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
bool WalletFrame::addWallet(const QString& name, WalletModel *walletModel)
|
|
|
|
{
|
|
|
|
return walletStack->addWallet(name, walletModel);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool WalletFrame::setCurrentWallet(const QString& name)
|
|
|
|
{
|
|
|
|
// TODO: Check if valid name
|
2013-08-02 13:53:03 +02:00
|
|
|
return walletStack->setCurrentWallet(name);
|
2013-03-22 18:32:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::removeAllWallets()
|
|
|
|
{
|
|
|
|
walletStack->removeAllWallets();
|
|
|
|
}
|
|
|
|
|
2013-07-22 08:50:39 +02:00
|
|
|
bool WalletFrame::handlePaymentRequest(const SendCoinsRecipient &recipient)
|
2013-03-22 18:32:49 +01:00
|
|
|
{
|
2013-07-22 08:50:39 +02:00
|
|
|
return walletStack->handlePaymentRequest(recipient);
|
2013-03-22 18:32:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::showOutOfSyncWarning(bool fShow)
|
|
|
|
{
|
2013-09-29 12:28:43 +02:00
|
|
|
if (!walletStack)
|
2013-03-22 18:32:49 +01:00
|
|
|
return;
|
2013-09-29 12:28:43 +02:00
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
walletStack->showOutOfSyncWarning(fShow);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::gotoOverviewPage()
|
|
|
|
{
|
|
|
|
walletStack->gotoOverviewPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::gotoHistoryPage()
|
|
|
|
{
|
|
|
|
walletStack->gotoHistoryPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::gotoAddressBookPage()
|
|
|
|
{
|
|
|
|
walletStack->gotoAddressBookPage();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::gotoReceiveCoinsPage()
|
|
|
|
{
|
|
|
|
walletStack->gotoReceiveCoinsPage();
|
|
|
|
}
|
|
|
|
|
2013-04-01 14:43:50 +02:00
|
|
|
void WalletFrame::gotoSendCoinsPage(QString addr)
|
2013-03-22 18:32:49 +01:00
|
|
|
{
|
2013-04-01 14:43:50 +02:00
|
|
|
walletStack->gotoSendCoinsPage(addr);
|
2013-03-22 18:32:49 +01:00
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::gotoSignMessageTab(QString addr)
|
|
|
|
{
|
|
|
|
walletStack->gotoSignMessageTab(addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::gotoVerifyMessageTab(QString addr)
|
|
|
|
{
|
|
|
|
walletStack->gotoSignMessageTab(addr);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::encryptWallet(bool status)
|
|
|
|
{
|
|
|
|
walletStack->encryptWallet(status);
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::backupWallet()
|
|
|
|
{
|
|
|
|
walletStack->backupWallet();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::changePassphrase()
|
|
|
|
{
|
|
|
|
walletStack->changePassphrase();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::unlockWallet()
|
|
|
|
{
|
|
|
|
walletStack->unlockWallet();
|
|
|
|
}
|
|
|
|
|
|
|
|
void WalletFrame::setEncryptionStatus()
|
|
|
|
{
|
|
|
|
walletStack->setEncryptionStatus();
|
|
|
|
}
|