Skip to content

Commit

Permalink
[Qt] use NotifyHeaderTip's height and date for the progress update
Browse files Browse the repository at this point in the history
  • Loading branch information
jonasschnelli committed Oct 20, 2016
1 parent 0a261b6 commit 3154d6e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 9 deletions.
9 changes: 3 additions & 6 deletions src/qt/bitcoingui.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -717,13 +717,10 @@ void BitcoinGUI::setNumBlocks(int count, const QDateTime& blockDate, double nVer
{
if (modalOverlay)
{
if (header) {
/* use clientmodels getHeaderTipHeight and getHeaderTipTime because the NotifyHeaderTip signal does not fire when updating the best header */
modalOverlay->setKnownBestHeight(clientModel->getHeaderTipHeight(), QDateTime::fromTime_t(clientModel->getHeaderTipTime()));
}
else {
if (header)
modalOverlay->setKnownBestHeight(count, blockDate);
else
modalOverlay->tipUpdate(count, blockDate, nVerificationProgress);
}
}
if (!clientModel)
return;
Expand Down
4 changes: 2 additions & 2 deletions src/qt/forms/modaloverlay.ui
Original file line number Diff line number Diff line change
Expand Up @@ -219,7 +219,7 @@ QLabel { color: rgb(40,40,40); }</string>
<item row="0" column="1">
<widget class="QLabel" name="numberOfBlocksLeft">
<property name="text">
<string>unknown...</string>
<string>Unknown...</string>
</property>
</widget>
</item>
Expand All @@ -245,7 +245,7 @@ QLabel { color: rgb(40,40,40); }</string>
</sizepolicy>
</property>
<property name="text">
<string>unknown...</string>
<string>Unknown...</string>
</property>
</widget>
</item>
Expand Down
3 changes: 2 additions & 1 deletion src/qt/modaloverlay.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,8 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
if (estimateNumHeadersLeft < 24 && hasBestHeader) {
ui->numberOfBlocksLeft->setText(QString::number(bestHeaderHeight - count));
} else {
ui->expectedTimeLeft->setText(tr("Unknown. Syncing Headers..."));
ui->numberOfBlocksLeft->setText(tr("Unknown. Syncing Headers (%1)...").arg(bestHeaderHeight));
ui->expectedTimeLeft->setText(tr("Unknown..."));
}
}

Expand Down

0 comments on commit 3154d6e

Please sign in to comment.