summaryrefslogtreecommitdiff
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.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)
55 proxyValidator->setRegExp(validate); 55 proxyValidator->setRegExp(validate);
56 ui.proxyPort->setValidator(proxyValidator); 56 ui.proxyPort->setValidator(proxyValidator);
57#if !defined(Q_OS_LINUX) && !defined(Q_OS_WIN32) 57#if !defined(Q_OS_LINUX) && !defined(Q_OS_WIN32)
58 ui.radioSystemProxy->setEnabled(false); // not on macox for now 58 ui.radioSystemProxy->setEnabled(false); // not on OS X for now
59#endif 59#endif
60 // build language list and sort alphabetically 60 // build language list and sort alphabetically
61 QStringList langs = findLanguageFiles(); 61 QStringList langs = findLanguageFiles();
@@ -446,11 +446,10 @@ void Config::setNoProxy(bool checked)
446 446
447void Config::setSystemProxy(bool checked) 447void Config::setSystemProxy(bool checked)
448{ 448{
449 bool i = !checked; 449 ui.proxyPort->setEnabled(!checked);
450 ui.proxyPort->setEnabled(i); 450 ui.proxyHost->setEnabled(!checked);
451 ui.proxyHost->setEnabled(i); 451 ui.proxyUser->setEnabled(!checked);
452 ui.proxyUser->setEnabled(i); 452 ui.proxyPass->setEnabled(!checked);
453 ui.proxyPass->setEnabled(i);
454 if(checked) { 453 if(checked) {
455 // save values in input box 454 // save values in input box
456 proxy.setScheme("http"); 455 proxy.setScheme("http");
@@ -460,13 +459,31 @@ void Config::setSystemProxy(bool checked)
460 proxy.setPort(ui.proxyPort->text().toInt()); 459 proxy.setPort(ui.proxyPort->text().toInt());
461 // show system values in input box 460 // show system values in input box
462 QUrl envproxy = System::systemProxy(); 461 QUrl envproxy = System::systemProxy();
462 qDebug() << "[Config] setting system proxy" << envproxy;
463 463
464 ui.proxyHost->setText(envproxy.host()); 464 ui.proxyHost->setText(envproxy.host());
465
466 ui.proxyPort->setText(QString("%1").arg(envproxy.port())); 465 ui.proxyPort->setText(QString("%1").arg(envproxy.port()));
467 ui.proxyUser->setText(envproxy.userName()); 466 ui.proxyUser->setText(envproxy.userName());
468 ui.proxyPass->setText(envproxy.password()); 467 ui.proxyPass->setText(envproxy.password());
469 468
469 if(envproxy.host().isEmpty() || envproxy.port() == -1) {
470 qDebug() << "[Config] sytem proxy is invalid.";
471 QMessageBox::warning(this, tr("Proxy Detection"),
472 tr("The System Proxy settings are invalid!\n"
473 "Rockbox Utility can't work with this proxy settings. "
474 "Make sure the system proxy is set correctly. Note that "
475 "\"proxy auto-config (PAC)\" scripts are not supported by "
476 "Rockbox Utility. If your system uses this you need "
477 "to use manual proxy settings."),
478 QMessageBox::Ok ,QMessageBox::Ok);
479 // the current proxy settings are invalid. Check the saved proxy
480 // type again.
481 if(RbSettings::value(RbSettings::ProxyType).toString() == "manual")
482 ui.radioManualProxy->setChecked(true);
483 else
484 ui.radioNoProxy->setChecked(true);
485 }
486
470 } 487 }
471 else { 488 else {
472 ui.proxyHost->setText(proxy.host()); 489 ui.proxyHost->setText(proxy.host());