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