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 message(const QString &title, const QString &message, unsigned int style, const QString &detail=QString());
143 /** Asks the user whether to pay the transaction fee or to cancel the transaction.
144 It is currently not possible to pass a return value to another thread through
145 BlockingQueuedConnection, so an indirected pointer is used.
146 https://bugreports.qt-project.org/browse/QTBUG-10440
148 @param[in] nFeeRequired the required fee
149 @param[out] payFee true to pay the fee, false to not pay the fee
151 void askFee(qint64 nFeeRequired, bool *payFee);
152 void handleURI(QString strURI);
154 void gotoMultisigPage();
157 /** Switch to overview (home) page */
158 void gotoOverviewPage();
159 /** Switch to history (transactions) page */
160 void gotoHistoryPage();
161 /** Switch to minting page */
162 void gotoMintingPage();
163 /** Switch to address book page */
164 void gotoAddressBookPage();
165 /** Switch to receive coins page */
166 void gotoReceiveCoinsPage();
167 /** Switch to send coins page */
168 void gotoSendCoinsPage();
170 /** Show Sign/Verify Message dialog and switch to sign message tab */
171 void gotoSignMessageTab(QString addr = "");
172 /** Show Sign/Verify Message dialog and switch to verify message tab */
173 void gotoVerifyMessageTab(QString addr = "");
175 /** Show configuration dialog */
176 void optionsClicked();
177 /** Show about dialog */
180 /** Handle tray icon clicked */
181 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
183 /** Show incoming transaction notification for new transactions.
185 The new items are those between start and end inclusive, under the given parent item.
187 void incomingTransaction(const QModelIndex & parent, int start, int end);
188 /** Encrypt the wallet */
189 void encryptWallet(bool status);
190 /** Backup the wallet */
192 /** Change encrypted wallet passphrase */
197 void changePassphrase();
198 /** Ask for passphrase to unlock wallet temporarily */
201 void unlockWalletMining(bool status);
203 /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */
204 void showNormalIfMinimized(bool fToggleHidden = false);
205 /** simply calls showNormalIfMinimized(true) for use in SLOT() macro */