2013-03-22 18:32:49 +01:00
|
|
|
/*
|
|
|
|
* Qt4 bitcoin GUI.
|
|
|
|
*
|
|
|
|
* W.J. van der Laan 2011-2012
|
|
|
|
* The Bitcoin Developers 2011-2013
|
|
|
|
*/
|
|
|
|
#ifndef WALLETSTACK_H
|
|
|
|
#define WALLETSTACK_H
|
|
|
|
|
|
|
|
#include <QStackedWidget>
|
|
|
|
#include <QMap>
|
|
|
|
#include <boost/shared_ptr.hpp>
|
|
|
|
|
|
|
|
class BitcoinGUI;
|
|
|
|
class TransactionTableModel;
|
|
|
|
class ClientModel;
|
|
|
|
class WalletModel;
|
|
|
|
class WalletView;
|
|
|
|
class TransactionView;
|
|
|
|
class OverviewPage;
|
|
|
|
class AddressBookPage;
|
|
|
|
class SendCoinsDialog;
|
2013-07-22 08:50:39 +02:00
|
|
|
class SendCoinsRecipient;
|
2013-03-22 18:32:49 +01:00
|
|
|
class SignVerifyMessageDialog;
|
|
|
|
class Notificator;
|
|
|
|
class RPCConsole;
|
|
|
|
|
|
|
|
class CWalletManager;
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QLabel;
|
|
|
|
class QModelIndex;
|
|
|
|
QT_END_NAMESPACE
|
|
|
|
|
|
|
|
/*
|
|
|
|
WalletStack class. This class is a container for WalletView instances. It takes the place of centralWidget.
|
|
|
|
It was added to support multiple wallet functionality. It communicates with both the client and the
|
|
|
|
wallet models to give the user an up-to-date view of the current core state. It manages all the wallet views
|
|
|
|
it contains and updates them accordingly.
|
|
|
|
*/
|
|
|
|
class WalletStack : public QStackedWidget
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-05-31 14:02:24 +02:00
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
public:
|
|
|
|
explicit WalletStack(QWidget *parent = 0);
|
|
|
|
~WalletStack();
|
|
|
|
|
|
|
|
void setBitcoinGUI(BitcoinGUI *gui) { this->gui = gui; }
|
2013-04-01 14:43:50 +02:00
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
void setClientModel(ClientModel *clientModel) { this->clientModel = clientModel; }
|
2013-04-01 14:43:50 +02:00
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
bool addWallet(const QString& name, WalletModel *walletModel);
|
|
|
|
bool removeWallet(const QString& name);
|
2013-04-01 14:43:50 +02:00
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
void removeAllWallets();
|
|
|
|
|
2013-07-22 08:50:39 +02:00
|
|
|
bool handlePaymentRequest(const SendCoinsRecipient &recipient);
|
2013-04-01 14:43:50 +02:00
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
void showOutOfSyncWarning(bool fShow);
|
|
|
|
|
|
|
|
private:
|
|
|
|
BitcoinGUI *gui;
|
|
|
|
ClientModel *clientModel;
|
|
|
|
QMap<QString, WalletView*> mapWalletViews;
|
|
|
|
|
|
|
|
bool bOutOfSync;
|
|
|
|
|
|
|
|
public slots:
|
2013-08-02 13:53:03 +02:00
|
|
|
bool setCurrentWallet(const QString& name);
|
2013-03-22 18:32:49 +01:00
|
|
|
|
|
|
|
/** Switch to overview (home) page */
|
|
|
|
void gotoOverviewPage();
|
|
|
|
/** Switch to history (transactions) page */
|
|
|
|
void gotoHistoryPage();
|
|
|
|
/** Switch to address book page */
|
|
|
|
void gotoAddressBookPage();
|
|
|
|
/** Switch to receive coins page */
|
|
|
|
void gotoReceiveCoinsPage();
|
|
|
|
/** Switch to send coins page */
|
2013-04-01 14:43:50 +02:00
|
|
|
void gotoSendCoinsPage(QString addr = "");
|
2013-03-22 18:32:49 +01:00
|
|
|
|
|
|
|
/** Show Sign/Verify Message dialog and switch to sign message tab */
|
|
|
|
void gotoSignMessageTab(QString addr = "");
|
|
|
|
/** Show Sign/Verify Message dialog and switch to verify message tab */
|
|
|
|
void gotoVerifyMessageTab(QString addr = "");
|
|
|
|
|
|
|
|
/** Encrypt the wallet */
|
|
|
|
void encryptWallet(bool status);
|
|
|
|
/** Backup the wallet */
|
|
|
|
void backupWallet();
|
|
|
|
/** Change encrypted wallet passphrase */
|
|
|
|
void changePassphrase();
|
|
|
|
/** Ask for passphrase to unlock wallet temporarily */
|
|
|
|
void unlockWallet();
|
|
|
|
|
|
|
|
/** Set the encryption status as shown in the UI.
|
|
|
|
@param[in] status current encryption status
|
|
|
|
@see WalletModel::EncryptionStatus
|
|
|
|
*/
|
|
|
|
void setEncryptionStatus();
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // WALLETSTACK_H
|