5 #include <QSystemTrayIcon>
7 class TransactionTableModel;
10 class TransactionView;
12 class AddressBookPage;
13 class SendCoinsDialog;
20 class QAbstractItemModel;
28 Bitcoin GUI main class. This class represents the main window of the Bitcoin UI. It communicates with both the client and
29 wallet models to give the user an up-to-date view of the current core state.
31 class BitcoinGUI : public QMainWindow
35 explicit BitcoinGUI(QWidget *parent = 0);
38 /** Set the client model.
39 The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
41 void setClientModel(ClientModel *clientModel);
42 /** Set the wallet model.
43 The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
46 void setWalletModel(WalletModel *walletModel);
49 void changeEvent(QEvent *e);
50 void closeEvent(QCloseEvent *event);
51 void dragEnterEvent(QDragEnterEvent *event);
52 void dropEvent(QDropEvent *event);
55 ClientModel *clientModel;
56 WalletModel *walletModel;
58 QStackedWidget *centralWidget;
62 OverviewPage *overviewPage;
63 QWidget *transactionsPage;
64 AddressBookPage *addressBookPage;
65 AddressBookPage *receiveCoinsPage;
66 SendCoinsDialog *sendCoinsPage;
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;
81 QAction *receiveCoinsAction;
82 QAction *optionsAction;
83 QAction *openBitcoinAction;
84 QAction *exportAction;
85 QAction *encryptWalletAction;
86 QAction *changePassphraseAction;
87 QAction *aboutQtAction;
89 QSystemTrayIcon *trayIcon;
90 Notificator *notificator;
91 TransactionView *transactionView;
93 QMovie *syncIconMovie;
95 /** Create the main UI actions. */
97 /** Create the menu bar and submenus. */
99 /** Create the toolbars */
100 void createToolBars();
101 /** Create system tray (notification) icon */
102 void createTrayIcon();
105 /** Set number of connections shown in the UI */
106 void setNumConnections(int count);
107 /** Set number of blocks shown in the UI */
108 void setNumBlocks(int count);
109 /** Set the encryption status as shown in the UI.
110 @param[in] status current encryption status
111 @see WalletModel::EncryptionStatus
113 void setEncryptionStatus(int status);
114 /** Set the status bar text if there are any warnings (removes sync progress bar if applicable) */
115 void refreshStatusBar();
117 /** Notify the user of an error in the network or transaction handling code. */
118 void error(const QString &title, const QString &message);
119 /** Asks the user whether to pay the transaction fee or to cancel the transaction.
120 It is currently not possible to pass a return value to another thread through
121 BlockingQueuedConnection, so an indirected pointer is used.
122 http://bugreports.qt.nokia.com/browse/QTBUG-10440
124 @param[in] nFeeRequired the required fee
125 @param[out] payFee true to pay the fee, false to not pay the fee
127 void askFee(qint64 nFeeRequired, bool *payFee);
132 /** Switch to overview (home) page */
133 void gotoOverviewPage();
134 /** Switch to history (transactions) page */
135 void gotoHistoryPage();
136 /** Switch to address book page */
137 void gotoAddressBookPage();
138 /** Switch to receive coins page */
139 void gotoReceiveCoinsPage();
140 /** Switch to send coins page */
141 void gotoSendCoinsPage();
143 /** Show configuration dialog */
144 void optionsClicked();
145 /** Show about dialog */
148 /** Handle tray icon clicked */
149 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
151 /** Show incoming transaction notification for new transactions.
153 The new items are those between start and end inclusive, under the given parent item.
155 void incomingTransaction(const QModelIndex & parent, int start, int end);
156 /** Encrypt the wallet */
157 void encryptWallet(bool status);
158 /** Change encrypted wallet passphrase */
159 void changePassphrase();
160 /** Ask for pass phrase to unlock wallet temporarily */