Fix empty tooltip during sync under specific conditions (#1637)
* Fix empty tooltip during sync under specific conditions * Move IsBlockchainSynced check
This commit is contained in:
parent
753b1e486b
commit
026ad8421a
@ -1065,6 +1065,10 @@ void BitcoinGUI::setAdditionalDataSyncProgress(double nSyncProgress)
|
|||||||
if(!clientModel)
|
if(!clientModel)
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
// No additional data sync should be happening while blockchain is not synced, nothing to update
|
||||||
|
if(!masternodeSync.IsBlockchainSynced())
|
||||||
|
return;
|
||||||
|
|
||||||
// Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
|
// Prevent orphan statusbar messages (e.g. hover Quit in main menu, wait until chain-sync starts -> garbelled text)
|
||||||
statusBar()->clearMessage();
|
statusBar()->clearMessage();
|
||||||
|
|
||||||
@ -1073,37 +1077,34 @@ void BitcoinGUI::setAdditionalDataSyncProgress(double nSyncProgress)
|
|||||||
// Set icon state: spinning if catching up, tick otherwise
|
// Set icon state: spinning if catching up, tick otherwise
|
||||||
QString theme = GUIUtil::getThemeName();
|
QString theme = GUIUtil::getThemeName();
|
||||||
|
|
||||||
if(masternodeSync.IsBlockchainSynced())
|
QString strSyncStatus;
|
||||||
{
|
tooltip = tr("Up to date") + QString(".<br>") + tooltip;
|
||||||
QString strSyncStatus;
|
|
||||||
tooltip = tr("Up to date") + QString(".<br>") + tooltip;
|
|
||||||
|
|
||||||
if(masternodeSync.IsSynced()) {
|
if(masternodeSync.IsSynced()) {
|
||||||
progressBarLabel->setVisible(false);
|
progressBarLabel->setVisible(false);
|
||||||
progressBar->setVisible(false);
|
progressBar->setVisible(false);
|
||||||
labelBlocksIcon->setPixmap(QIcon(":/icons/" + theme + "/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
|
labelBlocksIcon->setPixmap(QIcon(":/icons/" + theme + "/synced").pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(QString(
|
labelBlocksIcon->setPixmap(platformStyle->SingleColorIcon(QString(
|
||||||
":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0')))
|
":/movies/spinner-%1").arg(spinnerFrame, 3, 10, QChar('0')))
|
||||||
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
|
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE));
|
||||||
spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES;
|
spinnerFrame = (spinnerFrame + 1) % SPINNER_FRAMES;
|
||||||
|
|
||||||
#ifdef ENABLE_WALLET
|
#ifdef ENABLE_WALLET
|
||||||
if(walletFrame)
|
if(walletFrame)
|
||||||
walletFrame->showOutOfSyncWarning(false);
|
walletFrame->showOutOfSyncWarning(false);
|
||||||
#endif // ENABLE_WALLET
|
#endif // ENABLE_WALLET
|
||||||
|
|
||||||
progressBar->setFormat(tr("Synchronizing additional data: %p%"));
|
progressBar->setFormat(tr("Synchronizing additional data: %p%"));
|
||||||
progressBar->setMaximum(1000000000);
|
progressBar->setMaximum(1000000000);
|
||||||
progressBar->setValue(nSyncProgress * 1000000000.0 + 0.5);
|
progressBar->setValue(nSyncProgress * 1000000000.0 + 0.5);
|
||||||
}
|
|
||||||
|
|
||||||
strSyncStatus = QString(masternodeSync.GetSyncStatus().c_str());
|
|
||||||
progressBarLabel->setText(strSyncStatus);
|
|
||||||
tooltip = strSyncStatus + QString("<br>") + tooltip;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
strSyncStatus = QString(masternodeSync.GetSyncStatus().c_str());
|
||||||
|
progressBarLabel->setText(strSyncStatus);
|
||||||
|
tooltip = strSyncStatus + QString("<br>") + tooltip;
|
||||||
|
|
||||||
// Don't word-wrap this (fixed-width) tooltip
|
// Don't word-wrap this (fixed-width) tooltip
|
||||||
tooltip = QString("<nobr>") + tooltip + QString("</nobr>");
|
tooltip = QString("<nobr>") + tooltip + QString("</nobr>");
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user