|
|
@ -2,6 +2,7 @@ |
|
|
|
* Qt4 bitcoin GUI. |
|
|
|
* Qt4 bitcoin GUI. |
|
|
|
* |
|
|
|
* |
|
|
|
* W.J. van der Laan 2011 |
|
|
|
* W.J. van der Laan 2011 |
|
|
|
|
|
|
|
* The Bitcoin Developers 2011 |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
#include "bitcoingui.h" |
|
|
|
#include "bitcoingui.h" |
|
|
|
#include "transactiontablemodel.h" |
|
|
|
#include "transactiontablemodel.h" |
|
|
@ -416,16 +417,32 @@ void BitcoinGUI::setNumBlocks(int count) |
|
|
|
QString tooltip; |
|
|
|
QString tooltip; |
|
|
|
|
|
|
|
|
|
|
|
if(count < total) |
|
|
|
if(count < total) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (clientModel->getStatusBarWarnings() == "") |
|
|
|
{ |
|
|
|
{ |
|
|
|
progressBarLabel->setVisible(true); |
|
|
|
progressBarLabel->setVisible(true); |
|
|
|
|
|
|
|
progressBarLabel->setText(tr("Synchronizing with network...")); |
|
|
|
progressBar->setVisible(true); |
|
|
|
progressBar->setVisible(true); |
|
|
|
progressBar->setMaximum(total - initTotal); |
|
|
|
progressBar->setMaximum(total - initTotal); |
|
|
|
progressBar->setValue(count - 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); |
|
|
|
tooltip = tr("Downloaded %1 of %2 blocks of transaction history.").arg(count).arg(total); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
if (clientModel->getStatusBarWarnings() == "") |
|
|
|
progressBarLabel->setVisible(false); |
|
|
|
progressBarLabel->setVisible(false); |
|
|
|
|
|
|
|
else |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
progressBarLabel->setText(clientModel->getStatusBarWarnings()); |
|
|
|
|
|
|
|
progressBarLabel->setVisible(true); |
|
|
|
|
|
|
|
} |
|
|
|
progressBar->setVisible(false); |
|
|
|
progressBar->setVisible(false); |
|
|
|
tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count); |
|
|
|
tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count); |
|
|
|
} |
|
|
|
} |
|
|
@ -474,6 +491,19 @@ void BitcoinGUI::setNumBlocks(int count) |
|
|
|
progressBar->setToolTip(tooltip); |
|
|
|
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) |
|
|
|
void BitcoinGUI::error(const QString &title, const QString &message) |
|
|
|
{ |
|
|
|
{ |
|
|
|
// Report errors from network/worker thread
|
|
|
|
// Report errors from network/worker thread
|
|
|
|