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 532 Lines • ▼ Show 20 Lines | void BitcoinGUI::message(const QString &title, QString message, | ||||
} else if (style & CClientUIInterface::ICON_WARNING) { | } else if (style & CClientUIInterface::ICON_WARNING) { | ||||
nMBoxIcon = QMessageBox::Warning; | nMBoxIcon = QMessageBox::Warning; | ||||
nNotifyIcon = Notificator::Warning; | nNotifyIcon = Notificator::Warning; | ||||
} | } | ||||
if (style & CClientUIInterface::MODAL) { | if (style & CClientUIInterface::MODAL) { | ||||
// Check for buttons, use OK as default, if none was supplied | // Check for buttons, use OK as default, if none was supplied | ||||
QMessageBox::StandardButton buttons; | QMessageBox::StandardButton buttons; | ||||
if (!(buttons = (QMessageBox::StandardButton)( | if (!(buttons = | ||||
style & CClientUIInterface::BTN_MASK))) { | (QMessageBox::StandardButton)(style & CClientUIInterface:: | ||||
BTN_MASK))) { | |||||
PiRK: This and the following changes to this file is the linter's work | |||||
buttons = QMessageBox::Ok; | buttons = QMessageBox::Ok; | ||||
} | } | ||||
showNormalIfMinimized(); | showNormalIfMinimized(); | ||||
QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, | QMessageBox mBox(static_cast<QMessageBox::Icon>(nMBoxIcon), strTitle, | ||||
message, buttons, this); | message, buttons, this); | ||||
mBox.setTextFormat(Qt::PlainText); | mBox.setTextFormat(Qt::PlainText); | ||||
mBox.setDetailedText(detailed_message); | mBox.setDetailedText(detailed_message); | ||||
▲ Show 20 Lines • Show All 116 Lines • ▼ Show 20 Lines | if (walletFrame && walletFrame->handlePaymentRequest(recipient)) { | ||||
return true; | return true; | ||||
} | } | ||||
return false; | return false; | ||||
} | } | ||||
void BitcoinGUI::setHDStatus(bool privkeyDisabled, int hdEnabled) { | void BitcoinGUI::setHDStatus(bool privkeyDisabled, int hdEnabled) { | ||||
labelWalletHDStatusIcon->setPixmap( | labelWalletHDStatusIcon->setPixmap( | ||||
platformStyle | platformStyle | ||||
->SingleColorIcon(privkeyDisabled | ->SingleColorIcon(privkeyDisabled ? ":/icons/eye" | ||||
? ":/icons/eye" | |||||
: hdEnabled ? ":/icons/hd_enabled" | : hdEnabled ? ":/icons/hd_enabled" | ||||
: ":/icons/hd_disabled") | : ":/icons/hd_disabled") | ||||
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | ||||
labelWalletHDStatusIcon->setToolTip( | labelWalletHDStatusIcon->setToolTip( | ||||
privkeyDisabled | privkeyDisabled ? tr("Private key <b>disabled</b>") | ||||
? tr("Private key <b>disabled</b>") | |||||
: hdEnabled ? tr("HD key generation is <b>enabled</b>") | : hdEnabled ? tr("HD key generation is <b>enabled</b>") | ||||
: tr("HD key generation is <b>disabled</b>")); | : tr("HD key generation is <b>disabled</b>")); | ||||
labelWalletHDStatusIcon->show(); | labelWalletHDStatusIcon->show(); | ||||
// eventually disable the QLabel to set its opacity to 50% | // eventually disable the QLabel to set its opacity to 50% | ||||
labelWalletHDStatusIcon->setEnabled(hdEnabled); | labelWalletHDStatusIcon->setEnabled(hdEnabled); | ||||
} | } | ||||
void BitcoinGUI::setEncryptionStatus(int status) { | void BitcoinGUI::setEncryptionStatus(int status) { | ||||
switch (status) { | switch (status) { | ||||
▲ Show 20 Lines • Show All 255 Lines • Show Last 20 Lines |
This and the following changes to this file is the linter's work