summaryrefslogtreecommitdiffstats
path: root/rbutil
diff options
context:
space:
mode:
authorDominik Riebeling <Dominik.Riebeling@gmail.com>2010-04-02 10:59:38 +0000
committerDominik Riebeling <Dominik.Riebeling@gmail.com>2010-04-02 10:59:38 +0000
commit98493fd3989c8ef8e332fa3dd2fc8da5df934eab (patch)
tree41d9673b8e698296fc8752c01aab90644008ca0e /rbutil
parente53ede9b2be8945b203d63b124f994fec62f9558 (diff)
downloadrockbox-98493fd3989c8ef8e332fa3dd2fc8da5df934eab.tar.gz
rockbox-98493fd3989c8ef8e332fa3dd2fc8da5df934eab.tar.bz2
rockbox-98493fd3989c8ef8e332fa3dd2fc8da5df934eab.zip
Warn when selecting system proxy settings with invalid values.
Rockbox Utility doesn't support "proxy auto-config" (aka PAC) for system proxy settings. This can result in users selecting system proxy and expecting it to work even if their system uses PAC. While the configuration dialog displays the proxy setting values retrieved from the system this is not totally obvious. Add a message telling if the retrieved system proxy values are not useable. For now this only checks if a proxy host and port are set which should catch the usual cases when PAC is used. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@25435 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'rbutil')
-rw-r--r--rbutil/rbutilqt/configure.cpp31
1 files changed, 24 insertions, 7 deletions
diff --git a/rbutil/rbutilqt/configure.cpp b/rbutil/rbutilqt/configure.cpp
index 78a836bf3a..0704f0a999 100644
--- a/rbutil/rbutilqt/configure.cpp
+++ b/rbutil/rbutilqt/configure.cpp
@@ -55,7 +55,7 @@ Config::Config(QWidget *parent,int index) : QDialog(parent)
proxyValidator->setRegExp(validate);
ui.proxyPort->setValidator(proxyValidator);
#if !defined(Q_OS_LINUX) && !defined(Q_OS_WIN32)
- ui.radioSystemProxy->setEnabled(false); // not on macox for now
+ ui.radioSystemProxy->setEnabled(false); // not on OS X for now
#endif
// build language list and sort alphabetically
QStringList langs = findLanguageFiles();
@@ -446,11 +446,10 @@ void Config::setNoProxy(bool checked)
void Config::setSystemProxy(bool checked)
{
- bool i = !checked;
- ui.proxyPort->setEnabled(i);
- ui.proxyHost->setEnabled(i);
- ui.proxyUser->setEnabled(i);
- ui.proxyPass->setEnabled(i);
+ ui.proxyPort->setEnabled(!checked);
+ ui.proxyHost->setEnabled(!checked);
+ ui.proxyUser->setEnabled(!checked);
+ ui.proxyPass->setEnabled(!checked);
if(checked) {
// save values in input box
proxy.setScheme("http");
@@ -460,13 +459,31 @@ void Config::setSystemProxy(bool checked)
proxy.setPort(ui.proxyPort->text().toInt());
// show system values in input box
QUrl envproxy = System::systemProxy();
+ qDebug() << "[Config] setting system proxy" << envproxy;
ui.proxyHost->setText(envproxy.host());
-
ui.proxyPort->setText(QString("%1").arg(envproxy.port()));
ui.proxyUser->setText(envproxy.userName());
ui.proxyPass->setText(envproxy.password());
+ if(envproxy.host().isEmpty() || envproxy.port() == -1) {
+ qDebug() << "[Config] sytem proxy is invalid.";
+ QMessageBox::warning(this, tr("Proxy Detection"),
+ tr("The System Proxy settings are invalid!\n"
+ "Rockbox Utility can't work with this proxy settings. "
+ "Make sure the system proxy is set correctly. Note that "
+ "\"proxy auto-config (PAC)\" scripts are not supported by "
+ "Rockbox Utility. If your system uses this you need "
+ "to use manual proxy settings."),
+ QMessageBox::Ok ,QMessageBox::Ok);
+ // the current proxy settings are invalid. Check the saved proxy
+ // type again.
+ if(RbSettings::value(RbSettings::ProxyType).toString() == "manual")
+ ui.radioManualProxy->setChecked(true);
+ else
+ ui.radioNoProxy->setChecked(true);
+ }
+
}
else {
ui.proxyHost->setText(proxy.host());