2011-05-08 13:23:31 -07:00
|
|
|
#ifndef BITCOINGUI_H
|
|
|
|
#define BITCOINGUI_H
|
2011-05-07 13:13:39 -07:00
|
|
|
|
|
|
|
#include <QMainWindow>
|
2011-05-12 11:16:42 -07:00
|
|
|
#include <QSystemTrayIcon>
|
|
|
|
|
|
|
|
class TransactionTableModel;
|
2011-05-22 08:19:43 -07:00
|
|
|
class ClientModel;
|
2011-06-30 09:05:29 -07:00
|
|
|
class WalletModel;
|
2011-06-28 12:41:56 -07:00
|
|
|
class TransactionView;
|
2011-07-05 13:09:39 -07:00
|
|
|
class OverviewPage;
|
2011-05-13 13:00:27 -07:00
|
|
|
|
|
|
|
QT_BEGIN_NAMESPACE
|
2011-05-12 11:16:42 -07:00
|
|
|
class QLabel;
|
|
|
|
class QLineEdit;
|
2011-06-05 07:03:29 -07:00
|
|
|
class QTableView;
|
|
|
|
class QAbstractItemModel;
|
2011-06-10 06:05:51 -07:00
|
|
|
class QModelIndex;
|
2011-06-18 12:25:38 -07:00
|
|
|
class QProgressBar;
|
2011-07-05 13:09:39 -07:00
|
|
|
class QStackedWidget;
|
2011-05-13 13:00:27 -07:00
|
|
|
QT_END_NAMESPACE
|
2011-05-07 13:13:39 -07:00
|
|
|
|
|
|
|
class BitcoinGUI : public QMainWindow
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2011-05-08 13:23:31 -07:00
|
|
|
explicit BitcoinGUI(QWidget *parent = 0);
|
2011-06-30 09:05:29 -07:00
|
|
|
void setClientModel(ClientModel *clientModel);
|
|
|
|
void setWalletModel(WalletModel *walletModel);
|
2011-05-07 13:13:39 -07:00
|
|
|
|
|
|
|
/* Transaction table tab indices */
|
|
|
|
enum {
|
2011-05-08 13:23:31 -07:00
|
|
|
AllTransactions = 0,
|
|
|
|
SentReceived = 1,
|
|
|
|
Sent = 2,
|
|
|
|
Received = 3
|
2011-05-07 13:13:39 -07:00
|
|
|
} TabIndex;
|
2011-06-05 05:19:57 -07:00
|
|
|
|
|
|
|
protected:
|
|
|
|
void changeEvent(QEvent *e);
|
|
|
|
void closeEvent(QCloseEvent *event);
|
|
|
|
|
2011-05-12 11:16:42 -07:00
|
|
|
private:
|
2011-06-30 09:05:29 -07:00
|
|
|
ClientModel *clientModel;
|
|
|
|
WalletModel *walletModel;
|
2011-05-12 11:16:42 -07:00
|
|
|
|
2011-07-05 13:09:39 -07:00
|
|
|
QStackedWidget *centralWidget;
|
|
|
|
OverviewPage *overviewPage;
|
|
|
|
QWidget *transactionsPage;
|
|
|
|
|
2011-05-12 11:28:07 -07:00
|
|
|
QLabel *labelConnections;
|
2011-06-14 12:34:51 -07:00
|
|
|
QLabel *labelConnectionsIcon;
|
2011-05-12 11:28:07 -07:00
|
|
|
QLabel *labelBlocks;
|
2011-06-18 12:25:38 -07:00
|
|
|
QLabel *progressBarLabel;
|
|
|
|
QProgressBar *progressBar;
|
2011-05-12 11:16:42 -07:00
|
|
|
|
2011-07-05 13:09:39 -07:00
|
|
|
QAction *overviewAction;
|
|
|
|
QAction *historyAction;
|
2011-05-12 11:16:42 -07:00
|
|
|
QAction *quit;
|
2011-07-02 01:13:29 -07:00
|
|
|
QAction *sendCoins;
|
2011-05-12 11:16:42 -07:00
|
|
|
QAction *addressbook;
|
|
|
|
QAction *about;
|
2011-07-02 01:13:29 -07:00
|
|
|
QAction *receiveCoins;
|
2011-05-12 11:16:42 -07:00
|
|
|
QAction *options;
|
2011-06-05 05:19:57 -07:00
|
|
|
QAction *openBitcoin;
|
2011-05-12 11:16:42 -07:00
|
|
|
|
|
|
|
QSystemTrayIcon *trayIcon;
|
2011-06-28 12:41:56 -07:00
|
|
|
TransactionView *transactionView;
|
2011-05-12 11:16:42 -07:00
|
|
|
|
|
|
|
void createActions();
|
|
|
|
QWidget *createTabs();
|
|
|
|
void createTrayIcon();
|
|
|
|
|
2011-05-12 11:28:07 -07:00
|
|
|
public slots:
|
2011-05-27 12:24:17 -07:00
|
|
|
void setBalance(qint64 balance);
|
2011-05-12 11:28:07 -07:00
|
|
|
void setNumConnections(int count);
|
|
|
|
void setNumBlocks(int count);
|
|
|
|
void setNumTransactions(int count);
|
2011-06-05 07:03:29 -07:00
|
|
|
void error(const QString &title, const QString &message);
|
2011-06-10 06:05:51 -07: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 08:36:52 -07:00
|
|
|
void askFee(qint64 nFeeRequired, bool *payFee);
|
2011-05-12 11:28:07 -07:00
|
|
|
|
2011-05-07 13:13:39 -07:00
|
|
|
private slots:
|
2011-07-02 01:13:29 -07:00
|
|
|
void sendCoinsClicked();
|
2011-05-10 10:03:10 -07:00
|
|
|
void addressbookClicked();
|
|
|
|
void optionsClicked();
|
2011-07-02 01:13:29 -07:00
|
|
|
void receiveCoinsClicked();
|
2011-05-12 00:40:40 -07:00
|
|
|
void aboutClicked();
|
2011-06-05 05:19:57 -07:00
|
|
|
void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
|
2011-06-10 06:05:51 -07:00
|
|
|
void transactionDetails(const QModelIndex& idx);
|
2011-06-10 12:59:29 -07:00
|
|
|
void incomingTransaction(const QModelIndex & parent, int start, int end);
|
2011-07-05 13:09:39 -07:00
|
|
|
|
|
|
|
void gotoOverviewTab();
|
|
|
|
void gotoHistoryTab();
|
2011-05-07 13:13:39 -07:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif
|