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