mirror of
https://github.com/dashpay/dash.git
synced 2024-12-27 04:52:59 +01:00
In UI, handle cases in which the last received block was generated in the future (secs<0)
Fixes #874.
This commit is contained in:
parent
f7b8f824de
commit
71ba9abba6
@ -505,7 +505,11 @@ void BitcoinGUI::setNumBlocks(int count)
|
||||
QString text;
|
||||
|
||||
// Represent time from last generated block in human readable text
|
||||
if(secs < 60)
|
||||
if(secs <= 0)
|
||||
{
|
||||
// Fully up to date. Leave text empty.
|
||||
}
|
||||
else if(secs < 60)
|
||||
{
|
||||
text = tr("%n second(s) ago","",secs);
|
||||
}
|
||||
@ -525,7 +529,7 @@ void BitcoinGUI::setNumBlocks(int count)
|
||||
// Set icon state: spinning if catching up, tick otherwise
|
||||
if(secs < 30*60)
|
||||
{
|
||||
tooltip = tr("Up to date") + QString("\n") + tooltip;
|
||||
tooltip = tr("Up to date") + QString(".\n") + tooltip;
|
||||
labelBlocksIcon->setPixmap(QIcon(":/icons/synced").pixmap(STATUSBAR_ICONSIZE,STATUSBAR_ICONSIZE));
|
||||
}
|
||||
else
|
||||
@ -535,8 +539,11 @@ void BitcoinGUI::setNumBlocks(int count)
|
||||
syncIconMovie->start();
|
||||
}
|
||||
|
||||
if(!text.isEmpty())
|
||||
{
|
||||
tooltip += QString("\n");
|
||||
tooltip += tr("Last received block was generated %1.").arg(text);
|
||||
}
|
||||
|
||||
labelBlocksIcon->setToolTip(tooltip);
|
||||
progressBarLabel->setToolTip(tooltip);
|
||||
|
Loading…
Reference in New Issue
Block a user