Bitcoin ABC  0.24.7
P2P Digital Currency
modaloverlay.h
Go to the documentation of this file.
1 // Copyright (c) 2016 The Bitcoin Core developers
2 // Distributed under the MIT software license, see the accompanying
3 // file COPYING or http://www.opensource.org/licenses/mit-license.php.
4 
5 #ifndef BITCOIN_QT_MODALOVERLAY_H
6 #define BITCOIN_QT_MODALOVERLAY_H
7 
8 #include <QDateTime>
9 #include <QPropertyAnimation>
10 #include <QWidget>
11 
14 static constexpr int HEADER_HEIGHT_DELTA_SYNC = 24;
15 
16 namespace Ui {
17 class ModalOverlay;
18 }
19 
21 class ModalOverlay : public QWidget {
22  Q_OBJECT
23 
24 public:
25  explicit ModalOverlay(bool enable_wallet, QWidget *parent);
26  ~ModalOverlay();
27 
28  void tipUpdate(int count, const QDateTime &blockDate,
29  double nVerificationProgress);
30  void setKnownBestHeight(int count, const QDateTime &blockDate);
31 
32  // will show or hide the modal layer
33  void showHide(bool hide = false, bool userRequested = false);
34  bool isLayerVisible() const { return layerIsVisible; }
35 
36 public Q_SLOTS:
37  void toggleVisibility();
38  void closeClicked();
39 
40 Q_SIGNALS:
41  void triggered(bool hidden);
42 
43 protected:
44  bool eventFilter(QObject *obj, QEvent *ev) override;
45  bool event(QEvent *ev) override;
46 
47 private:
48  Ui::ModalOverlay *ui;
49  int bestHeaderHeight; // best known height (based on the headers)
50  QDateTime bestHeaderDate;
51  QVector<QPair<qint64, double>> blockProcessTime;
53  bool userClosed;
54  QPropertyAnimation m_animation;
55  void UpdateHeaderSyncLabel();
56 };
57 
58 #endif // BITCOIN_QT_MODALOVERLAY_H
ModalOverlay::closeClicked
void closeClicked()
Definition: modaloverlay.cpp:207
ModalOverlay::UpdateHeaderSyncLabel
void UpdateHeaderSyncLabel()
Definition: modaloverlay.cpp:169
ModalOverlay
Modal overlay to display information about the chain-sync state.
Definition: modaloverlay.h:21
count
static int count
Definition: tests.c:41
ModalOverlay::triggered
void triggered(bool hidden)
ModalOverlay::bestHeaderDate
QDateTime bestHeaderDate
Definition: modaloverlay.h:50
ModalOverlay::ui
Ui::ModalOverlay * ui
Definition: modaloverlay.h:48
ModalOverlay::m_animation
QPropertyAnimation m_animation
Definition: modaloverlay.h:54
HEADER_HEIGHT_DELTA_SYNC
static constexpr int HEADER_HEIGHT_DELTA_SYNC
The required delta of headers to the estimated number of available headers until we show the IBD prog...
Definition: modaloverlay.h:14
ModalOverlay::eventFilter
bool eventFilter(QObject *obj, QEvent *ev) override
Definition: modaloverlay.cpp:47
ModalOverlay::layerIsVisible
bool layerIsVisible
Definition: modaloverlay.h:52
ModalOverlay::bestHeaderHeight
int bestHeaderHeight
Definition: modaloverlay.h:49
ModalOverlay::toggleVisibility
void toggleVisibility()
Definition: modaloverlay.cpp:180
Ui
Definition: addressbookpage.h:14
ModalOverlay::event
bool event(QEvent *ev) override
Tracks parent widget changes.
Definition: modaloverlay.cpp:67
ModalOverlay::userClosed
bool userClosed
Definition: modaloverlay.h:53
ModalOverlay::setKnownBestHeight
void setKnownBestHeight(int count, const QDateTime &blockDate)
Definition: modaloverlay.cpp:81
ModalOverlay::~ModalOverlay
~ModalOverlay()
Definition: modaloverlay.cpp:43
ModalOverlay::ModalOverlay
ModalOverlay(bool enable_wallet, QWidget *parent)
Definition: modaloverlay.cpp:15
ModalOverlay::showHide
void showHide(bool hide=false, bool userRequested=false)
Definition: modaloverlay.cpp:187
ModalOverlay::isLayerVisible
bool isLayerVisible() const
Definition: modaloverlay.h:34
ModalOverlay::tipUpdate
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
Definition: modaloverlay.cpp:89
ModalOverlay::blockProcessTime
QVector< QPair< qint64, double > > blockProcessTime
Definition: modaloverlay.h:51