Added "system" proxy option.
This commit is contained in:
parent
a883be4d62
commit
5414848bbd
@ -26,6 +26,10 @@ void BaseNetworkAccessManager::loadSettings() {
|
|||||||
setProxy(QNetworkProxy::NoProxy);
|
setProxy(QNetworkProxy::NoProxy);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
else if (selected_proxy_type == QNetworkProxy::DefaultProxy) {
|
||||||
|
setProxy(QNetworkProxy::applicationProxy());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
Settings *settings = Settings::instance();
|
Settings *settings = Settings::instance();
|
||||||
|
|
||||||
|
@ -283,7 +283,7 @@ void FormSettings::saveSettings() {
|
|||||||
|
|
||||||
void FormSettings::onProxyTypeChanged(int index) {
|
void FormSettings::onProxyTypeChanged(int index) {
|
||||||
QNetworkProxy::ProxyType selected_type = static_cast<QNetworkProxy::ProxyType>(m_ui->m_cmbProxyType->itemData(index).toInt());
|
QNetworkProxy::ProxyType selected_type = static_cast<QNetworkProxy::ProxyType>(m_ui->m_cmbProxyType->itemData(index).toInt());
|
||||||
bool is_proxy_selected = selected_type != QNetworkProxy::NoProxy;
|
bool is_proxy_selected = selected_type != QNetworkProxy::NoProxy && selected_type != QNetworkProxy::DefaultProxy;
|
||||||
|
|
||||||
m_ui->m_txtProxyHost->setEnabled(is_proxy_selected);
|
m_ui->m_txtProxyHost->setEnabled(is_proxy_selected);
|
||||||
m_ui->m_txtProxyPassword->setEnabled(is_proxy_selected);
|
m_ui->m_txtProxyPassword->setEnabled(is_proxy_selected);
|
||||||
@ -350,6 +350,7 @@ void FormSettings::saveBrowser() {
|
|||||||
|
|
||||||
void FormSettings::loadProxy() {
|
void FormSettings::loadProxy() {
|
||||||
m_ui->m_cmbProxyType->addItem(tr("No proxy"), QNetworkProxy::NoProxy);
|
m_ui->m_cmbProxyType->addItem(tr("No proxy"), QNetworkProxy::NoProxy);
|
||||||
|
m_ui->m_cmbProxyType->addItem(tr("System proxy"), QNetworkProxy::DefaultProxy);
|
||||||
m_ui->m_cmbProxyType->addItem(tr("Socks5"), QNetworkProxy::Socks5Proxy);
|
m_ui->m_cmbProxyType->addItem(tr("Socks5"), QNetworkProxy::Socks5Proxy);
|
||||||
m_ui->m_cmbProxyType->addItem(tr("Http"), QNetworkProxy::HttpProxy);
|
m_ui->m_cmbProxyType->addItem(tr("Http"), QNetworkProxy::HttpProxy);
|
||||||
|
|
||||||
|
@ -286,8 +286,8 @@ Authors of this application are NOT responsible for lost data.</string>
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>564</width>
|
<width>100</width>
|
||||||
<height>363</height>
|
<height>30</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
<layout class="QHBoxLayout" name="horizontalLayout_4">
|
||||||
@ -364,8 +364,8 @@ Authors of this application are NOT responsible for lost data.</string>
|
|||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
<y>0</y>
|
<y>0</y>
|
||||||
<width>558</width>
|
<width>209</width>
|
||||||
<height>337</height>
|
<height>245</height>
|
||||||
</rect>
|
</rect>
|
||||||
</property>
|
</property>
|
||||||
<layout class="QFormLayout" name="formLayout">
|
<layout class="QFormLayout" name="formLayout">
|
||||||
@ -633,7 +633,7 @@ Authors of this application are NOT responsible for lost data.</string>
|
|||||||
<item>
|
<item>
|
||||||
<widget class="QTabWidget" name="m_tabBrowserProxy">
|
<widget class="QTabWidget" name="m_tabBrowserProxy">
|
||||||
<property name="currentIndex">
|
<property name="currentIndex">
|
||||||
<number>0</number>
|
<number>2</number>
|
||||||
</property>
|
</property>
|
||||||
<widget class="QWidget" name="m_tabInternalBrowser">
|
<widget class="QWidget" name="m_tabInternalBrowser">
|
||||||
<attribute name="title">
|
<attribute name="title">
|
||||||
@ -916,10 +916,13 @@ Authors of this application are NOT responsible for lost data.</string>
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</item>
|
</item>
|
||||||
<item row="5" column="1">
|
<item row="5" column="0" colspan="2">
|
||||||
<widget class="QLabel" name="m_lblProxyInfo">
|
<widget class="QLabel" name="m_lblProxyInfo">
|
||||||
<property name="text">
|
<property name="text">
|
||||||
<string>Password is stored in plain string in RSS Guard configuration file.</string>
|
<string>Note that these settings are applied only on newly established connections.</string>
|
||||||
|
</property>
|
||||||
|
<property name="alignment">
|
||||||
|
<set>Qt::AlignCenter</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="wordWrap">
|
<property name="wordWrap">
|
||||||
<bool>true</bool>
|
<bool>true</bool>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user