aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWladimir J. van der Laan <[email protected]>2012-07-27 05:54:19 -0700
committerWladimir J. van der Laan <[email protected]>2012-07-27 05:54:19 -0700
commitc1aed4eff468d8152231b7a857c2edd4e10eca80 (patch)
treec859d31c1da751003324bcdb2d372fbf400557a0 /src
parentMerge pull request #1571 from Diapolo/optionsdialog_cleanup (diff)
parentsmall update for BitcoinGUI::setNumBlocks() function (diff)
downloaddiscoin-c1aed4eff468d8152231b7a857c2edd4e10eca80.tar.xz
discoin-c1aed4eff468d8152231b7a857c2edd4e10eca80.zip
Merge pull request #1594 from Diapolo/GUI_testnet3_fix
small update for BitcoinGUI::setNumBlocks() function
Diffstat (limited to 'src')
-rw-r--r--src/qt/bitcoingui.cpp29
-rw-r--r--src/qt/bitcoingui.h2
2 files changed, 15 insertions, 16 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 7b0e6f3bc..afb829e08 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -501,6 +501,7 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
return;
}
+ QString strStatusBarWarnings = clientModel->getStatusBarWarnings();
QString tooltip;
if(count < nTotalBlocks)
@@ -508,7 +509,7 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
int nRemainingBlocks = nTotalBlocks - count;
float nPercentageDone = count / (nTotalBlocks * 0.01f);
- if (clientModel->getStatusBarWarnings() == "")
+ if (strStatusBarWarnings.isEmpty())
{
progressBarLabel->setText(tr("Synchronizing with network..."));
progressBarLabel->setVisible(true);
@@ -517,30 +518,28 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
progressBar->setValue(count);
progressBar->setVisible(true);
}
- else
- {
- progressBarLabel->setText(clientModel->getStatusBarWarnings());
- progressBarLabel->setVisible(true);
- progressBar->setVisible(false);
- }
+
tooltip = tr("Downloaded %1 of %2 blocks of transaction history (%3% done).").arg(count).arg(nTotalBlocks).arg(nPercentageDone, 0, 'f', 2);
}
else
{
- if (clientModel->getStatusBarWarnings() == "")
+ if (strStatusBarWarnings.isEmpty())
progressBarLabel->setVisible(false);
- else
- {
- progressBarLabel->setText(clientModel->getStatusBarWarnings());
- progressBarLabel->setVisible(true);
- }
+
progressBar->setVisible(false);
tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count);
}
- QDateTime now = QDateTime::currentDateTime();
+ // Override progressBarLabel text and hide progressBar, when we have warnings to display
+ if (!strStatusBarWarnings.isEmpty())
+ {
+ progressBarLabel->setText(strStatusBarWarnings);
+ progressBarLabel->setVisible(true);
+ progressBar->setVisible(false);
+ }
+
QDateTime lastBlockDate = clientModel->getLastBlockDate();
- int secs = lastBlockDate.secsTo(now);
+ int secs = lastBlockDate.secsTo(QDateTime::currentDateTime());
QString text;
// Represent time from last generated block in human readable text
diff --git a/src/qt/bitcoingui.h b/src/qt/bitcoingui.h
index 9e0cd0c19..adc75b048 100644
--- a/src/qt/bitcoingui.h
+++ b/src/qt/bitcoingui.h
@@ -112,7 +112,7 @@ public slots:
/** Set number of connections shown in the UI */
void setNumConnections(int count);
/** Set number of blocks shown in the UI */
- void setNumBlocks(int count, int countOfPeers);
+ void setNumBlocks(int count, int nTotalBlocks);
/** Set the encryption status as shown in the UI.
@param[in] status current encryption status
@see WalletModel::EncryptionStatus