|
|
@ -356,6 +356,7 @@ void BitcoinGUI::setClientModel(ClientModel *clientModel) |
|
|
|
// Report errors from network/worker thread
|
|
|
|
// Report errors from network/worker thread
|
|
|
|
connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool))); |
|
|
|
connect(clientModel, SIGNAL(error(QString,QString,bool)), this, SLOT(error(QString,QString,bool))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
overviewPage->setClientModel(clientModel); |
|
|
|
rpcConsole->setClientModel(clientModel); |
|
|
|
rpcConsole->setClientModel(clientModel); |
|
|
|
addressBookPage->setOptionsModel(clientModel->getOptionsModel()); |
|
|
|
addressBookPage->setOptionsModel(clientModel->getOptionsModel()); |
|
|
|
receiveCoinsPage->setOptionsModel(clientModel->getOptionsModel()); |
|
|
|
receiveCoinsPage->setOptionsModel(clientModel->getOptionsModel()); |
|
|
@ -372,8 +373,7 @@ void BitcoinGUI::setWalletModel(WalletModel *walletModel) |
|
|
|
|
|
|
|
|
|
|
|
// Put transaction list in tabs
|
|
|
|
// Put transaction list in tabs
|
|
|
|
transactionView->setModel(walletModel); |
|
|
|
transactionView->setModel(walletModel); |
|
|
|
|
|
|
|
overviewPage->setWalletModel(walletModel); |
|
|
|
overviewPage->setModel(walletModel); |
|
|
|
|
|
|
|
addressBookPage->setModel(walletModel->getAddressTableModel()); |
|
|
|
addressBookPage->setModel(walletModel->getAddressTableModel()); |
|
|
|
receiveCoinsPage->setModel(walletModel->getAddressTableModel()); |
|
|
|
receiveCoinsPage->setModel(walletModel->getAddressTableModel()); |
|
|
|
sendCoinsPage->setModel(walletModel); |
|
|
|
sendCoinsPage->setModel(walletModel); |
|
|
@ -481,7 +481,6 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) |
|
|
|
return; |
|
|
|
return; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString strStatusBarWarnings = clientModel->getStatusBarWarnings(); |
|
|
|
|
|
|
|
QString tooltip; |
|
|
|
QString tooltip; |
|
|
|
|
|
|
|
|
|
|
|
if(count < nTotalBlocks) |
|
|
|
if(count < nTotalBlocks) |
|
|
@ -489,35 +488,23 @@ void BitcoinGUI::setNumBlocks(int count, int nTotalBlocks) |
|
|
|
int nRemainingBlocks = nTotalBlocks - count; |
|
|
|
int nRemainingBlocks = nTotalBlocks - count; |
|
|
|
float nPercentageDone = count / (nTotalBlocks * 0.01f); |
|
|
|
float nPercentageDone = count / (nTotalBlocks * 0.01f); |
|
|
|
|
|
|
|
|
|
|
|
if (strStatusBarWarnings.isEmpty()) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
progressBarLabel->setText(tr(clientModel->isImporting() ? "Importing blocks..." : "Synchronizing with network...")); |
|
|
|
progressBarLabel->setText(tr(clientModel->isImporting() ? "Importing blocks..." : "Synchronizing with network...")); |
|
|
|
progressBarLabel->setVisible(true); |
|
|
|
progressBarLabel->setVisible(true); |
|
|
|
progressBar->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks)); |
|
|
|
progressBar->setFormat(tr("~%n block(s) remaining", "", nRemainingBlocks)); |
|
|
|
progressBar->setMaximum(nTotalBlocks); |
|
|
|
progressBar->setMaximum(nTotalBlocks); |
|
|
|
progressBar->setValue(count); |
|
|
|
progressBar->setValue(count); |
|
|
|
progressBar->setVisible(true); |
|
|
|
progressBar->setVisible(true); |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
tooltip = tr("Downloaded %1 of %2 blocks of transaction history (%3% done).").arg(count).arg(nTotalBlocks).arg(nPercentageDone, 0, 'f', 2); |
|
|
|
tooltip = tr("Downloaded %1 of %2 blocks of transaction history (%3% done).").arg(count).arg(nTotalBlocks).arg(nPercentageDone, 0, 'f', 2); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
if (strStatusBarWarnings.isEmpty()) |
|
|
|
|
|
|
|
progressBarLabel->setVisible(false); |
|
|
|
progressBarLabel->setVisible(false); |
|
|
|
|
|
|
|
|
|
|
|
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); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// 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(); |
|
|
|
QDateTime lastBlockDate = clientModel->getLastBlockDate(); |
|
|
|
int secs = lastBlockDate.secsTo(QDateTime::currentDateTime()); |
|
|
|
int secs = lastBlockDate.secsTo(QDateTime::currentDateTime()); |
|
|
|
QString text; |
|
|
|
QString text; |
|
|
|