Remember proxy settings even after switching type

Fixes #649
This commit is contained in:
Daniel Molkentin 2013-05-29 01:41:04 +02:00
parent 7ee83847c8
commit ed8cdf6910
2 changed files with 16 additions and 15 deletions

View file

@ -524,11 +524,13 @@ void MirallConfigFile::setProxyType(int proxyType,
settings.beginGroup(QLatin1String("proxy"));
settings.setValue(QLatin1String("type"), proxyType);
if (proxyType == QNetworkProxy::HttpProxy) {
settings.setValue(QLatin1String("host"), host);
settings.setValue(QLatin1String("port"), port);
settings.setValue(QLatin1String("user"), user);
settings.setValue(QLatin1String("pass"), pass.toUtf8().toBase64());
}
settings.sync();
}

View file

@ -37,11 +37,11 @@ Mirall::ProxyDialog::ProxyDialog( QWidget* parent )
Mirall::MirallConfigFile cfgFile;
if (cfgFile.proxyType() == QNetworkProxy::NoProxy)
noProxyRadioButton->setChecked(true);
if (cfgFile.proxyType() == QNetworkProxy::DefaultProxy)
else if (cfgFile.proxyType() == QNetworkProxy::DefaultProxy)
systemProxyRadioButton->setChecked(true);
if (cfgFile.proxyType() == QNetworkProxy::HttpProxy)
{
else if (cfgFile.proxyType() == QNetworkProxy::HttpProxy)
manualProxyRadioButton->setChecked(true);
hostLineEdit->setText(cfgFile.proxyHostName());
portSpinBox->setValue(cfgFile.proxyPort());
if (!cfgFile.proxyUser().isEmpty())
@ -50,7 +50,6 @@ Mirall::ProxyDialog::ProxyDialog( QWidget* parent )
userLineEdit->setText(cfgFile.proxyUser());
passwordLineEdit->setText(cfgFile.proxyPassword());
}
}
}
void Mirall::ProxyDialog::saveSettings()