Add "No Proxy" option to proxy settings

This commit is contained in:
Bart De Vries
2024-04-24 22:26:12 +02:00
committed by Tobias Fella
parent cae389c04c
commit d79d806cda
3 changed files with 15 additions and 0 deletions

View File

@@ -136,6 +136,9 @@
<choice name="Socks5"> <choice name="Socks5">
<label>Socks5</label> <label>Socks5</label>
</choice> </choice>
<choice name="NoProxy">
<label>NoProxy</label>
</choice>
<default>System</default> <default>System</default>
</choices> </choices>
</entry> </entry>

View File

@@ -30,6 +30,10 @@ void ProxyController::setApplicationProxy()
proxy.setPassword(cfg->proxyPassword()); proxy.setPassword(cfg->proxyPassword());
QNetworkProxy::setApplicationProxy(proxy); QNetworkProxy::setApplicationProxy(proxy);
break; break;
case 3:
proxy.setType(QNetworkProxy::NoProxy);
QNetworkProxy::setApplicationProxy(proxy);
break;
default: default:
QNetworkProxyFactory::setUseSystemConfiguration(true); QNetworkProxyFactory::setUseSystemConfiguration(true);
break; break;

View File

@@ -29,6 +29,14 @@ FormCard.FormCardPage {
currentType = 0; currentType = 0;
} }
} }
FormCard.FormRadioDelegate {
text: i18n("No Proxy")
checked: currentType === 3
enabled: !Config.isProxyTypeImmutable
onToggled: {
currentType = 3;
}
}
FormCard.FormRadioDelegate { FormCard.FormRadioDelegate {
text: i18n("HTTP") text: i18n("HTTP")
checked: currentType === 1 checked: currentType === 1