Expand the scope of "Proxy hostname lookup" option

This commit is contained in:
Vladimir Golovnev (Glassez)
2023-02-13 11:23:52 +03:00
parent 6ac14d0c57
commit 96da685e5d
11 changed files with 57 additions and 61 deletions

View File

@@ -200,10 +200,10 @@ void AppController::preferencesAction()
data[u"proxy_auth_enabled"_qs] = proxyConf.authEnabled;
data[u"proxy_username"_qs] = proxyConf.username;
data[u"proxy_password"_qs] = proxyConf.password;
data[u"proxy_hostname_lookup"_qs] = proxyConf.hostnameLookupEnabled;
data[u"proxy_bittorrent"_qs] = pref->useProxyForBT();
data[u"proxy_peer_connections"_qs] = session->isProxyPeerConnectionsEnabled();
data[u"proxy_hostname_lookup"_qs] = session->isProxyHostnameLookupEnabled();
data[u"proxy_rss"_qs] = pref->useProxyForRSS();
data[u"proxy_misc"_qs] = pref->useProxyForGeneralPurposes();
@@ -623,14 +623,14 @@ void AppController::setPreferencesAction()
proxyConf.username = it.value().toString();
if (hasKey(u"proxy_password"_qs))
proxyConf.password = it.value().toString();
if (hasKey(u"proxy_hostname_lookup"_qs))
proxyConf.hostnameLookupEnabled = it.value().toBool();
proxyManager->setProxyConfiguration(proxyConf);
if (hasKey(u"proxy_bittorrent"_qs))
pref->setUseProxyForBT(it.value().toBool());
if (hasKey(u"proxy_peer_connections"_qs))
session->setProxyPeerConnectionsEnabled(it.value().toBool());
if (hasKey(u"proxy_hostname_lookup"_qs))
session->setProxyHostnameLookupEnabled(it.value().toBool());
if (hasKey(u"proxy_rss"_qs))
pref->setUseProxyForRSS(it.value().toBool());
if (hasKey(u"proxy_misc"_qs))

View File

@@ -370,6 +370,11 @@
</tr>
</table>
<div class="formRow">
<input type="checkbox" id="proxyHostnameLookupCheckbox" title="QBT_TR(If checked, hostname lookups are done via the proxy.)QBT_TR[CONTEXT=OptionsDialog]" />
<label for="proxyHostnameLookupCheckbox">QBT_TR(Use proxy for hostname lookup)QBT_TR[CONTEXT=OptionsDialog]</label>
</div>
<fieldset class="settings">
<legend>
<input type="checkbox" id="peer_proxy_auth_checkbox" onclick="qBittorrent.Preferences.updatePeerProxyAuthSettings();" />
@@ -407,10 +412,6 @@
<input type="checkbox" id="use_peer_proxy_checkbox" />
<label for="use_peer_proxy_checkbox">QBT_TR(Use proxy for peer connections)QBT_TR[CONTEXT=OptionsDialog]</label>
</div>
<div class="formRow">
<input type="checkbox" id="proxyHostnameLookupCheckbox" title="QBT_TR(If checked, hostname lookups are done via the proxy.)QBT_TR[CONTEXT=OptionsDialog]" />
<label for="proxyHostnameLookupCheckbox">QBT_TR(Use proxy for hostname lookup)QBT_TR[CONTEXT=OptionsDialog]</label>
</div>
</fieldset>
<div class="formRow">
<input type="checkbox" id="proxy_rss_checkbox" />
@@ -1591,7 +1592,7 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
$('peer_proxy_auth_checkbox').setProperty('disabled', isProxySocks4);
$('use_peer_proxy_checkbox').setProperty('disabled', !$('proxy_bittorrent_checkbox').getProperty('checked'));
$('proxyHostnameLookupCheckbox').setProperty('disabled', isProxySocks4 || !$('proxy_bittorrent_checkbox').getProperty('checked'));
$('proxyHostnameLookupCheckbox').setProperty('disabled', isProxySocks4);
$('proxy_rss_checkbox').setProperty('disabled', isProxySocks4);
$('proxy_misc_checkbox').setProperty('disabled', isProxySocks4);
@@ -1952,14 +1953,14 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
$('peer_proxy_type_select').setProperty('value', pref.proxy_type);
$('peer_proxy_host_text').setProperty('value', pref.proxy_ip);
$('peer_proxy_port_value').setProperty('value', pref.proxy_port);
$('use_peer_proxy_checkbox').setProperty('checked', pref.proxy_peer_connections);
$('proxyHostnameLookupCheckbox').setProperty('checked', pref.proxy_hostname_lookup);
$('proxy_bittorrent_checkbox').setProperty('checked', pref.proxy_bittorrent);
$('proxy_rss_checkbox').setProperty('checked', pref.proxy_rss);
$('proxy_misc_checkbox').setProperty('checked', pref.proxy_misc);
$('peer_proxy_auth_checkbox').setProperty('checked', pref.proxy_auth_enabled);
$('peer_proxy_username_text').setProperty('value', pref.proxy_username);
$('peer_proxy_password_text').setProperty('value', pref.proxy_password);
$('proxyHostnameLookupCheckbox').setProperty('checked', pref.proxy_hostname_lookup);
$('proxy_bittorrent_checkbox').setProperty('checked', pref.proxy_bittorrent);
$('use_peer_proxy_checkbox').setProperty('checked', pref.proxy_peer_connections);
$('proxy_rss_checkbox').setProperty('checked', pref.proxy_rss);
$('proxy_misc_checkbox').setProperty('checked', pref.proxy_misc);
updatePeerProxySettings();
// IP Filtering
@@ -2283,9 +2284,9 @@ Use ';' to split multiple entries. Can use wildcard '*'.)QBT_TR[CONTEXT=OptionsD
settings.set('proxy_auth_enabled', $('peer_proxy_auth_checkbox').getProperty('checked'));
settings.set('proxy_username', $('peer_proxy_username_text').getProperty('value'));
settings.set('proxy_password', $('peer_proxy_password_text').getProperty('value'));
settings.set('proxy_hostname_lookup', $('proxyHostnameLookupCheckbox').getProperty('checked'));
settings.set('proxy_bittorrent', $('proxy_bittorrent_checkbox').getProperty('checked'));
settings.set('proxy_peer_connections', $('use_peer_proxy_checkbox').getProperty('checked'));
settings.set('proxy_hostname_lookup', $('proxyHostnameLookupCheckbox').getProperty('checked'));
settings.set('proxy_rss', $('proxy_rss_checkbox').getProperty('checked'));
settings.set('proxy_misc', $('proxy_misc_checkbox').getProperty('checked'));