5 #include <QSystemTrayIcon>
7 class TransactionTableModel;
10 class TransactionView;
12 class AddressBookPage;
13 class SendCoinsDialog;
22 class QAbstractItemModel;
30 Bitcoin GUI main class. This class represents the main window of the Bitcoin UI. It communicates with both the client and
31 wallet models to give the user an up-to-date view of the current core state.
33 class BitcoinGUI : public QMainWindow
37 explicit BitcoinGUI(QWidget *parent = 0);
40 /** Set the client model.
41 The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
43 void setClientModel(ClientModel *clientModel);
44 /** Set the wallet model.
45 The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
48 void setWalletModel(WalletModel *walletModel);
51 void changeEvent(QEvent *e);
52 void closeEvent(QCloseEvent *event);
53 void dragEnterEvent(QDragEnterEvent *event);
54 void dropEvent(QDropEvent *event);
57 ClientModel *clientModel;
58 WalletModel *walletModel;
60 QStackedWidget *centralWidget;
62 OverviewPage *overviewPage;
63 QWidget *transactionsPage;
64 AddressBookPage *addressBookPage;
65 AddressBookPage *receiveCoinsPage;
66 SendCoinsDialog *sendCoinsPage;
67 MessagePage *messagePage;
69 QLabel *labelEncryptionIcon;
70 QLabel *labelConnectionsIcon;
71 QLabel *labelBlocksIcon;
72 QLabel *progressBarLabel;
73 QProgressBar *progressBar;
76 QAction *overviewAction;
77 QAction *historyAction;
79 QAction *sendCoinsAction;
80 QAction *addressBookAction;
81 QAction *messageAction;
82 QAction *verifyMessageAction;
84 QAction *receiveCoinsAction;
85 QAction *optionsAction;
86 QAction *toggleHideAction;
87 QAction *exportAction;
88 QAction *encryptWalletAction;
89 QAction *backupWalletAction;
90 QAction *changePassphraseAction;
91 QAction *aboutQtAction;
92 QAction *openRPCConsoleAction;
94 QSystemTrayIcon *trayIcon;
95 Notificator *notificator;
96 TransactionView *transactionView;
97 RPCConsole *rpcConsole;
99 QMovie *syncIconMovie;
101 /** Create the main UI actions. */
102 void createActions();
103 /** Create the menu bar and submenus. */
104 void createMenuBar();
105 /** Create the toolbars */
106 void createToolBars();
107 /** Create system tray (notification) icon */
108 void createTrayIcon();
111 /** Set number of connections shown in the UI */
112 void setNumConnections(int count);
113 /** Set number of blocks shown in the UI */
114 void setNumBlocks(int count, int countOfPeers);
115 /** Set the encryption status as shown in the UI.
116 @param[in] status current encryption status
117 @see WalletModel::EncryptionStatus
119 void setEncryptionStatus(int status);
121 /** Notify the user of an error in the network or transaction handling code. */
122 void error(const QString &title, const QString &message, bool modal);
123 /** Asks the user whether to pay the transaction fee or to cancel the transaction.
124 It is currently not possible to pass a return value to another thread through
125 BlockingQueuedConnection, so an indirected pointer is used.
126 http://bugreports.qt.nokia.com/browse/QTBUG-10440
128 @param[in] nFeeRequired the required fee
129 @param[out] payFee true to pay the fee, false to not pay the fee
131 void askFee(qint64 nFeeRequired, bool *payFee);
132 void handleURI(QString strURI);
134 void gotoMessagePage(QString addr = "");
137 /** Switch to overview (home) page */
138 void gotoOverviewPage();
139 /** Switch to history (transactions) page */
140 void gotoHistoryPage();
141 /** Switch to address book page */
142 void gotoAddressBookPage();
143 /** Switch to receive coins page */
144 void gotoReceiveCoinsPage();
145 /** Switch to send coins page */
146 void gotoSendCoinsPage();
148 /** Show configuration dialog */
149 void optionsClicked();
150 /** Show about dialog */
153 /** Handle tray icon clicked */
154 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
156 /** Show incoming transaction notification for new transactions.
158 The new items are those between start and end inclusive, under the given parent item.
160 void incomingTransaction(const QModelIndex & parent, int start, int end);
161 /** Encrypt the wallet */
162 void encryptWallet(bool status);
163 /** Backup the wallet */
165 /** Change encrypted wallet passphrase */
166 void changePassphrase();
167 /** Verify a message signature */
168 void verifyMessage();
169 /** Ask for pass phrase to unlock wallet temporarily */
172 /** Show window if hidden, unminimize when minimized */
173 void showNormalIfMinimized();
174 /** Hide window if visible, show if hidden */