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;
61 OverviewPage *overviewPage;
62 QWidget *transactionsPage;
63 AddressBookPage *addressBookPage;
64 AddressBookPage *receiveCoinsPage;
65 SendCoinsDialog *sendCoinsPage;
66 MessagePage *messagePage;
68 QLabel *labelEncryptionIcon;
69 QLabel *labelConnectionsIcon;
70 QLabel *labelBlocksIcon;
71 QLabel *progressBarLabel;
72 QProgressBar *progressBar;
75 QAction *overviewAction;
76 QAction *historyAction;
78 QAction *sendCoinsAction;
79 QAction *addressBookAction;
80 QAction *messageAction;
82 QAction *receiveCoinsAction;
83 QAction *optionsAction;
84 QAction *openBitcoinAction;
85 QAction *exportAction;
86 QAction *encryptWalletAction;
87 QAction *changePassphraseAction;
88 QAction *aboutQtAction;
90 QSystemTrayIcon *trayIcon;
91 Notificator *notificator;
92 TransactionView *transactionView;
94 QMovie *syncIconMovie;
96 /** Create the main UI actions. */
98 /** Create the menu bar and submenus. */
100 /** Create the toolbars */
101 void createToolBars();
102 /** Create system tray (notification) icon */
103 void createTrayIcon();
106 /** Set number of connections shown in the UI */
107 void setNumConnections(int count);
108 /** Set number of blocks shown in the UI */
109 void setNumBlocks(int count);
110 /** Set the encryption status as shown in the UI.
111 @param[in] status current encryption status
112 @see WalletModel::EncryptionStatus
114 void setEncryptionStatus(int status);
115 /** Set the status bar text if there are any warnings (removes sync progress bar if applicable) */
116 void refreshStatusBar();
118 /** Notify the user of an error in the network or transaction handling code. */
119 void error(const QString &title, const QString &message);
120 /** Asks the user whether to pay the transaction fee or to cancel the transaction.
121 It is currently not possible to pass a return value to another thread through
122 BlockingQueuedConnection, so an indirected pointer is used.
123 http://bugreports.qt.nokia.com/browse/QTBUG-10440
125 @param[in] nFeeRequired the required fee
126 @param[out] payFee true to pay the fee, false to not pay the fee
128 void askFee(qint64 nFeeRequired, bool *payFee);
129 void handleURL(QString strURL);
131 void gotoMessagePage();
132 void gotoMessagePage(QString);
135 /** Switch to overview (home) page */
136 void gotoOverviewPage();
137 /** Switch to history (transactions) page */
138 void gotoHistoryPage();
139 /** Switch to address book page */
140 void gotoAddressBookPage();
141 /** Switch to receive coins page */
142 void gotoReceiveCoinsPage();
143 /** Switch to send coins page */
144 void gotoSendCoinsPage();
146 /** Show configuration dialog */
147 void optionsClicked();
148 /** Show about dialog */
151 /** Handle tray icon clicked */
152 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
154 /** Show incoming transaction notification for new transactions.
156 The new items are those between start and end inclusive, under the given parent item.
158 void incomingTransaction(const QModelIndex & parent, int start, int end);
159 /** Encrypt the wallet */
160 void encryptWallet(bool status);
161 /** Change encrypted wallet passphrase */
162 void changePassphrase();
163 /** Ask for pass phrase to unlock wallet temporarily */