Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 627 Lines • ▼ Show 20 Lines | #ifdef ENABLE_WALLET | ||||
m_wallet_selector_action = appToolBar->addWidget(m_wallet_selector); | m_wallet_selector_action = appToolBar->addWidget(m_wallet_selector); | ||||
m_wallet_selector_label_action->setVisible(false); | m_wallet_selector_label_action->setVisible(false); | ||||
m_wallet_selector_action->setVisible(false); | m_wallet_selector_action->setVisible(false); | ||||
#endif | #endif | ||||
} | } | ||||
} | } | ||||
void BitcoinGUI::setClientModel(ClientModel *_clientModel) { | void BitcoinGUI::setClientModel(ClientModel *_clientModel, | ||||
interfaces::BlockAndHeaderTipInfo *tip_info) { | |||||
this->clientModel = _clientModel; | this->clientModel = _clientModel; | ||||
if (_clientModel) { | if (_clientModel) { | ||||
// Create system tray menu (or setup the dock menu) that late to prevent | // Create system tray menu (or setup the dock menu) that late to prevent | ||||
// users from calling actions, while the client has not yet fully loaded | // users from calling actions, while the client has not yet fully loaded | ||||
createTrayIconMenu(); | createTrayIconMenu(); | ||||
// Keep up to date with client | // Keep up to date with client | ||||
updateNetworkState(); | updateNetworkState(); | ||||
connect(_clientModel, &ClientModel::numConnectionsChanged, this, | connect(_clientModel, &ClientModel::numConnectionsChanged, this, | ||||
&BitcoinGUI::setNumConnections); | &BitcoinGUI::setNumConnections); | ||||
connect(_clientModel, &ClientModel::networkActiveChanged, this, | connect(_clientModel, &ClientModel::networkActiveChanged, this, | ||||
&BitcoinGUI::setNetworkActive); | &BitcoinGUI::setNetworkActive); | ||||
modalOverlay->setKnownBestHeight( | modalOverlay->setKnownBestHeight( | ||||
_clientModel->getHeaderTipHeight(), | tip_info->header_height, | ||||
QDateTime::fromTime_t(_clientModel->getHeaderTipTime())); | QDateTime::fromTime_t(tip_info->header_time)); | ||||
setNumBlocks(m_node.getNumBlocks(), | setNumBlocks(tip_info->block_height, | ||||
QDateTime::fromTime_t(m_node.getLastBlockTime()), | QDateTime::fromTime_t(tip_info->block_time), | ||||
m_node.getVerificationProgress(), false, | tip_info->verification_progress, false, | ||||
SynchronizationState::INIT_DOWNLOAD); | SynchronizationState::INIT_DOWNLOAD); | ||||
connect(_clientModel, &ClientModel::numBlocksChanged, this, | connect(_clientModel, &ClientModel::numBlocksChanged, this, | ||||
&BitcoinGUI::setNumBlocks); | &BitcoinGUI::setNumBlocks); | ||||
// Receive and report messages from client model | // Receive and report messages from client model | ||||
connect(_clientModel, &ClientModel::message, | connect(_clientModel, &ClientModel::message, | ||||
[this](const QString &title, const QString &message, | [this](const QString &title, const QString &message, | ||||
unsigned int style) { | unsigned int style) { | ||||
this->message(title, message, style); | this->message(title, message, style); | ||||
}); | }); | ||||
// Show progress dialog | // Show progress dialog | ||||
connect(_clientModel, &ClientModel::showProgress, this, | connect(_clientModel, &ClientModel::showProgress, this, | ||||
&BitcoinGUI::showProgress); | &BitcoinGUI::showProgress); | ||||
rpcConsole->setClientModel(_clientModel); | rpcConsole->setClientModel(_clientModel, tip_info->block_height, | ||||
tip_info->block_time, | |||||
tip_info->verification_progress); | |||||
updateProxyIcon(); | updateProxyIcon(); | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
if (walletFrame) { | if (walletFrame) { | ||||
walletFrame->setClientModel(_clientModel); | walletFrame->setClientModel(_clientModel); | ||||
} | } | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
▲ Show 20 Lines • Show All 946 Lines • Show Last 20 Lines |