Add "About Qt" menu option to show built-in Qt About dialog
[novacoin.git] / src / qt / bitcoingui.h
1 #ifndef BITCOINGUI_H
2 #define BITCOINGUI_H
3
4 #include <QMainWindow>
5 #include <QSystemTrayIcon>
6
7 class TransactionTableModel;
8 class ClientModel;
9 class WalletModel;
10 class TransactionView;
11 class OverviewPage;
12 class AddressBookPage;
13 class SendCoinsDialog;
14 class Notificator;
15
16 QT_BEGIN_NAMESPACE
17 class QLabel;
18 class QLineEdit;
19 class QTableView;
20 class QAbstractItemModel;
21 class QModelIndex;
22 class QProgressBar;
23 class QStackedWidget;
24 class QUrl;
25 QT_END_NAMESPACE
26
27 class BitcoinGUI : public QMainWindow
28 {
29     Q_OBJECT
30 public:
31     explicit BitcoinGUI(QWidget *parent = 0);
32     ~BitcoinGUI();
33
34     void setClientModel(ClientModel *clientModel);
35     void setWalletModel(WalletModel *walletModel);
36     
37     /* Transaction table tab indices */
38     enum {
39         AllTransactions = 0,
40         SentReceived = 1,
41         Sent = 2,
42         Received = 3
43     } TabIndex;
44
45 protected:
46     void changeEvent(QEvent *e);
47     void closeEvent(QCloseEvent *event);
48     void dragEnterEvent(QDragEnterEvent *event);
49     void dropEvent(QDropEvent *event);
50
51 private:
52     ClientModel *clientModel;
53     WalletModel *walletModel;
54
55     QStackedWidget *centralWidget;
56
57     OverviewPage *overviewPage;
58     QWidget *transactionsPage;
59     AddressBookPage *addressBookPage;
60     AddressBookPage *receiveCoinsPage;
61     SendCoinsDialog *sendCoinsPage;
62
63     QLabel *labelEncryptionIcon;
64     QLabel *labelConnectionsIcon;
65     QLabel *labelBlocksIcon;
66     QLabel *progressBarLabel;
67     QProgressBar *progressBar;
68
69     QMenuBar *appMenuBar;
70     QAction *overviewAction;
71     QAction *historyAction;
72     QAction *quitAction;
73     QAction *sendCoinsAction;
74     QAction *addressBookAction;
75     QAction *aboutAction;
76     QAction *receiveCoinsAction;
77     QAction *optionsAction;
78     QAction *openBitcoinAction;
79     QAction *exportAction;
80     QAction *encryptWalletAction;
81     QAction *changePassphraseAction;
82     QAction *aboutQtAction;
83
84     QSystemTrayIcon *trayIcon;
85     Notificator *notificator;
86     TransactionView *transactionView;
87
88     QMovie *syncIconMovie;
89
90     void createActions();
91     void createMenuBar();
92     void createToolBars();
93     QWidget *createTabs();
94     void createTrayIcon();
95
96 public slots:
97     void setNumConnections(int count);
98     void setNumBlocks(int count);
99     void setEncryptionStatus(int status);
100     /** Set the status bar text if there are any warnings (removes sync progress bar if applicable) */
101     void refreshStatusBar();
102
103     void error(const QString &title, const QString &message);
104     /* It is currently not possible to pass a return value to another thread through
105        BlockingQueuedConnection, so use an indirected pointer.
106        http://bugreports.qt.nokia.com/browse/QTBUG-10440
107     */
108     void askFee(qint64 nFeeRequired, bool *payFee);
109
110 private slots:
111     // UI pages
112     void gotoOverviewPage();
113     void gotoHistoryPage();
114     void gotoAddressBookPage();
115     void gotoReceiveCoinsPage();
116     void gotoSendCoinsPage();
117
118     // Misc actions
119     void optionsClicked();
120     void aboutClicked();
121 #ifndef Q_WS_MAC
122     void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
123 #endif
124     void incomingTransaction(const QModelIndex & parent, int start, int end);
125     void encryptWallet(bool status);
126     void changePassphrase();
127     void unlockWallet();
128 };
129
130 #endif