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