Added "system" proxy option.

This commit is contained in:
Martin Rotter 2014-02-14 17:22:20 +01:00
parent a883be4d62
commit 5414848bbd
3 changed files with 16 additions and 8 deletions

View File

@ -26,6 +26,10 @@ void BaseNetworkAccessManager::loadSettings() {
setProxy(QNetworkProxy::NoProxy);
return;
}
else if (selected_proxy_type == QNetworkProxy::DefaultProxy) {
setProxy(QNetworkProxy::applicationProxy());
return;
}
Settings *settings = Settings::instance();

View File

@ -283,7 +283,7 @@ void FormSettings::saveSettings() {
void FormSettings::onProxyTypeChanged(int index) {
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_txtProxyPassword->setEnabled(is_proxy_selected);
@ -350,6 +350,7 @@ void FormSettings::saveBrowser() {
void FormSettings::loadProxy() {
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("Http"), QNetworkProxy::HttpProxy);

View File

@ -286,8 +286,8 @@ Authors of this application are NOT responsible for lost data.</string>
<rect>
<x>0</x>
<y>0</y>
<width>564</width>
<height>363</height>
<width>100</width>
<height>30</height>
</rect>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_4">
@ -364,8 +364,8 @@ Authors of this application are NOT responsible for lost data.</string>
<rect>
<x>0</x>
<y>0</y>
<width>558</width>
<height>337</height>
<width>209</width>
<height>245</height>
</rect>
</property>
<layout class="QFormLayout" name="formLayout">
@ -633,7 +633,7 @@ Authors of this application are NOT responsible for lost data.</string>
<item>
<widget class="QTabWidget" name="m_tabBrowserProxy">
<property name="currentIndex">
<number>0</number>
<number>2</number>
</property>
<widget class="QWidget" name="m_tabInternalBrowser">
<attribute name="title">
@ -916,10 +916,13 @@ Authors of this application are NOT responsible for lost data.</string>
</property>
</widget>
</item>
<item row="5" column="1">
<item row="5" column="0" colspan="2">
<widget class="QLabel" name="m_lblProxyInfo">
<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 name="wordWrap">
<bool>true</bool>