mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-01-11 12:22:39 -03:00
[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
This commit is contained in:
parent
bf8e68aba6
commit
fafeec3cf2
2 changed files with 5 additions and 4 deletions
|
@ -276,6 +276,9 @@ QLabel { color: rgb(40,40,40); }</string>
|
||||||
<property name="value">
|
<property name="value">
|
||||||
<number>24</number>
|
<number>24</number>
|
||||||
</property>
|
</property>
|
||||||
|
<property name="format">
|
||||||
|
<string/>
|
||||||
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
</layout>
|
</layout>
|
||||||
|
|
|
@ -77,7 +77,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||||
QDateTime currentDate = QDateTime::currentDateTime();
|
QDateTime currentDate = QDateTime::currentDateTime();
|
||||||
|
|
||||||
// keep a vector of samples of verification progress at height
|
// 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
|
// show progress speed if we have more then one sample
|
||||||
if (blockProcessTime.size() >= 2)
|
if (blockProcessTime.size() >= 2)
|
||||||
|
@ -93,8 +93,7 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||||
QPair<qint64, double> sample = blockProcessTime[i];
|
QPair<qint64, double> sample = blockProcessTime[i];
|
||||||
|
|
||||||
// take first sample after 500 seconds or last available one
|
// 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;
|
progressDelta = progressStart-sample.second;
|
||||||
timeDelta = blockProcessTime[0].first - sample.first;
|
timeDelta = blockProcessTime[0].first - sample.first;
|
||||||
progressPerHour = progressDelta/(double)timeDelta*1000*3600;
|
progressPerHour = progressDelta/(double)timeDelta*1000*3600;
|
||||||
|
@ -108,7 +107,6 @@ void ModalOverlay::tipUpdate(int count, const QDateTime& blockDate, double nVeri
|
||||||
// show expected remaining time
|
// show expected remaining time
|
||||||
ui->expectedTimeLeft->setText(GUIUtil::formateNiceTimeOffset(remainingMSecs/1000.0));
|
ui->expectedTimeLeft->setText(GUIUtil::formateNiceTimeOffset(remainingMSecs/1000.0));
|
||||||
|
|
||||||
// keep maximal 5000 samples
|
|
||||||
static const int MAX_SAMPLES = 5000;
|
static const int MAX_SAMPLES = 5000;
|
||||||
if (blockProcessTime.count() > MAX_SAMPLES)
|
if (blockProcessTime.count() > MAX_SAMPLES)
|
||||||
blockProcessTime.remove(MAX_SAMPLES, blockProcessTime.count()-MAX_SAMPLES);
|
blockProcessTime.remove(MAX_SAMPLES, blockProcessTime.count()-MAX_SAMPLES);
|
||||||
|
|
Loading…
Reference in a new issue