diff options
| author | Wladimir J. van der Laan <[email protected]> | 2012-02-25 10:14:37 -0800 |
|---|---|---|
| committer | Wladimir J. van der Laan <[email protected]> | 2012-02-25 10:14:37 -0800 |
| commit | da9ab62fb7cfa3fa36eb81ce2503685a45c5d346 (patch) | |
| tree | f5b8d93cee96f9372874c640994b1b9e1edb2228 /src | |
| parent | Merge pull request #894 from dooglus/nosplash (diff) | |
| parent | In UI, handle cases in which the last received block was generated in the fut... (diff) | |
| download | discoin-da9ab62fb7cfa3fa36eb81ce2503685a45c5d346.tar.xz discoin-da9ab62fb7cfa3fa36eb81ce2503685a45c5d346.zip | |
Merge pull request #897 from laanwj/2012_02_fixnegativesecs
In UI, handle cases in which the last received block was generated in the future
Diffstat (limited to 'src')
| -rw-r--r-- | src/qt/bitcoingui.cpp | 15 |
1 files changed, 11 insertions, 4 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 65753a183..cd3cb443d 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -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(); } - 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); |