aboutsummaryrefslogtreecommitdiff
path: root/src/qt/bitcoingui.cpp
diff options
context:
space:
mode:
authorWladimir J. van der Laan <laanwj@gmail.com>2012-10-24 21:47:07 +0200
committerWladimir J. van der Laan <laanwj@gmail.com>2012-10-25 07:33:45 +0200
commit62e21fb5d00c33df37b6faaf0626da120c4783bc (patch)
tree27c5baae0240a5ff627119d5cbe98813a673f31b /src/qt/bitcoingui.cpp
parent55913c997112c78d6058edfa210b6275cde853a6 (diff)
downloadbitcoin-62e21fb5d00c33df37b6faaf0626da120c4783bc.tar.xz
Show warning when using prerelease version
Implements #1948 - Add macro `CLIENT_VERSION_IS_RELEASE` to clientversion.h - When running a prerelease (the above macro is `false`): - In UI, show an orange warning bar at the top. This will be used for other warnings (and alerts) as well, instead of the status bar. - For `bitcoind`, show the warning in the "errors" field in `getinfo` response.
Diffstat (limited to 'src/qt/bitcoingui.cpp')
-rw-r--r--src/qt/bitcoingui.cpp31
1 files changed, 9 insertions, 22 deletions
diff --git a/src/qt/bitcoingui.cpp b/src/qt/bitcoingui.cpp
index 0d269ea210..ed0c845ed9 100644
--- a/src/qt/bitcoingui.cpp
+++ b/src/qt/bitcoingui.cpp
@@ -356,6 +356,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel)
// Report errors from network/worker thread
connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool)));
+ overviewPage->setClientModel(clientModel);
rpcConsole->setClientModel(clientModel);
addressBookPage->setOptionsModel(clientModel->getOptionsModel());
receiveCoinsPage->setOptionsModel(clientModel->getOptionsModel());
@@ -372,8 +373,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel)
// Put transaction list in tabs
transactionView->setModel(walletModel);
-
- overviewPage->setModel(walletModel);
+ overviewPage->setWalletModel(walletModel);
addressBookPage->setModel(walletModel->getAddressTableModel());
receiveCoinsPage->setModel(walletModel->getAddressTableModel());
sendCoinsPage->setModel(walletModel);
@@ -481,7 +481,6 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
return;
}
- QString strStatusBarWarnings = clientModel->getStatusBarWarnings();
QString tooltip;
if(count < nTotalBlocks)
@@ -489,35 +488,23 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks)
int nRemainingBlocks = nTotalBlocks - count;
float nPercentageDone = count / (nTotalBlocks * 0.01f);
- if (strStatusBarWarnings.isEmpty())
- {
- progressBarLabel->setText(tr(clientModel->isImporting() ? "Importing blocks..." : "Synchronizing with network..."));
- progressBarLabel->setVisible(true);
- progressBar->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks));
- progressBar->setMaximum(nTotalBlocks);
- progressBar->setValue(count);
- progressBar->setVisible(true);
- }
+ progressBarLabel->setText(tr(clientModel->isImporting() ? "Importing blocks..." : "Synchronizing with network..."));
+ progressBarLabel->setVisible(true);
+ progressBar->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks));
+ progressBar->setMaximum(nTotalBlocks);
+ progressBar->setValue(count);
+ progressBar->setVisible(true);
tooltip = tr("Downloaded %1 of %2 blocks of transaction history (%3% done).").arg(count).arg(nTotalBlocks).arg(nPercentageDone, 0, 'f', 2);
}
else
{
- if (strStatusBarWarnings.isEmpty())
- progressBarLabel->setVisible(false);
+ progressBarLabel->setVisible(false);
progressBar->setVisible(false);
tooltip = tr("Downloaded %1 blocks of transaction history.").arg(count);
}
- // Override progressBarLabel text and hide progress bar, 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(QDateTime::currentDateTime());
QString text;