2018-07-26 18:36:45 -04:00
|
|
|
// Copyright (c) 2011-2017 The Bitcoin Core developers
|
2014-12-13 01:09:33 -03:00
|
|
|
// Distributed under the MIT software license, see the accompanying
|
2013-11-04 12:20:43 -03:00
|
|
|
// file COPYING or http://www.opensource.org/licenses/mit-license.php.
|
|
|
|
|
2014-11-03 12:16:40 -03:00
|
|
|
#ifndef BITCOIN_QT_WALLETFRAME_H
|
|
|
|
#define BITCOIN_QT_WALLETFRAME_H
|
2013-03-22 14:32:49 -03:00
|
|
|
|
|
|
|
#include <QFrame>
|
2013-10-18 13:05:26 -03:00
|
|
|
#include <QMap>
|
2013-03-22 14:32:49 -03:00
|
|
|
|
|
|
|
class BitcoinGUI;
|
|
|
|
class ClientModel;
|
2015-07-28 10:20:14 -03:00
|
|
|
class PlatformStyle;
|
2013-07-22 02:50:39 -04:00
|
|
|
class SendCoinsRecipient;
|
2013-03-22 14:32:49 -03:00
|
|
|
class WalletModel;
|
2013-10-18 13:05:26 -03:00
|
|
|
class WalletView;
|
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
|
|
|
class QStackedWidget;
|
|
|
|
QT_END_NAMESPACE
|
2013-03-22 14:32:49 -03:00
|
|
|
|
2016-09-21 07:21:13 -03:00
|
|
|
/**
|
|
|
|
* A container for embedding all wallet-related
|
|
|
|
* controls into BitcoinGUI. The purpose of this class is to allow future
|
|
|
|
* refinements of the wallet controls with minimal need for further
|
|
|
|
* modifications to BitcoinGUI, thus greatly simplifying merges while
|
|
|
|
* reducing the risk of breaking top-level stuff.
|
|
|
|
*/
|
2013-03-22 14:32:49 -03:00
|
|
|
class WalletFrame : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
2013-05-31 08:02:24 -04:00
|
|
|
|
2013-03-22 14:32:49 -03:00
|
|
|
public:
|
2015-07-28 10:20:14 -03:00
|
|
|
explicit WalletFrame(const PlatformStyle *platformStyle, BitcoinGUI *_gui = 0);
|
2013-03-22 14:32:49 -03:00
|
|
|
~WalletFrame();
|
|
|
|
|
|
|
|
void setClientModel(ClientModel *clientModel);
|
|
|
|
|
2017-10-12 04:22:48 -03:00
|
|
|
bool addWallet(WalletModel *walletModel);
|
2013-03-22 14:32:49 -03:00
|
|
|
bool setCurrentWallet(const QString& name);
|
2013-10-18 13:43:07 -03:00
|
|
|
bool removeWallet(const QString &name);
|
2013-03-22 14:32:49 -03:00
|
|
|
void removeAllWallets();
|
|
|
|
|
2013-07-22 02:50:39 -04:00
|
|
|
bool handlePaymentRequest(const SendCoinsRecipient& recipient);
|
2013-03-22 14:32:49 -03:00
|
|
|
|
|
|
|
void showOutOfSyncWarning(bool fShow);
|
|
|
|
|
2016-07-19 09:27:14 -04:00
|
|
|
Q_SIGNALS:
|
|
|
|
/** Notify that the user has requested more information about the out-of-sync warning */
|
2016-09-21 05:29:57 -03:00
|
|
|
void requestedSyncWarningInfo();
|
2016-07-19 09:27:14 -04:00
|
|
|
|
2013-03-22 14:32:49 -03:00
|
|
|
private:
|
2013-10-18 13:05:26 -03:00
|
|
|
QStackedWidget *walletStack;
|
|
|
|
BitcoinGUI *gui;
|
|
|
|
ClientModel *clientModel;
|
|
|
|
QMap<QString, WalletView*> mapWalletViews;
|
|
|
|
|
|
|
|
bool bOutOfSync;
|
2013-03-22 14:32:49 -03:00
|
|
|
|
2015-07-28 10:20:14 -03:00
|
|
|
const PlatformStyle *platformStyle;
|
|
|
|
|
2016-10-24 04:21:51 -03:00
|
|
|
public:
|
2013-11-12 10:54:43 -03:00
|
|
|
WalletView *currentWalletView();
|
|
|
|
|
2015-07-14 08:59:05 -03:00
|
|
|
public Q_SLOTS:
|
2013-03-22 14:32:49 -03:00
|
|
|
/** 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 09:43:50 -03:00
|
|
|
void gotoSendCoinsPage(QString addr = "");
|
2013-03-22 14:32:49 -03: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 10:14:26 -03:00
|
|
|
/** Show used sending addresses */
|
|
|
|
void usedSendingAddresses();
|
|
|
|
/** Show used receiving addresses */
|
|
|
|
void usedReceivingAddresses();
|
2016-07-19 09:27:14 -04:00
|
|
|
/** Pass on signal over requested out-of-sync-warning information */
|
|
|
|
void outOfSyncWarningClicked();
|
2013-03-22 14:32:49 -03:00
|
|
|
};
|
|
|
|
|
2014-11-03 12:16:40 -03:00
|
|
|
#endif // BITCOIN_QT_WALLETFRAME_H
|