aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-02-25 19:07:53 +0100
committerLuke Dashjr <luke-jr+git@utopios.org>2012-02-27 13:07:26 -0500
commitef48e9b7dfde66368c27ed34f5f42de1b8e781f9 (patch)
treefa13220ba19b68c7c611f2b12601daa7e862e339
parent0b11082d361ec08bca5025dbbc7f0b78c0fb8e13 (diff)
downloadbitcoin-ef48e9b7dfde66368c27ed34f5f42de1b8e781f9.tar.xz
In UI, handle cases in which the last received block was generated in the future (secs<0)
Fixes #874.
-rw-r--r--src/qt/bitcoingui.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index cfcff136e0..3c9a773f4e 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -470,7 +470,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);
}
@@ -490,7 +494,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
@@ -500,8 +504,11 @@ void BitcoinGUI::setNumBlocks(int count)
syncIconMovie->start();
}
- tooltip += QString("\n");
- tooltip += tr("Last received block was generated %1.").arg(text);
+ if(!text.isEmpty())
+ {
+ tooltip += QString("\n");
+ tooltip += tr("Last received block was generated %1.").arg(text);
+ }
labelBlocksIcon->setToolTip(tooltip);
progressBarLabel->setToolTip(tooltip);