Changeset View
Changeset View
Standalone View
Standalone View
src/qt/bitcoingui.cpp
Show First 20 Lines • Show All 142 Lines • ▼ Show 20 Lines | #endif // ENABLE_WALLET | ||||
frameBlocks->setContentsMargins(0, 0, 0, 0); | frameBlocks->setContentsMargins(0, 0, 0, 0); | ||||
frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); | frameBlocks->setSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred); | ||||
QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); | QHBoxLayout *frameBlocksLayout = new QHBoxLayout(frameBlocks); | ||||
frameBlocksLayout->setContentsMargins(3, 0, 3, 0); | frameBlocksLayout->setContentsMargins(3, 0, 3, 0); | ||||
frameBlocksLayout->setSpacing(3); | frameBlocksLayout->setSpacing(3); | ||||
unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle); | unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle); | ||||
labelWalletEncryptionIcon = new QLabel(); | labelWalletEncryptionIcon = new QLabel(); | ||||
labelWalletHDStatusIcon = new QLabel(); | labelWalletHDStatusIcon = new QLabel(); | ||||
labelProxyIcon = new QLabel(); | |||||
connectionsControl = new GUIUtil::ClickableLabel(); | connectionsControl = new GUIUtil::ClickableLabel(); | ||||
labelBlocksIcon = new GUIUtil::ClickableLabel(); | labelBlocksIcon = new GUIUtil::ClickableLabel(); | ||||
if (enableWallet) { | if (enableWallet) { | ||||
frameBlocksLayout->addStretch(); | frameBlocksLayout->addStretch(); | ||||
frameBlocksLayout->addWidget(unitDisplayControl); | frameBlocksLayout->addWidget(unitDisplayControl); | ||||
frameBlocksLayout->addStretch(); | frameBlocksLayout->addStretch(); | ||||
frameBlocksLayout->addWidget(labelWalletEncryptionIcon); | frameBlocksLayout->addWidget(labelWalletEncryptionIcon); | ||||
frameBlocksLayout->addWidget(labelWalletHDStatusIcon); | frameBlocksLayout->addWidget(labelWalletHDStatusIcon); | ||||
} | } | ||||
frameBlocksLayout->addWidget(labelProxyIcon); | |||||
frameBlocksLayout->addStretch(); | frameBlocksLayout->addStretch(); | ||||
frameBlocksLayout->addWidget(connectionsControl); | frameBlocksLayout->addWidget(connectionsControl); | ||||
frameBlocksLayout->addStretch(); | frameBlocksLayout->addStretch(); | ||||
frameBlocksLayout->addWidget(labelBlocksIcon); | frameBlocksLayout->addWidget(labelBlocksIcon); | ||||
frameBlocksLayout->addStretch(); | frameBlocksLayout->addStretch(); | ||||
// Progress bar and label for blocks download | // Progress bar and label for blocks download | ||||
progressBarLabel = new QLabel(); | progressBarLabel = new QLabel(); | ||||
▲ Show 20 Lines • Show All 380 Lines • ▼ Show 20 Lines | if (_clientModel) { | ||||
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 progress dialog | // Show progress dialog | ||||
connect(_clientModel, SIGNAL(showProgress(QString, int)), this, | connect(_clientModel, SIGNAL(showProgress(QString, int)), this, | ||||
SLOT(showProgress(QString, int))); | SLOT(showProgress(QString, int))); | ||||
rpcConsole->setClientModel(_clientModel); | rpcConsole->setClientModel(_clientModel); | ||||
updateProxyIcon(); | |||||
#ifdef ENABLE_WALLET | #ifdef ENABLE_WALLET | ||||
if (walletFrame) { | if (walletFrame) { | ||||
walletFrame->setClientModel(_clientModel); | walletFrame->setClientModel(_clientModel); | ||||
} | } | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
unitDisplayControl->setOptionsModel(_clientModel->getOptionsModel()); | unitDisplayControl->setOptionsModel(_clientModel->getOptionsModel()); | ||||
OptionsModel *optionsModel = _clientModel->getOptionsModel(); | OptionsModel *optionsModel = _clientModel->getOptionsModel(); | ||||
▲ Show 20 Lines • Show All 629 Lines • ▼ Show 20 Lines | if (!walletView) { | ||||
return; | return; | ||||
} | } | ||||
WalletModel *const walletModel = walletView->getWalletModel(); | WalletModel *const walletModel = walletView->getWalletModel(); | ||||
setEncryptionStatus(walletModel->getEncryptionStatus()); | setEncryptionStatus(walletModel->getEncryptionStatus()); | ||||
setHDStatus(walletModel->wallet().hdEnabled()); | setHDStatus(walletModel->wallet().hdEnabled()); | ||||
} | } | ||||
#endif // ENABLE_WALLET | #endif // ENABLE_WALLET | ||||
void BitcoinGUI::updateProxyIcon() { | |||||
std::string ip_port; | |||||
bool proxy_enabled = clientModel->getProxyInfo(ip_port); | |||||
if (proxy_enabled) { | |||||
if (labelProxyIcon->pixmap() == 0) { | |||||
QString ip_port_q = QString::fromStdString(ip_port); | |||||
labelProxyIcon->setPixmap( | |||||
platformStyle->SingleColorIcon(":/icons/proxy") | |||||
.pixmap(STATUSBAR_ICONSIZE, STATUSBAR_ICONSIZE)); | |||||
labelProxyIcon->setToolTip( | |||||
tr("Proxy is <b>enabled</b>: %1").arg(ip_port_q)); | |||||
} else { | |||||
labelProxyIcon->show(); | |||||
} | |||||
} else { | |||||
labelProxyIcon->hide(); | |||||
} | |||||
} | |||||
void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { | void BitcoinGUI::showNormalIfMinimized(bool fToggleHidden) { | ||||
if (!clientModel) { | if (!clientModel) { | ||||
return; | return; | ||||
} | } | ||||
// activateWindow() (sometimes) helps with keyboard focus on Windows | // activateWindow() (sometimes) helps with keyboard focus on Windows | ||||
if (isHidden()) { | if (isHidden()) { | ||||
show(); | show(); | ||||
▲ Show 20 Lines • Show All 164 Lines • Show Last 20 Lines |