]> Git Repo - VerusCoin.git/blame - src/qt/bitcoingui.h
Remove translation for -help-debug options
[VerusCoin.git] / src / qt / bitcoingui.h
CommitLineData
f914f1a7 1// Copyright (c) 2011-2014 The Bitcoin Core developers
78253fcb 2// Distributed under the MIT software license, see the accompanying
e592d43f
WL
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
84738627
PJ
5#ifndef BITCOIN_QT_BITCOINGUI_H
6#define BITCOIN_QT_BITCOINGUI_H
aaa1c3c4 7
b7f4b6d3 8#if defined(HAVE_CONFIG_H)
f3967bcc 9#include "config/bitcoin-config.h"
b7f4b6d3
WL
10#endif
11
a372168e
MF
12#include "amount.h"
13
8969828d 14#include <QLabel>
aaa1c3c4 15#include <QMainWindow>
67155d92 16#include <QMap>
8969828d 17#include <QMenu>
18#include <QPoint>
51ed9ec9 19#include <QSystemTrayIcon>
3f323a61 20
18cab09a 21class ClientModel;
6de50c3c 22class NetworkStyle;
cf9195c8 23class Notificator;
8969828d 24class OptionsModel;
460c51fd 25class RPCConsole;
51ed9ec9 26class SendCoinsRecipient;
3d0e92dc 27class UnitDisplayStatusBarControl;
51ed9ec9
BD
28class WalletFrame;
29class WalletModel;
4d1bb15e 30
67155d92
EL
31class CWallet;
32
4d1bb15e 33QT_BEGIN_NAMESPACE
51ed9ec9 34class QAction;
6cab6635 35class QProgressBar;
06a91d96 36class QProgressDialog;
4d1bb15e 37QT_END_NAMESPACE
aaa1c3c4 38
66112ed6
WL
39/**
40 Bitcoin GUI main class. This class represents the main window of the Bitcoin UI. It communicates with both the client and
41 wallet models to give the user an up-to-date view of the current core state.
42*/
aaa1c3c4
WL
43class BitcoinGUI : public QMainWindow
44{
45 Q_OBJECT
32af5266 46
aaa1c3c4 47public:
67155d92 48 static const QString DEFAULT_WALLET;
8726de26 49
6de50c3c 50 explicit BitcoinGUI(const NetworkStyle *networkStyle, QWidget *parent = 0);
527137e3 51 ~BitcoinGUI();
52
66112ed6
WL
53 /** Set the client model.
54 The client model represents the part of the core that communicates with the P2P network, and is wallet-agnostic.
55 */
ef079e18 56 void setClientModel(ClientModel *clientModel);
4751df0c 57
b7f4b6d3 58#ifdef ENABLE_WALLET
66112ed6
WL
59 /** Set the wallet model.
60 The wallet model represents a bitcoin wallet, and offers access to the list of transactions, address book and sending
61 functionality.
62 */
67155d92
EL
63 bool addWallet(const QString& name, WalletModel *walletModel);
64 bool setCurrentWallet(const QString& name);
67155d92 65 void removeAllWallets();
981f7907 66#endif // ENABLE_WALLET
d52f0726 67 bool enableWallet;
840470ec 68
352083cb
WL
69protected:
70 void changeEvent(QEvent *e);
71 void closeEvent(QCloseEvent *event);
db7f0234
WL
72 void dragEnterEvent(QDragEnterEvent *event);
73 void dropEvent(QDropEvent *event);
6f959c4c 74 bool eventFilter(QObject *object, QEvent *event);
352083cb 75
3f323a61 76private:
ef079e18 77 ClientModel *clientModel;
67155d92 78 WalletFrame *walletFrame;
64c8b699 79
8969828d 80 UnitDisplayStatusBarControl *unitDisplayControl;
ae8adeb9 81 QLabel *labelEncryptionIcon;
b1ef1b24 82 QLabel *labelConnectionsIcon;
8dcffd4d 83 QLabel *labelBlocksIcon;
6cab6635
WL
84 QLabel *progressBarLabel;
85 QProgressBar *progressBar;
06a91d96 86 QProgressDialog *progressDialog;
3f323a61 87
527137e3 88 QMenuBar *appMenuBar;
64c8b699
WL
89 QAction *overviewAction;
90 QAction *historyAction;
3479849d
WL
91 QAction *quitAction;
92 QAction *sendCoinsAction;
301cd2a3 93 QAction *sendCoinsMenuAction;
74fb765e
WL
94 QAction *usedSendingAddressesAction;
95 QAction *usedReceivingAddressesAction;
47894585 96 QAction *signMessageAction;
0c587936 97 QAction *verifyMessageAction;
3479849d
WL
98 QAction *aboutAction;
99 QAction *receiveCoinsAction;
301cd2a3 100 QAction *receiveCoinsMenuAction;
3479849d 101 QAction *optionsAction;
86d56349 102 QAction *toggleHideAction;
b7bcaf94 103 QAction *encryptWalletAction;
4efbda3f 104 QAction *backupWalletAction;
b7bcaf94 105 QAction *changePassphraseAction;
01ea41b2 106 QAction *aboutQtAction;
460c51fd 107 QAction *openRPCConsoleAction;
4c603586 108 QAction *openAction;
f0219813 109 QAction *showHelpMessageAction;
abf11f79 110
3f323a61 111 QSystemTrayIcon *trayIcon;
b197bf32 112 QMenu *trayIconMenu;
cf9195c8 113 Notificator *notificator;
460c51fd 114 RPCConsole *rpcConsole;
3f323a61 115
24cde0b7
WL
116 /** Keep track of previous number of blocks, to detect progress */
117 int prevBlocks;
f10b2d70 118 int spinnerFrame;
8dcffd4d 119
66112ed6 120 /** Create the main UI actions. */
84a05b84 121 void createActions();
814efd6f 122 /** Create the menu bar and sub-menus. */
527137e3 123 void createMenuBar();
66112ed6 124 /** Create the toolbars */
527137e3 125 void createToolBars();
f8210212 126 /** Create system tray icon and notification */
6de50c3c 127 void createTrayIcon(const NetworkStyle *networkStyle);
f8210212
PK
128 /** Create system tray menu (or setup the dock menu) */
129 void createTrayIconMenu();
3f323a61 130
146ba964
WL
131 /** Enable or disable all wallet-related actions */
132 void setWalletActionsEnabled(bool enabled);
133
35ecf854
WL
134 /** Connect core signals to GUI client */
135 void subscribeToCoreSignals();
136 /** Disconnect core signals from GUI client */
137 void unsubscribeFromCoreSignals();
138
4c603586
WL
139signals:
140 /** Signal raised when a URI was entered or dragged to the GUI */
141 void receivedURI(const QString &uri);
142
1a6d504a 143public slots:
66112ed6 144 /** Set number of connections shown in the UI */
1a6d504a 145 void setNumConnections(int count);
8517e970
PK
146 /** Set number of blocks and last block date shown in the UI */
147 void setNumBlocks(int count, const QDateTime& blockDate);
ae8adeb9 148
5350ea41
PK
149 /** Notify the user of an event from the core network or transaction handling code.
150 @param[in] title the message box / notification title
151 @param[in] message the displayed text
3675588a 152 @param[in] style modality and style definitions (icon and used buttons - buttons only for message boxes)
5350ea41 153 @see CClientUIInterface::MessageBoxFlags
f7f3a96b 154 @param[in] ret pointer to a bool that will be modified to whether Ok was clicked (modal only)
5350ea41 155 */
f7f3a96b 156 void message(const QString &title, const QString &message, unsigned int style, bool *ret = NULL);
08dd1b7b 157
b7f4b6d3
WL
158#ifdef ENABLE_WALLET
159 /** Set the encryption status as shown in the UI.
160 @param[in] status current encryption status
161 @see WalletModel::EncryptionStatus
162 */
163 void setEncryptionStatus(int status);
164
2384a286 165 bool handlePaymentRequest(const SendCoinsRecipient& recipient);
1a6d504a 166
67155d92 167 /** Show incoming transaction notification for new transactions. */
721cb557 168 void incomingTransaction(const QString& date, int unit, const CAmount& amount, const QString& type, const QString& address, const QString& label);
981f7907 169#endif // ENABLE_WALLET
67155d92 170
aaa1c3c4 171private slots:
b7f4b6d3 172#ifdef ENABLE_WALLET
66112ed6 173 /** Switch to overview (home) page */
3479849d 174 void gotoOverviewPage();
66112ed6 175 /** Switch to history (transactions) page */
3479849d 176 void gotoHistoryPage();
66112ed6 177 /** Switch to receive coins page */
3479849d 178 void gotoReceiveCoinsPage();
66112ed6 179 /** Switch to send coins page */
abf11f79 180 void gotoSendCoinsPage(QString addr = "");
3479849d 181
ddadf791
PK
182 /** Show Sign/Verify Message dialog and switch to sign message tab */
183 void gotoSignMessageTab(QString addr = "");
184 /** Show Sign/Verify Message dialog and switch to verify message tab */
185 void gotoVerifyMessageTab(QString addr = "");
186
b7f4b6d3
WL
187 /** Show open dialog */
188 void openClicked();
981f7907 189#endif // ENABLE_WALLET
66112ed6 190 /** Show configuration dialog */
af943776 191 void optionsClicked();
66112ed6 192 /** Show about dialog */
8812ce7b 193 void aboutClicked();
f0219813
PK
194 /** Show help message dialog */
195 void showHelpMessageClicked();
81605d90 196#ifndef Q_OS_MAC
66112ed6 197 /** Handle tray icon clicked */
352083cb 198 void trayIconActivated(QSystemTrayIcon::ActivationReason reason);
527137e3 199#endif
17690ea5 200
d2e6dd6c
PK
201 /** Show window if hidden, unminimize when minimized, rise when obscured or show if hidden and fToggleHidden is true */
202 void showNormalIfMinimized(bool fToggleHidden = false);
6f959c4c 203 /** Simply calls showNormalIfMinimized(true) for use in SLOT() macro */
86d56349 204 void toggleHidden();
723035bb
GA
205
206 /** called by a timer to check if fRequestShutdown has been set **/
207 void detectShutdown();
06a91d96
CL
208
209 /** Show progress dialog e.g. for verifychain */
210 void showProgress(const QString &title, int nProgress);
aaa1c3c4
WL
211};
212
8969828d 213class UnitDisplayStatusBarControl : public QLabel
214{
215 Q_OBJECT
216
217public:
218 explicit UnitDisplayStatusBarControl();
219 /** Lets the control know about the Options Model (and its signals) */
220 void setOptionsModel(OptionsModel *optionsModel);
221
222protected:
223 /** So that it responds to left-button clicks */
224 void mousePressEvent(QMouseEvent *event);
225
226private:
227 OptionsModel *optionsModel;
228 QMenu* menu;
8ca6a161 229
8969828d 230 /** Shows context menu with Display Unit options by the mouse coordinates */
231 void onDisplayUnitsClicked(const QPoint& point);
232 /** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */
233 void createContextMenu();
234
235private slots:
236 /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */
237 void updateDisplayUnit(int newUnits);
238 /** Tells underlying optionsModel to update its current display unit. */
239 void onMenuSelection(QAction* action);
240};
241
84738627 242#endif // BITCOIN_QT_BITCOINGUI_H
This page took 0.226245 seconds and 4 git commands to generate.