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) {
51 QResizeEvent * rev =
static_cast<QResizeEvent*
>(ev);
54 setGeometry(0, height(), width(), height());
60 else if (ev->type() == QEvent::ChildAdded) {
65 if (obj ==
ui->closeButton && ev->type() == QEvent::FocusOut &&
layerIsVisible) {
66 ui->closeButton->setFocus(Qt::OtherFocusReason);
69 return QWidget::eventFilter(obj, ev);
100 QDateTime currentDate = QDateTime::currentDateTime();
103 blockProcessTime.push_front(qMakePair(currentDate.toMSecsSinceEpoch(), nVerificationProgress));
107 double progressDelta = 0;
108 double progressPerHour = 0;
109 qint64 timeDelta = 0;
110 qint64 remainingMSecs = 0;
111 double remainingProgress = 1.0 - nVerificationProgress;
116 if (sample.first < (currentDate.toMSecsSinceEpoch() - 500 * 1000) || i ==
blockProcessTime.size() - 1) {
119 progressPerHour = (progressDelta > 0) ? progressDelta / (
double)timeDelta * 1000 * 3600 : 0;
120 remainingMSecs = (progressDelta > 0) ? remainingProgress / progressDelta * timeDelta : -1;
125 ui->progressIncreasePerH->setText(QString::number(progressPerHour * 100,
'f', 2)+
"%");
128 if(remainingMSecs >= 0) {
131 ui->expectedTimeLeft->setText(QObject::tr(
"unknown"));
134 static const int MAX_SAMPLES = 5000;
141 ui->newestBlockDate->setText(blockDate.toString());
144 ui->percentageProgress->setText(QString::number(nVerificationProgress*100,
'f', 2)+
"%");
160 ui->expectedTimeLeft->setText(tr(
"Unknown…"));