5 #include <QSystemTrayIcon>
7 class TransactionTableModel;
10 class TransactionView;
13 class AddressBookPage;
14 class SendCoinsDialog;
15 class SignVerifyMessageDialog;
26 class QAbstractItemModel;
34 Bitcoin GUI main class. This class represents the main window of the Bitcoin UI. It communicates with both the client and
35 wallet models to give the user an up-to-date view of the current core state.
37 class BitcoinGUI : public QMainWindow
41 explicit BitcoinGUI(QWidget *parent = 0);
44 /** Set the client model.
45 The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
47 void setClientModel(ClientModel *clientModel);
48 /** Set the wallet model.
49 The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
52 void setWalletModel(WalletModel *walletModel);
55 void changeEvent(QEvent *e);
56 void closeEvent(QCloseEvent *event);
57 void dragEnterEvent(QDragEnterEvent *event);
58 void dropEvent(QDropEvent *event);
61 ClientModel *clientModel;
62 WalletModel *walletModel;
64 QStackedWidget *centralWidget;
66 OverviewPage *overviewPage;
67 QWidget *transactionsPage;
69 AddressBookPage *addressBookPage;
70 AddressBookPage *receiveCoinsPage;
71 SendCoinsDialog *sendCoinsPage;
72 SignVerifyMessageDialog *signVerifyMessageDialog;
73 MultisigDialog *multisigPage;
75 QLabel *labelEncryptionIcon;
76 QLabel *labelConnectionsIcon;
77 QLabel *labelBlocksIcon;
78 QLabel *labelMiningIcon;
79 QLabel *progressBarLabel;
80 QProgressBar *progressBar;
83 QAction *overviewAction;
84 QAction *historyAction;
85 QAction *mintingAction;
87 QAction *sendCoinsAction;
88 QAction *addressBookAction;
89 QAction *signMessageAction;
90 QAction *verifyMessageAction;
91 QAction *multisigAction;
93 QAction *receiveCoinsAction;
94 QAction *optionsAction;
95 QAction *toggleHideAction;
96 QAction *exportAction;
97 QAction *encryptWalletAction;
98 QAction *lockWalletAction;
99 QAction *unlockWalletAction;
100 QAction *unlockWalletMiningAction;
101 QAction *backupWalletAction;
102 QAction *dumpWalletAction;
103 QAction *importWalletAction;
104 QAction *changePassphraseAction;
105 QAction *aboutQtAction;
106 QAction *openRPCConsoleAction;
108 QSystemTrayIcon *trayIcon;
109 Notificator *notificator;
110 TransactionView *transactionView;
111 MintingView *mintingView;
112 RPCConsole *rpcConsole;
113 AboutDialog *aboutDialog;
114 OptionsDialog *optionsDialog;
116 QMovie *syncIconMovie;
118 /** Create the main UI actions. */
119 void createActions();
120 /** Create the menu bar and sub-menus. */
121 void createMenuBar();
122 /** Create the toolbars */
123 void createToolBars();
124 /** Create system tray (notification) icon */
125 void createTrayIcon();
128 /** Set number of connections shown in the UI */
129 void setNumConnections(int count);
130 /** Set number of blocks shown in the UI */
131 void setNumBlocks(int count, int nTotalBlocks);
132 /** Set stake miner status in the UI */
134 /** Set the encryption status as shown in the UI.
135 @param[in] status current encryption status
136 @see WalletModel::EncryptionStatus
138 void setEncryptionStatus(int status);
140 /** Notify the user of an error in the network or transaction handling code. */
141 void error(const QString &title, const QString &message, bool modal);
142 void message(const QString &title, const QString &message, unsigned int style, const QString &detail=QString());
144 /** Asks the user whether to pay the transaction fee or to cancel the transaction.
145 It is currently not possible to pass a return value to another thread through
146 BlockingQueuedConnection, so an indirected pointer is used.
147 https://bugreports.qt-project.org/browse/QTBUG-10440
149 @param[in] nFeeRequired the required fee
150 @param[out] payFee true to pay the fee, false to not pay the fee
152 void askFee(qint64 nFeeRequired, bool *payFee);
153 void handleURI(QString strURI);
155 void gotoMultisigPage();
158 /** Switch to overview (home) page */
159 void gotoOverviewPage();
160 /** Switch to history (transactions) page */
161 void gotoHistoryPage();
162 /** Switch to minting page */
163 void gotoMintingPage();
164 /** Switch to address book page */
165 void gotoAddressBookPage();
166 /** Switch to receive coins page */
167 void gotoReceiveCoinsPage();
168 /** Switch to send coins page */
169 void gotoSendCoinsPage();
171 /** Show Sign/Verify Message dialog and switch to sign message tab */
172 void gotoSignMessageTab(QString addr = "");
173 /** Show Sign/Verify Message dialog and switch to verify message tab */
174 void gotoVerifyMessageTab(QString addr = "");
176 /** Show configuration dialog */
177 void optionsClicked();
178 /** Show about dialog */
181 /** Handle tray icon clicked */
182 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
184 /** Show incoming transaction notification for new transactions.
186 The new items are those between start and end inclusive, under the given parent item.
188 void incomingTransaction(const QModelIndex & parent, int start, int end);
189 /** Encrypt the wallet */
190 void encryptWallet(bool status);
191 /** Backup the wallet */
193 /** Change encrypted wallet passphrase */
198 void changePassphrase();
199 /** Ask for passphrase to unlock wallet temporarily */
202 void unlockWalletMining(bool status);
204 /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */
205 void showNormalIfMinimized(bool fToggleHidden = false);
206 /** simply calls showNormalIfMinimized(true) for use in SLOT() macro */