Fabcoin Core  0.16.2
P2P Digital Currency
modaloverlay.h
Go to the documentation of this file.
1 // Copyright (c)2016-2017 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 FABCOIN_QT_MODALOVERLAY_H
6 #define FABCOIN_QT_MODALOVERLAY_H
7 
8 #include <QDateTime>
9 #include <QWidget>
10 
12 static constexpr int HEADER_HEIGHT_DELTA_SYNC = 24;
13 
14 namespace Ui {
15  class ModalOverlay;
16 }
17 
19 class ModalOverlay : public QWidget
20 {
21  Q_OBJECT
22 
23 public:
25  {
26  Sync = 0,
27  Backup = 1
28  };
29 
30  explicit ModalOverlay(QWidget *parent, OverlayType _type = OverlayType::Sync);
31  ~ModalOverlay();
32 
33 public Q_SLOTS:
34  void tipUpdate(int count, const QDateTime& blockDate, double nVerificationProgress);
35  void setKnownBestHeight(int count, const QDateTime& blockDate);
36 
37  void toggleVisibility();
38  // will show or hide the modal layer
39  void showHide(bool hide = false, bool userRequested = false);
40  void closeClicked();
41  void backupWalletClicked();
42  bool isLayerVisible() { return layerIsVisible; }
43 
44 Q_SIGNALS:
45  void backupWallet();
46 
47 protected:
48  bool eventFilter(QObject * obj, QEvent * ev);
49  bool event(QEvent* ev);
50 
51 private:
53  int bestHeaderHeight; //best known height (based on the headers)
54  QDateTime bestHeaderDate;
55  QVector<QPair<qint64, double> > blockProcessTime;
57  bool userClosed;
59 };
60 
61 #endif // FABCOIN_QT_MODALOVERLAY_H
size_t count
Definition: ExecStats.cpp:37
Modal overlay to display information about the chain-sync state.
Definition: modaloverlay.h:19
Ui::ModalOverlay * ui
Definition: modaloverlay.h:52
OverlayType type
Definition: modaloverlay.h:58
QDateTime bestHeaderDate
Definition: modaloverlay.h:54
bool layerIsVisible
Definition: modaloverlay.h:56
int bestHeaderHeight
Definition: modaloverlay.h:53
bool isLayerVisible()
Definition: modaloverlay.h:42
QVector< QPair< qint64, double > > blockProcessTime
Definition: modaloverlay.h:55