5 #include <QSystemTrayIcon>
7 class TransactionTableModel;
10 class TransactionView;
12 class AddressBookPage;
13 class SendCoinsDialog;
21 class QAbstractItemModel;
29 Bitcoin GUI main class. This class represents the main window of the Bitcoin UI. It communicates with both the client and
30 wallet models to give the user an up-to-date view of the current core state.
32 class BitcoinGUI : public QMainWindow
36 explicit BitcoinGUI(QWidget *parent = 0);
39 /** Set the client model.
40 The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
42 void setClientModel(ClientModel *clientModel);
43 /** Set the wallet model.
44 The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
47 void setWalletModel(WalletModel *walletModel);
50 void changeEvent(QEvent *e);
51 void closeEvent(QCloseEvent *event);
52 void dragEnterEvent(QDragEnterEvent *event);
53 void dropEvent(QDropEvent *event);
56 ClientModel *clientModel;
57 WalletModel *walletModel;
59 QStackedWidget *centralWidget;
63 OverviewPage *overviewPage;
64 QWidget *transactionsPage;
65 AddressBookPage *addressBookPage;
66 AddressBookPage *receiveCoinsPage;
67 SendCoinsDialog *sendCoinsPage;
68 MessagePage *messagePage;
70 QLabel *labelEncryptionIcon;
71 QLabel *labelConnectionsIcon;
72 QLabel *labelBlocksIcon;
73 QLabel *progressBarLabel;
74 QProgressBar *progressBar;
77 QAction *overviewAction;
78 QAction *historyAction;
80 QAction *sendCoinsAction;
81 QAction *addressBookAction;
82 QAction *messageAction;
84 QAction *receiveCoinsAction;
85 QAction *optionsAction;
86 QAction *openBitcoinAction;
87 QAction *exportAction;
88 QAction *encryptWalletAction;
89 QAction *changePassphraseAction;
90 QAction *aboutQtAction;
92 QSystemTrayIcon *trayIcon;
93 Notificator *notificator;
94 TransactionView *transactionView;
96 QMovie *syncIconMovie;
98 /** Create the main UI actions. */
100 /** Create the menu bar and submenus. */
101 void createMenuBar();
102 /** Create the toolbars */
103 void createToolBars();
104 /** Create system tray (notification) icon */
105 void createTrayIcon();
108 /** Set number of connections shown in the UI */
109 void setNumConnections(int count);
110 /** Set number of blocks shown in the UI */
111 void setNumBlocks(int count);
112 /** Set the encryption status as shown in the UI.
113 @param[in] status current encryption status
114 @see WalletModel::EncryptionStatus
116 void setEncryptionStatus(int status);
117 /** Set the status bar text if there are any warnings (removes sync progress bar if applicable) */
118 void refreshStatusBar();
120 /** Notify the user of an error in the network or transaction handling code. */
121 void error(const QString &title, const QString &message);
122 /** Asks the user whether to pay the transaction fee or to cancel the transaction.
123 It is currently not possible to pass a return value to another thread through
124 BlockingQueuedConnection, so an indirected pointer is used.
125 http://bugreports.qt.nokia.com/browse/QTBUG-10440
127 @param[in] nFeeRequired the required fee
128 @param[out] payFee true to pay the fee, false to not pay the fee
130 void askFee(qint64 nFeeRequired, bool *payFee);
131 void handleURL(QString strURL);
133 void gotoMessagePage();
134 void gotoMessagePage(QString);
139 /** Switch to overview (home) page */
140 void gotoOverviewPage();
141 /** Switch to history (transactions) page */
142 void gotoHistoryPage();
143 /** Switch to address book page */
144 void gotoAddressBookPage();
145 /** Switch to receive coins page */
146 void gotoReceiveCoinsPage();
147 /** Switch to send coins page */
148 void gotoSendCoinsPage();
150 /** Show configuration dialog */
151 void optionsClicked();
152 /** Show about dialog */
155 /** Handle tray icon clicked */
156 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
158 /** Show incoming transaction notification for new transactions.
160 The new items are those between start and end inclusive, under the given parent item.
162 void incomingTransaction(const QModelIndex & parent, int start, int end);
163 /** Encrypt the wallet */
164 void encryptWallet(bool status);
165 /** Change encrypted wallet passphrase */
166 void changePassphrase();
167 /** Ask for pass phrase to unlock wallet temporarily */