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