aboutsummaryrefslogtreecommitdiff
path: root/src/qt
diff options
context:
space:
mode:
authorMarcoFalke <falke.marco@gmail.com>2016-09-27 20:52:16 +0200
committerMarcoFalke <falke.marco@gmail.com>2016-10-10 17:07:43 +0200
commitfafeec3cf2ceb5330a04539adc90b27dc7e6fd42 (patch)
tree38406e756b6f89a69504bb5e0f9935d8714bfd84 /src/qt
parentbf8e68aba68d7c6a4c17a5c05fa3fa61a8da2bdd (diff)
[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
Diffstat (limited to 'src/qt')
-rw-r--r--src/qt/forms/modaloverlay.ui3
-rw-r--r--src/qt/modaloverlay.cpp6
2 files changed, 5 insertions, 4 deletions
diff --git a/src/qt/forms/modaloverlay.ui b/src/qt/forms/modaloverlay.ui
index b16ecafbe4..73223735f5 100644
--- a/src/qt/forms/modaloverlay.ui
+++ b/src/qt/forms/modaloverlay.ui
@@ -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>
diff --git a/src/qt/modaloverlay.cpp b/src/qt/modaloverlay.cpp
index 5caade7d38..ae0d8f5f63 100644
--- a/src/qt/modaloverlay.cpp
+++ b/src/qt/modaloverlay.cpp
@@ -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
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
// 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);