5#include <qt/forms/ui_modaloverlay.h>
8#include <chainparams.h>
11#include <QEasingCurve>
12#include <QPropertyAnimation>
13#include <QResizeEvent>
19 connect(
ui->closeButton, &QPushButton::clicked,
this,
22 parent->installEventFilter(
this);
29 ui->infoText->setVisible(
false);
30 ui->infoTextStrong->setText(
31 tr(
"%1 is currently syncing. It will download headers "
32 "and blocks from peers and validate them until reaching the tip "
33 "of the block chain.")
48 if (
obj == parent()) {
49 if (ev->type() == QEvent::Resize) {
59 }
else if (ev->type() == QEvent::ChildAdded) {
63 return QWidget::eventFilter(
obj, ev);
68 if (ev->type() == QEvent::ParentAboutToChange) {
70 parent()->removeEventFilter(
this);
72 }
else if (ev->type() == QEvent::ParentChange) {
74 parent()->installEventFilter(
this);
78 return QWidget::event(ev);
126 ui->progressIncreasePerH->setText(
131 ui->expectedTimeLeft->setText(
134 ui->expectedTimeLeft->setText(QObject::tr(
"unknown"));
145 ui->newestBlockDate->setText(
blockDate.toString());
148 ui->percentageProgress->setText(
165 ui->numberOfBlocksLeft->setText(
169 ui->expectedTimeLeft->setText(
tr(
"Unknown..."));
176 ui->numberOfBlocksLeft->setText(
177 tr(
"Unknown. Syncing Headers (%1, %2%)...")
188 ui->numberOfBlocksLeft->setText(
189 tr(
"Unknown. Pre-syncing Headers (%1, %2%)…")
218 m_animation.start(QAbstractAnimation::KeepWhenStopped);
const CChainParams & Params()
Return the currently selected parameters.
const Consensus::Params & GetConsensus() const
Modal overlay to display information about the chain-sync state.
void showHide(bool hide=false, bool userRequested=false)
bool event(QEvent *ev) override
Tracks parent widget changes.
void tipUpdate(int count, const QDateTime &blockDate, double nVerificationProgress)
void UpdateHeaderSyncLabel()
ModalOverlay(bool enable_wallet, QWidget *parent)
void triggered(bool hidden)
void setKnownBestHeight(int count, const QDateTime &blockDate, bool presync)
QVector< QPair< qint64, double > > blockProcessTime
bool eventFilter(QObject *obj, QEvent *ev) override
void UpdateHeaderPresyncLabel(int height, const QDateTime &blockDate)
QPropertyAnimation m_animation
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...
QString formatNiceTimeOffset(qint64 secs)
T GetRand(T nMax=std::numeric_limits< T >::max()) noexcept
Generate a uniform random integer of type T in the range [0..nMax) nMax defaults to std::numeric_limi...
int64_t nPowTargetSpacing