mirror of
https://github.com/bitcoin/bitcoin.git
synced 2025-12-12 05:34:57 +01:00
[gui] Add proxy icon in statusbar
This commit is contained in:
@@ -83,6 +83,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
|
||||
unitDisplayControl(0),
|
||||
labelWalletEncryptionIcon(0),
|
||||
labelWalletHDStatusIcon(0),
|
||||
labelProxyIcon(0),
|
||||
connectionsControl(0),
|
||||
labelBlocksIcon(0),
|
||||
progressBarLabel(0),
|
||||
@@ -201,6 +202,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
|
||||
unitDisplayControl = new UnitDisplayStatusBarControl(platformStyle);
|
||||
labelWalletEncryptionIcon = new QLabel();
|
||||
labelWalletHDStatusIcon = new QLabel();
|
||||
labelProxyIcon = new QLabel();
|
||||
connectionsControl = new GUIUtil::ClickableLabel();
|
||||
labelBlocksIcon = new GUIUtil::ClickableLabel();
|
||||
if(enableWallet)
|
||||
@@ -211,6 +213,7 @@ BitcoinGUI::BitcoinGUI(interfaces::Node& node, const PlatformStyle *_platformSty
|
||||
frameBlocksLayout->addWidget(labelWalletEncryptionIcon);
|
||||
frameBlocksLayout->addWidget(labelWalletHDStatusIcon);
|
||||
}
|
||||
frameBlocksLayout->addWidget(labelProxyIcon);
|
||||
frameBlocksLayout->addStretch();
|
||||
frameBlocksLayout->addWidget(connectionsControl);
|
||||
frameBlocksLayout->addStretch();
|
||||
@@ -503,6 +506,9 @@ void BitcoinGUI::setClientModel(ClientModel *_clientModel)
|
||||
connect(_clientModel, SIGNAL(showProgress(QString,int)), this, SLOT(showProgress(QString,int)));
|
||||
|
||||
rpcConsole->setClientModel(_clientModel);
|
||||
|
||||
updateProxyIcon();
|
||||
|
||||
#ifdef ENABLE_WALLET
|
||||
if(walletFrame)
|
||||
{
|
||||
@@ -1125,6 +1131,24 @@ void BitcoinGUI::updateWalletStatus()
|
||||
}
|
||||
#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)
|
||||
{
|
||||
if(!clientModel)
|
||||
|
||||
Reference in New Issue
Block a user