Replaces numbered place marker %2 with %1.
[bitcoinplatinum.git] / src / qt / modaloverlay.h
blob63465ab66ea91540495f03af435928ef2d08d621
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.
5 #ifndef BITCOIN_QT_MODALOVERLAY_H
6 #define BITCOIN_QT_MODALOVERLAY_H
8 #include <QDateTime>
9 #include <QWidget>
11 //! The required delta of headers to the estimated number of available headers until we show the IBD progress
12 static constexpr int HEADER_HEIGHT_DELTA_SYNC = 24;
14 namespace Ui {
15 class ModalOverlay;
18 /** Modal overlay to display information about the chain-sync state */
19 class ModalOverlay : public QWidget
21 Q_OBJECT
23 public:
24 explicit ModalOverlay(QWidget *parent);
25 ~ModalOverlay();
27 public Q_SLOTS:
28 void tipUpdate(int count, const QDateTime& blockDate, double nVerificationProgress);
29 void setKnownBestHeight(int count, const QDateTime& blockDate);
31 void toggleVisibility();
32 // will show or hide the modal layer
33 void showHide(bool hide = false, bool userRequested = false);
34 void closeClicked();
35 bool isLayerVisible() const { return layerIsVisible; }
37 protected:
38 bool eventFilter(QObject * obj, QEvent * ev);
39 bool event(QEvent* ev);
41 private:
42 Ui::ModalOverlay *ui;
43 int bestHeaderHeight; //best known height (based on the headers)
44 QDateTime bestHeaderDate;
45 QVector<QPair<qint64, double> > blockProcessTime;
46 bool layerIsVisible;
47 bool userClosed;
50 #endif // BITCOIN_QT_MODALOVERLAY_H