summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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());