diff options
author | Gavin Andresen <gavinandresen@gmail.com> | 2011-12-13 12:56:26 -0800 |
---|---|---|
committer | Gavin Andresen <gavinandresen@gmail.com> | 2011-12-13 12:56:26 -0800 |
commit | b12fc3e11223557855bb2394e1097afbf0de0b79 (patch) | |
tree | 50d59133f31d2baff8abc22aa41bbdb444186afc /src/qt/bitcoingui.cpp | |
parent | 857aa73783a991e6d750c99988821585c1864e21 (diff) | |
parent | 7ca47cece7854a4efb4a8dcb68b93edbde1a76fb (diff) |
Fix status bar not displaying Alerts.
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r-- | src/qt/bitcoingui.cpp | 40 |
1 files changed, 35 insertions, 5 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index bdc9821844..60c75286a7 100644 --- a/src/qt/bitcoingui.cpp +++ b/src/qt/bitcoingui.cpp @@ -2,6 +2,7 @@ * Qt4 bitcoin GUI. * * W.J. van der Laan 2011 + * The Bitcoin Developers 2011 */ #include "bitcoingui.h" #include "transactiontablemodel.h" @@ -417,15 +418,31 @@ void BitcoinGUI::setNumBlocks(int count) if(count < total) { - progressBarLabel->setVisible(true); - progressBar->setVisible(true); - progressBar->setMaximum(total - initTotal); - progressBar->setValue(count - initTotal); + if (clientModel->getStatusBarWarnings() == "") + { + progressBarLabel->setVisible(true); + progressBarLabel->setText(tr("Synchronizing with network...")); + progressBar->setVisible(true); + progressBar->setMaximum(total - initTotal); + progressBar->setValue(count - initTotal); + } + else + { + progressBarLabel->setText(clientModel->getStatusBarWarnings()); + progressBarLabel->setVisible(true); + progressBar->setVisible(false); + } tooltip = tr("Downloaded %1 of %2 blocks of transaction history.").arg(count).arg(total); } else { - progressBarLabel->setVisible(false); + if (clientModel->getStatusBarWarnings() == "") + progressBarLabel->setVisible(false); + else + { + progressBarLabel->setText(clientModel->getStatusBarWarnings()); + progressBarLabel->setVisible(true); + } progressBar->setVisible(false); tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count); } @@ -474,6 +491,19 @@ void BitcoinGUI::setNumBlocks(int count) progressBar->setToolTip(tooltip); } +void BitcoinGUI::refreshStatusBar() +{ + /* Might display multiple times in the case of multiple alerts + static QString prevStatusBar; + QString newStatusBar = clientModel->getStatusBarWarnings(); + if (prevStatusBar != newStatusBar) + { + prevStatusBar = newStatusBar; + error(tr("Network Alert"), newStatusBar); + }*/ + setNumBlocks(clientModel->getNumBlocks()); +} + void BitcoinGUI::error(const QString &title, const QString &message) { // Report errors from network/worker thread |