Browse Source

Merge #8906: [qt] sync-overlay: Don't show progress twice

fafeec3 [qt] sync-overlay: Don't show progress twice (MarcoFalke)
0.14
Wladimir J. van der Laan 8 years ago
parent
commit
088d1f4413
No known key found for this signature in database
GPG Key ID: 74810B012346C9A6
  1. 3
      src/qt/forms/modaloverlay.ui
  2. 6
      src/qt/modaloverlay.cpp

3
src/qt/forms/modaloverlay.ui

@ -276,6 +276,9 @@ QLabel { color: rgb(40,40,40); }</string> @@ -276,6 +276,9 @@ QLabel { color: rgb(40,40,40); }</string>
<property name="value">
<number>24</number>
</property>
<property name="format">
<string/>
</property>
</widget>
</item>
</layout>

6
src/qt/modaloverlay.cpp

@ -77,7 +77,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri @@ -77,7 +77,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
QDateTime currentDate = QDateTime::currentDateTime();
// keep a vector of samples of verification progress at height
blockProcessTime.push_front(qMakePair(currentDate.currentMSecsSinceEpoch(), nVerificationProgress));
blockProcessTime.push_front(qMakePair(currentDate.toMSecsSinceEpoch(), nVerificationProgress));
// show progress speed if we have more then one sample
if (blockProcessTime.size() >= 2)
@ -93,8 +93,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri @@ -93,8 +93,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
QPair<qint64, double> sample = blockProcessTime[i];
// take first sample after 500 seconds or last available one
if (sample.first < (currentDate.currentMSecsSinceEpoch() - 500*1000) || i == blockProcessTime.size()-1)
{
if (sample.first < (currentDate.toMSecsSinceEpoch() - 500 * 1000) || i == blockProcessTime.size() - 1) {
progressDelta = progressStart-sample.second;
timeDelta = blockProcessTime[0].first - sample.first;
progressPerHour = progressDelta/(double)timeDelta*1000*3600;
@ -108,7 +107,6 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri @@ -108,7 +107,6 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
// show expected remaining time
ui->expectedTimeLeft->setText(GUIUtil::formateNiceTimeOffset(remainingMSecs/1000.0));
// keep maximal 5000 samples
static const int MAX_SAMPLES = 5000;
if (blockProcessTime.count() > MAX_SAMPLES)
blockProcessTime.remove(MAX_SAMPLES, blockProcessTime.count()-MAX_SAMPLES);

Loading…
Cancel
Save