# HG changeset patch # User Jacob Dawid # Date 1313538120 -7200 # Node ID b355901aade4cba93e29866c49740ba6f616f4e8 # Parent d3527a9dfe2770cd18eebcbd6ae438e63d83f441 Added username and password field to proxy settings. diff -r d3527a9dfe27 -r b355901aade4 gui/src/ResourceManager.cpp --- a/gui/src/ResourceManager.cpp Wed Aug 17 01:18:57 2011 +0200 +++ b/gui/src/ResourceManager.cpp Wed Aug 17 01:42:00 2011 +0200 @@ -72,15 +72,7 @@ if (m_settings->value ("useProxyServer").toBool ()) { QString proxyTypeString = m_settings->value ("proxyType").toString (); - if (proxyTypeString == "NoProxy") - { - proxyType = QNetworkProxy::NoProxy; - } - else if (proxyTypeString == "DefaultProxy") - { - proxyType = QNetworkProxy::DefaultProxy; - } - else if (proxyTypeString == "Socks5Proxy") + if (proxyTypeString == "Socks5Proxy") { proxyType = QNetworkProxy::Socks5Proxy; } @@ -88,19 +80,13 @@ { proxyType = QNetworkProxy::HttpProxy; } - else if (proxyTypeString == "HttpCachingProxy") - { - proxyType = QNetworkProxy::HttpCachingProxy; - } - else if (proxyTypeString == "FtpCachingProxy") - { - proxyType = QNetworkProxy::FtpCachingProxy; - } } QNetworkProxy proxy; proxy.setType (proxyType); proxy.setHostName (m_settings->value ("proxyHostName").toString ()); proxy.setPort (m_settings->value ("proxyPort").toInt ()); + proxy.setUser (m_settings->value ("proxyUserName").toString ()); + proxy.setPassword (m_settings->value ("proxyPassword").toString ()); QNetworkProxy::setApplicationProxy (proxy); } diff -r d3527a9dfe27 -r b355901aade4 gui/src/SettingsDialog.cpp --- a/gui/src/SettingsDialog.cpp Wed Aug 17 01:18:57 2011 +0200 +++ b/gui/src/SettingsDialog.cpp Wed Aug 17 01:42:00 2011 +0200 @@ -34,6 +34,8 @@ } ui->proxyPort->setText (settings->value ("proxyPort").toString ()); + ui->proxyUserName->setText (settings->value ("proxyUserName").toString ()); + ui->proxyPassword->setText (settings->value ("proxyPassword").toString ()); } SettingsDialog::~SettingsDialog () @@ -56,5 +58,7 @@ settings->setValue ("proxyType", ui->proxyType->currentText ()); settings->setValue ("proxyHostName", ui->proxyHostName->text ()); settings->setValue ("proxyPort", ui->proxyPort->text ()); + settings->setValue ("proxyUserName", ui->proxyUserName->text ()); + settings->setValue ("proxyPassword", ui->proxyPassword->text ()); delete ui; } diff -r d3527a9dfe27 -r b355901aade4 gui/src/SettingsDialog.ui --- a/gui/src/SettingsDialog.ui Wed Aug 17 01:18:57 2011 +0200 +++ b/gui/src/SettingsDialog.ui Wed Aug 17 01:42:00 2011 +0200 @@ -241,16 +241,6 @@ - NoProxy - - - - - DefaultProxy - - - - HttpProxy @@ -259,16 +249,6 @@ Socks5Proxy - - - HttpCachingProxy - - - - - FtpCachingProxy - - @@ -305,6 +285,43 @@ + + + + false + + + Username: + + + + + + + false + + + + + + + false + + + Password: + + + + + + + false + + + QLineEdit::Password + + + @@ -490,5 +507,69 @@ + + useProxyServer + toggled(bool) + proxyUserName + setEnabled(bool) + + + 249 + 59 + + + 291 + 190 + + + + + useProxyServer + toggled(bool) + proxyPassword + setEnabled(bool) + + + 249 + 59 + + + 291 + 223 + + + + + useProxyServer + toggled(bool) + label_6 + setEnabled(bool) + + + 249 + 59 + + + 56 + 190 + + + + + useProxyServer + toggled(bool) + label_7 + setEnabled(bool) + + + 249 + 59 + + + 55 + 223 + + +