2013-11-04 16:20:43 +01:00
|
|
|
// Copyright (c) 2011-2013 The Bitcoin developers
|
|
|
|
// Distributed under the MIT/X11 software license, see the accompanying
|
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
#ifndef WALLETFRAME_H
|
|
|
|
#define WALLETFRAME_H
|
|
|
|
|
|
|
|
#include <QFrame>
|
2013-10-18 18:05:26 +02:00
|
|
|
#include <QMap>
|
2013-03-22 18:32:49 +01:00
|
|
|
|
|
|
|
class BitcoinGUI;
|
|
|
|
class ClientModel;
|
2013-07-22 08:50:39 +02:00
|
|
|
class SendCoinsRecipient;
|
2013-03-22 18:32:49 +01:00
|
|
|
class WalletModel;
|
2013-10-18 18:05:26 +02:00
|
|
|
class WalletView;
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QStackedWidget;
|
|
|
|
QT_END_NAMESPACE
|
2013-03-22 18:32:49 +01:00
|
|
|
|
|
|
|
class WalletFrame : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-05-31 14:02:24 +02:00
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
public:
|
2013-05-31 14:02:24 +02:00
|
|
|
explicit WalletFrame(BitcoinGUI *_gui = 0);
|
2013-03-22 18:32:49 +01:00
|
|
|
~WalletFrame();
|
|
|
|
|
|
|
|
void setClientModel(ClientModel *clientModel);
|
|
|
|
|
|
|
|
bool addWallet(const QString& name, WalletModel *walletModel);
|
|
|
|
bool setCurrentWallet(const QString& name);
|
2013-10-18 18:43:07 +02:00
|
|
|
bool removeWallet(const QString &name);
|
2013-03-22 18:32:49 +01:00
|
|
|
void removeAllWallets();
|
|
|
|
|
2013-07-22 08:50:39 +02:00
|
|
|
bool handlePaymentRequest(const SendCoinsRecipient& recipient);
|
2013-03-22 18:32:49 +01:00
|
|
|
|
|
|
|
void showOutOfSyncWarning(bool fShow);
|
|
|
|
|
|
|
|
private:
|
2013-10-18 18:05:26 +02:00
|
|
|
QStackedWidget *walletStack;
|
|
|
|
BitcoinGUI *gui;
|
|
|
|
ClientModel *clientModel;
|
|
|
|
QMap<QString, WalletView*> mapWalletViews;
|
|
|
|
|
|
|
|
bool bOutOfSync;
|
2013-03-22 18:32:49 +01:00
|
|
|
|
2013-11-12 14:54:43 +01:00
|
|
|
WalletView *currentWalletView();
|
|
|
|
|
2013-03-22 18:32:49 +01:00
|
|
|
public slots:
|
|
|
|
/** Switch to overview (home) page */
|
|
|
|
void gotoOverviewPage();
|
|
|
|
/** Switch to history (transactions) page */
|
|
|
|
void gotoHistoryPage();
|
|
|
|
/** 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();
|
|
|
|
|
2013-10-16 15:14:26 +02:00
|
|
|
/** Show used sending addresses */
|
|
|
|
void usedSendingAddresses();
|
|
|
|
/** Show used receiving addresses */
|
|
|
|
void usedReceivingAddresses();
|
2013-03-22 18:32:49 +01:00
|
|
|
};
|
|
|
|
|
2013-07-22 08:50:39 +02:00
|
|
|
#endif // WALLETFRAME_H
|