aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.h
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2014-07-03 17:47:00 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2014-07-03 17:47:58 +0200
commit07b6c2b90168a91964f096b83f1278c312321771 (patch)
tree052340b8b4af0b0df7b607e757da4edc1b2ff101 /src/qt/bitcoingui.h
parent29264a0a60fb18671ab43713f168765ab7609cd6 (diff)
parent8969828d069e4e55108618a493749535edc12ec7 (diff)
downloadbitcoin-07b6c2b90168a91964f096b83f1278c312321771.tar.xz
Merge pull request #4302
8969828 [Qt] New status bar Unit Display Control and related changes. (gubatron)
Diffstat (limited to 'src/qt/bitcoingui.h')
-rw-r--r--src/qt/bitcoingui.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index e7a842df99..705e629a69 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -9,12 +9,16 @@
#include "config/bitcoin-config.h"
#endif
+#include <QLabel>
#include <QMainWindow>
#include <QMap>
+#include <QMenu>
+#include <QPoint>
#include <QSystemTrayIcon>
class ClientModel;
class Notificator;
+class OptionsModel;
class RPCConsole;
class SendCoinsRecipient;
class WalletFrame;
@@ -22,9 +26,13 @@ class WalletModel;
class CWallet;
+class UnitDisplayStatusBarControl;
+
QT_BEGIN_NAMESPACE
class QAction;
class QLabel;
+class QMenu;
+class QPoint;
class QProgressBar;
class QProgressDialog;
QT_END_NAMESPACE
@@ -69,6 +77,7 @@ private:
ClientModel *clientModel;
WalletFrame *walletFrame;
+ UnitDisplayStatusBarControl *unitDisplayControl;
QLabel *labelEncryptionIcon;
QLabel *labelConnectionsIcon;
QLabel *labelBlocksIcon;
@@ -198,4 +207,32 @@ private slots:
void showProgress(const QString &title, int nProgress);
};
+class UnitDisplayStatusBarControl : public QLabel
+{
+ Q_OBJECT
+
+public:
+ explicit UnitDisplayStatusBarControl();
+ /** Lets the control know about the Options Model (and its signals) */
+ void setOptionsModel(OptionsModel *optionsModel);
+
+protected:
+ /** So that it responds to left-button clicks */
+ void mousePressEvent(QMouseEvent *event);
+
+private:
+ OptionsModel *optionsModel;
+ QMenu* menu;
+ /** Shows context menu with Display Unit options by the mouse coordinates */
+ void onDisplayUnitsClicked(const QPoint& point);
+ /** Creates context menu, its actions, and wires up all the relevant signals for mouse events. */
+ void createContextMenu();
+
+private slots:
+ /** When Display Units are changed on OptionsModel it will refresh the display text of the control on the status bar */
+ void updateDisplayUnit(int newUnits);
+ /** Tells underlying optionsModel to update its current display unit. */
+ void onMenuSelection(QAction* action);
+};
+
#endif // BITCOINGUI_H