Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 520 Lines • ▼ Show 20 Lines | if (_clientModel) { | ||||
connect(_clientModel, SIGNAL(numConnectionsChanged(int)), this, | connect(_clientModel, SIGNAL(numConnectionsChanged(int)), this, | ||||
SLOT(setNumConnections(int))); | SLOT(setNumConnections(int))); | ||||
connect(_clientModel, SIGNAL(networkActiveChanged(bool)), this, | connect(_clientModel, SIGNAL(networkActiveChanged(bool)), this, | ||||
SLOT(setNetworkActive(bool))); | SLOT(setNetworkActive(bool))); | ||||
modalOverlay->setKnownBestHeight( | modalOverlay->setKnownBestHeight( | ||||
_clientModel->getHeaderTipHeight(), | _clientModel->getHeaderTipHeight(), | ||||
QDateTime::fromTime_t(_clientModel->getHeaderTipTime())); | QDateTime::fromTime_t(_clientModel->getHeaderTipTime())); | ||||
setNumBlocks(_clientModel->getNumBlocks(), | setNumBlocks(m_node.getNumBlocks(), | ||||
_clientModel->getLastBlockDate(), | QDateTime::fromTime_t(m_node.getLastBlockTime()), | ||||
_clientModel->getVerificationProgress(nullptr), false); | m_node.getVerificationProgress(), false); | ||||
connect(_clientModel, | connect(_clientModel, | ||||
SIGNAL(numBlocksChanged(int, QDateTime, double, bool)), this, | SIGNAL(numBlocksChanged(int, QDateTime, double, bool)), this, | ||||
SLOT(setNumBlocks(int, QDateTime, double, bool))); | SLOT(setNumBlocks(int, QDateTime, double, bool))); | ||||
// Receive and report messages from client model | // Receive and report messages from client model | ||||
connect(_clientModel, SIGNAL(message(QString, QString, unsigned int)), | connect(_clientModel, SIGNAL(message(QString, QString, unsigned int)), | ||||
this, SLOT(message(QString, QString, unsigned int))); | this, SLOT(message(QString, QString, unsigned int))); | ||||
▲ Show 20 Lines • Show All 233 Lines • ▼ Show 20 Lines | switch (count) { | ||||
break; | break; | ||||
default: | default: | ||||
icon = ":/icons/connect_4"; | icon = ":/icons/connect_4"; | ||||
break; | break; | ||||
} | } | ||||
QString tooltip; | QString tooltip; | ||||
if (clientModel->getNetworkActive()) { | if (m_node.getNetworkActive()) { | ||||
tooltip = tr("%n active connection(s) to Bitcoin network", "", count) + | tooltip = tr("%n active connection(s) to Bitcoin network", "", count) + | ||||
QString(".<br>") + tr("Click to disable network activity."); | QString(".<br>") + tr("Click to disable network activity."); | ||||
} else { | } else { | ||||
tooltip = tr("Network activity disabled.") + QString("<br>") + | tooltip = tr("Network activity disabled.") + QString("<br>") + | ||||
tr("Click to enable network activity again."); | tr("Click to enable network activity again."); | ||||
icon = ":/icons/network_disabled"; | icon = ":/icons/network_disabled"; | ||||
} | } | ||||
▲ Show 20 Lines • Show All 464 Lines • ▼ Show 20 Lines | |||||
void BitcoinGUI::unsubscribeFromCoreSignals() { | void BitcoinGUI::unsubscribeFromCoreSignals() { | ||||
// Disconnect signals from client | // Disconnect signals from client | ||||
m_handler_message_box->disconnect(); | m_handler_message_box->disconnect(); | ||||
m_handler_question->disconnect(); | m_handler_question->disconnect(); | ||||
} | } | ||||
void BitcoinGUI::toggleNetworkActive() { | void BitcoinGUI::toggleNetworkActive() { | ||||
if (clientModel) { | m_node.setNetworkActive(!m_node.getNetworkActive()); | ||||
clientModel->setNetworkActive(!clientModel->getNetworkActive()); | |||||
} | |||||
} | } | ||||
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl( | UnitDisplayStatusBarControl::UnitDisplayStatusBarControl( | ||||
const PlatformStyle *platformStyle) | const PlatformStyle *platformStyle) | ||||
: optionsModel(0), menu(0) { | : optionsModel(0), menu(0) { | ||||
createContextMenu(); | createContextMenu(); | ||||
setToolTip(tr("Unit to show amounts in. Click to select another unit.")); | setToolTip(tr("Unit to show amounts in. Click to select another unit.")); | ||||
QList<BitcoinUnits::Unit> units = BitcoinUnits::availableUnits(); | QList<BitcoinUnits::Unit> units = BitcoinUnits::availableUnits(); | ||||
▲ Show 20 Lines • Show All 63 Lines • Show Last 20 Lines |