5#include <bitcoin-build-config.h>
8#include <qt/forms/ui_modaloverlay.h>
10#include <chainparams.h>
13#include <QEasingCurve>
14#include <QPropertyAnimation>
15#include <QResizeEvent>
25 parent->installEventFilter(
this);
28 ui->closeButton->installEventFilter(
this);
33 ui->infoText->setVisible(
false);
34 ui->infoTextStrong->setText(
tr(
"%1 is currently syncing. It will download headers and blocks from peers and validate them until reaching the tip of the block chain.").
arg(
CLIENT_NAME));
49 if (
obj == parent()) {
50 if (ev->type() == QEvent::Resize) {
60 else if (ev->type() == QEvent::ChildAdded) {
66 ui->closeButton->setFocus(Qt::OtherFocusReason);
69 return QWidget::eventFilter(
obj, ev);
74 if (ev->type() == QEvent::ParentAboutToChange) {
75 if (parent()) parent()->removeEventFilter(
this);
77 else if (ev->type() == QEvent::ParentChange) {
79 parent()->installEventFilter(
this);
83 return QWidget::event(ev);
125 ui->progressIncreasePerH->setText(QString::number(
progressPerHour * 100,
'f', 2)+
"%");
131 ui->expectedTimeLeft->setText(QObject::tr(
"unknown"));
141 ui->newestBlockDate->setText(
blockDate.toString());
160 ui->expectedTimeLeft->setText(
tr(
"Unknown…"));
171 ui->numberOfBlocksLeft->setText(
tr(
"Unknown. Pre-syncing Headers (%1, %2%)…").
arg(height).
arg(QString::number(100.0 / (height +
est_headers_left) * height,
'f', 1)));
194 m_animation.start(QAbstractAnimation::KeepWhenStopped);
198 ui->closeButton->setFocus(Qt::OtherFocusReason);
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)
int64_t nPowTargetSpacing
constexpr auto Ticks(Dur2 d)
Helper to count the seconds of a duration/time_point.