2011-05-08 22:23:31 +02:00
|
|
|
#ifndef BITCOINGUI_H
|
|
|
|
#define BITCOINGUI_H
|
2011-05-07 22:13:39 +02:00
|
|
|
|
|
|
|
#include <QMainWindow>
|
2011-05-12 20:16:42 +02:00
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
|
|
|
|
class TransactionTableModel;
|
2011-05-22 17:19:43 +02:00
|
|
|
class ClientModel;
|
2011-06-30 18:05:29 +02:00
|
|
|
class WalletModel;
|
2011-06-28 21:41:56 +02:00
|
|
|
class TransactionView;
|
2011-07-05 22:09:39 +02:00
|
|
|
class OverviewPage;
|
2011-07-07 17:33:15 +02:00
|
|
|
class AddressBookPage;
|
|
|
|
class SendCoinsDialog;
|
2011-09-03 20:52:54 +02:00
|
|
|
class Notificator;
|
2011-05-13 22:00:27 +02:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
2011-05-12 20:16:42 +02:00
|
|
|
class QLabel;
|
|
|
|
class QLineEdit;
|
2011-06-05 16:03:29 +02:00
|
|
|
class QTableView;
|
|
|
|
class QAbstractItemModel;
|
2011-06-10 15:05:51 +02:00
|
|
|
class QModelIndex;
|
2011-06-18 21:25:38 +02:00
|
|
|
class QProgressBar;
|
2011-07-05 22:09:39 +02:00
|
|
|
class QStackedWidget;
|
2011-08-07 16:04:48 +02:00
|
|
|
class QUrl;
|
2011-05-13 22:00:27 +02:00
|
|
|
QT_END_NAMESPACE
|
2011-05-07 22:13:39 +02:00
|
|
|
|
|
|
|
class BitcoinGUI : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2011-05-08 22:23:31 +02:00
|
|
|
explicit BitcoinGUI(QWidget *parent = 0);
|
2011-06-30 18:05:29 +02:00
|
|
|
void setClientModel(ClientModel *clientModel);
|
|
|
|
void setWalletModel(WalletModel *walletModel);
|
2011-05-07 22:13:39 +02:00
|
|
|
|
|
|
|
/* Transaction table tab indices */
|
|
|
|
enum {
|
2011-05-08 22:23:31 +02:00
|
|
|
AllTransactions = 0,
|
|
|
|
SentReceived = 1,
|
|
|
|
Sent = 2,
|
|
|
|
Received = 3
|
2011-05-07 22:13:39 +02:00
|
|
|
} TabIndex;
|
2011-06-05 14:19:57 +02:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void changeEvent(QEvent *e);
|
|
|
|
void closeEvent(QCloseEvent *event);
|
2011-08-07 16:04:48 +02:00
|
|
|
void dragEnterEvent(QDragEnterEvent *event);
|
|
|
|
void dropEvent(QDropEvent *event);
|
2011-06-05 14:19:57 +02:00
|
|
|
|
2011-05-12 20:16:42 +02:00
|
|
|
private:
|
2011-06-30 18:05:29 +02:00
|
|
|
ClientModel *clientModel;
|
|
|
|
WalletModel *walletModel;
|
2011-05-12 20:16:42 +02:00
|
|
|
|
2011-07-05 22:09:39 +02:00
|
|
|
QStackedWidget *centralWidget;
|
2011-07-07 17:33:15 +02:00
|
|
|
|
2011-07-05 22:09:39 +02:00
|
|
|
OverviewPage *overviewPage;
|
|
|
|
QWidget *transactionsPage;
|
2011-07-07 17:33:15 +02:00
|
|
|
AddressBookPage *addressBookPage;
|
|
|
|
AddressBookPage *receiveCoinsPage;
|
|
|
|
SendCoinsDialog *sendCoinsPage;
|
2011-07-05 22:09:39 +02:00
|
|
|
|
2011-08-23 20:08:42 +02:00
|
|
|
QLabel *labelEncryptionIcon;
|
2011-06-14 21:34:51 +02:00
|
|
|
QLabel *labelConnectionsIcon;
|
2011-07-17 17:30:58 +02:00
|
|
|
QLabel *labelBlocksIcon;
|
2011-06-18 21:25:38 +02:00
|
|
|
QLabel *progressBarLabel;
|
|
|
|
QProgressBar *progressBar;
|
2011-05-12 20:16:42 +02:00
|
|
|
|
2011-07-05 22:09:39 +02:00
|
|
|
QAction *overviewAction;
|
|
|
|
QAction *historyAction;
|
2011-07-07 17:33:15 +02:00
|
|
|
QAction *quitAction;
|
|
|
|
QAction *sendCoinsAction;
|
|
|
|
QAction *addressBookAction;
|
|
|
|
QAction *aboutAction;
|
|
|
|
QAction *receiveCoinsAction;
|
|
|
|
QAction *optionsAction;
|
|
|
|
QAction *openBitcoinAction;
|
2011-07-07 14:27:16 +02:00
|
|
|
QAction *exportAction;
|
2011-08-24 22:07:26 +02:00
|
|
|
QAction *encryptWalletAction;
|
|
|
|
QAction *changePassphraseAction;
|
2011-05-12 20:16:42 +02:00
|
|
|
|
|
|
|
QSystemTrayIcon *trayIcon;
|
2011-09-03 20:52:54 +02:00
|
|
|
Notificator *notificator;
|
2011-06-28 21:41:56 +02:00
|
|
|
TransactionView *transactionView;
|
2011-05-12 20:16:42 +02:00
|
|
|
|
2011-07-17 17:30:58 +02:00
|
|
|
QMovie *syncIconMovie;
|
|
|
|
|
2011-05-12 20:16:42 +02:00
|
|
|
void createActions();
|
|
|
|
QWidget *createTabs();
|
|
|
|
void createTrayIcon();
|
|
|
|
|
2011-05-12 20:28:07 +02:00
|
|
|
public slots:
|
|
|
|
void setNumConnections(int count);
|
|
|
|
void setNumBlocks(int count);
|
2011-08-23 20:08:42 +02:00
|
|
|
void setEncryptionStatus(int status);
|
|
|
|
|
2011-06-05 16:03:29 +02:00
|
|
|
void error(const QString &title, const QString &message);
|
2011-06-10 15:05:51 +02:00
|
|
|
/* It is currently not possible to pass a return value to another thread through
|
|
|
|
BlockingQueuedConnection, so use an indirected pointer.
|
|
|
|
http://bugreports.qt.nokia.com/browse/QTBUG-10440
|
|
|
|
*/
|
2011-06-05 17:36:52 +02:00
|
|
|
void askFee(qint64 nFeeRequired, bool *payFee);
|
2011-05-12 20:28:07 +02:00
|
|
|
|
2011-05-07 22:13:39 +02:00
|
|
|
private slots:
|
2011-07-07 17:33:15 +02:00
|
|
|
// UI pages
|
|
|
|
void gotoOverviewPage();
|
|
|
|
void gotoHistoryPage();
|
|
|
|
void gotoAddressBookPage();
|
|
|
|
void gotoReceiveCoinsPage();
|
|
|
|
void gotoSendCoinsPage();
|
|
|
|
|
|
|
|
// Misc actions
|
2011-05-10 19:03:10 +02:00
|
|
|
void optionsClicked();
|
2011-05-12 09:40:40 +02:00
|
|
|
void aboutClicked();
|
2011-06-05 14:19:57 +02:00
|
|
|
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
|
2011-06-10 21:59:29 +02:00
|
|
|
void incomingTransaction(const QModelIndex & parent, int start, int end);
|
2011-08-24 22:07:26 +02:00
|
|
|
void encryptWallet(bool status);
|
|
|
|
void changePassphrase();
|
|
|
|
void unlockWallet();
|
2011-05-07 22:13:39 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|