X-Git-Url: https://git.novaco.in/?p=novacoin.git;a=blobdiff_plain;f=src%2Fqt%2Fbitcoingui.cpp;h=1c496833648802e841aa60c01b1bcdeea82912d3;hp=81cebfb4a45d530c7ed7e7c2b6f11e709a98f54e;hb=fc90967876a0b8c762cba4a9f40a80db7a8b0432;hpb=01ea41b203d86d8577227a17760a54578630a3d2 diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp index 81cebfb..1c49683 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" @@ -423,15 +424,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); } @@ -480,6 +497,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