Skip to content

Commit fafeec3

Browse files
author
MarcoFalke
committed
[qt] sync-overlay: Don't show progress twice
* Don't show integer progress in progress bar. (Already shown in front of progress bar) * Also, use non-static method to get current msecs
1 parent bf8e68a commit fafeec3

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed

src/qt/forms/modaloverlay.ui

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,9 @@ QLabel { color: rgb(40,40,40); }</string>
276276
<property name="value">
277277
<number>24</number>
278278
</property>
279+
<property name="format">
280+
<string/>
281+
</property>
279282
</widget>
280283
</item>
281284
</layout>

src/qt/modaloverlay.cpp

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
7777
QDateTime currentDate = QDateTime::currentDateTime();
7878

7979
// keep a vector of samples of verification progress at height
80-
blockProcessTime.push_front(qMakePair(currentDate.currentMSecsSinceEpoch(), nVerificationProgress));
80+
blockProcessTime.push_front(qMakePair(currentDate.toMSecsSinceEpoch(), nVerificationProgress));
8181

8282
// show progress speed if we have more then one sample
8383
if (blockProcessTime.size() >= 2)
@@ -93,8 +93,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
9393
QPair<qint64, double> sample = blockProcessTime[i];
9494

9595
// take first sample after 500 seconds or last available one
96-
if (sample.first < (currentDate.currentMSecsSinceEpoch() - 500*1000) || i == blockProcessTime.size()-1)
97-
{
96+
if (sample.first < (currentDate.toMSecsSinceEpoch() - 500 * 1000) || i == blockProcessTime.size() - 1) {
9897
progressDelta = progressStart-sample.second;
9998
timeDelta = blockProcessTime[0].first - sample.first;
10099
progressPerHour = progressDelta/(double)timeDelta*1000*3600;
@@ -108,7 +107,6 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
108107
// show expected remaining time
109108
ui->expectedTimeLeft->setText(GUIUtil::formateNiceTimeOffset(remainingMSecs/1000.0));
110109

111-
// keep maximal 5000 samples
112110
static const int MAX_SAMPLES = 5000;
113111
if (blockProcessTime.count() > MAX_SAMPLES)
114112
blockProcessTime.remove(MAX_SAMPLES, blockProcessTime.count()-MAX_SAMPLES);

0 commit comments

Comments
 (0)