Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 83 Lines • ▼ Show 20 Lines | |||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
enableWallet = WalletModel::isWalletEnabled(); | enableWallet = WalletModel::isWalletEnabled(); | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
QApplication::setWindowIcon(m_network_style->getTrayAndWindowIcon()); | QApplication::setWindowIcon(m_network_style->getTrayAndWindowIcon()); | ||||
setWindowIcon(m_network_style->getTrayAndWindowIcon()); | setWindowIcon(m_network_style->getTrayAndWindowIcon()); | ||||
updateWindowTitle(); | updateWindowTitle(); | ||||
rpcConsole = new RPCConsole(node, _platformStyle, 0); | rpcConsole = new RPCConsole(node, _platformStyle, nullptr); | ||||
helpMessageDialog = new HelpMessageDialog(node, this, false); | helpMessageDialog = new HelpMessageDialog(node, this, false); | ||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
if (enableWallet) { | if (enableWallet) { | ||||
/** Create wallet frame and make it the central widget */ | /** Create wallet frame and make it the central widget */ | ||||
walletFrame = new WalletFrame(_platformStyle, this); | walletFrame = new WalletFrame(_platformStyle, this); | ||||
setCentralWidget(walletFrame); | setCentralWidget(walletFrame); | ||||
} else | } else | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
▲ Show 20 Lines • Show All 1,180 Lines • ▼ Show 20 Lines | |||||
} | } | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
void BitcoinGUI::updateProxyIcon() { | void BitcoinGUI::updateProxyIcon() { | ||||
std::string ip_port; | std::string ip_port; | ||||
bool proxy_enabled = clientModel->getProxyInfo(ip_port); | bool proxy_enabled = clientModel->getProxyInfo(ip_port); | ||||
if (proxy_enabled) { | if (proxy_enabled) { | ||||
if (labelProxyIcon->pixmap() == 0) { | if (labelProxyIcon->pixmap() == nullptr) { | ||||
QString ip_port_q = QString::fromStdString(ip_port); | QString ip_port_q = QString::fromStdString(ip_port); | ||||
labelProxyIcon->setPixmap( | labelProxyIcon->setPixmap( | ||||
platformStyle->SingleColorIcon(":/icons/proxy") | platformStyle->SingleColorIcon(":/icons/proxy") | ||||
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | .pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | ||||
labelProxyIcon->setToolTip( | labelProxyIcon->setToolTip( | ||||
tr("Proxy is <b>enabled</b>: %1").arg(ip_port_q)); | tr("Proxy is <b>enabled</b>: %1").arg(ip_port_q)); | ||||
} else { | } else { | ||||
labelProxyIcon->show(); | labelProxyIcon->show(); | ||||
▲ Show 20 Lines • Show All 43 Lines • ▼ Show 20 Lines | void BitcoinGUI::detectShutdown() { | ||||
} | } | ||||
} | } | ||||
void BitcoinGUI::showProgress(const QString &title, int nProgress) { | void BitcoinGUI::showProgress(const QString &title, int nProgress) { | ||||
if (nProgress == 0) { | if (nProgress == 0) { | ||||
progressDialog = new QProgressDialog(title, "", 0, 100); | progressDialog = new QProgressDialog(title, "", 0, 100); | ||||
progressDialog->setWindowModality(Qt::ApplicationModal); | progressDialog->setWindowModality(Qt::ApplicationModal); | ||||
progressDialog->setMinimumDuration(0); | progressDialog->setMinimumDuration(0); | ||||
progressDialog->setCancelButton(0); | progressDialog->setCancelButton(nullptr); | ||||
progressDialog->setAutoClose(false); | progressDialog->setAutoClose(false); | ||||
progressDialog->setValue(0); | progressDialog->setValue(0); | ||||
} else if (progressDialog) { | } else if (progressDialog) { | ||||
if (nProgress == 100) { | if (nProgress == 100) { | ||||
progressDialog->close(); | progressDialog->close(); | ||||
progressDialog->deleteLater(); | progressDialog->deleteLater(); | ||||
} else { | } else { | ||||
progressDialog->setValue(nProgress); | progressDialog->setValue(nProgress); | ||||
▲ Show 20 Lines • Show All 49 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(); | ||||
} | } | ||||
UnitDisplayStatusBarControl::UnitDisplayStatusBarControl( | UnitDisplayStatusBarControl::UnitDisplayStatusBarControl( | ||||
const PlatformStyle *platformStyle) | const PlatformStyle *platformStyle) | ||||
: optionsModel(0), menu(0) { | : optionsModel(nullptr), menu(nullptr) { | ||||
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(); | ||||
int max_width = 0; | int max_width = 0; | ||||
const QFontMetrics fm(font()); | const QFontMetrics fm(font()); | ||||
for (const BitcoinUnits::Unit unit : units) { | for (const BitcoinUnits::Unit unit : units) { | ||||
max_width = qMax(max_width, fm.width(BitcoinUnits::longName(unit))); | max_width = qMax(max_width, fm.width(BitcoinUnits::longName(unit))); | ||||
} | } | ||||
▲ Show 20 Lines • Show All 59 Lines • Show Last 20 Lines |