From: gregor herrmann Date: Thu, 5 Oct 2017 12:13:38 +0000 (+0200) Subject: Settings (dialog): add HTTP+SOCKS5 radio buttons and use them X-Git-Tag: 0.6.4~5 X-Git-Url: https://git.toastfreeware.priv.at/toast/confclerk.git/commitdiff_plain/68efead17e2f90bdccb5c6b2aed256e5556ae0a0 Settings (dialog): add HTTP+SOCKS5 radio buttons and use them Hopefully fixes: #59 --- diff --git a/src/gui/settingsdialog.cpp b/src/gui/settingsdialog.cpp index dfaff36..3e29c78 100644 --- a/src/gui/settingsdialog.cpp +++ b/src/gui/settingsdialog.cpp @@ -21,7 +21,6 @@ #include "appsettings.h" #include -#include SettingsDialog::SettingsDialog(QWidget *aParent) : QDialog(aParent) @@ -36,6 +35,9 @@ void SettingsDialog::loadDialogData() // deserialize dialog data address->setText(AppSettings::proxyAddress()); port->setValue(AppSettings::proxyPort()); + const int proxyType = AppSettings::proxyType(); // QNetworkProxy::ProxyType + proxyTypeHTTP->setChecked(proxyType != 1); // HTTP=3, but we enable it by default, i.e. unless SOCKS5=1 + proxyTypeSOCKS5->setChecked(proxyType == 1); directConnection->setChecked(AppSettings::isDirectConnection()); proxyWidget->setDisabled(directConnection->isChecked()); } @@ -46,7 +48,7 @@ void SettingsDialog::saveDialogData() // serialize dialog data AppSettings::setProxyAddress(address->text()); AppSettings::setProxyPort(port->value()); - AppSettings::setProxyType(QNetworkProxy::HttpProxy); // TODO!! + AppSettings::setProxyType(proxyTypeHTTP->isChecked() ? 3 : proxyTypeSOCKS5->isChecked() ? 1 : 0); AppSettings::setDirectConnection(directConnection->isChecked()); } diff --git a/src/gui/settingsdialog.ui b/src/gui/settingsdialog.ui index 89c78db..579ffd6 100644 --- a/src/gui/settingsdialog.ui +++ b/src/gui/settingsdialog.ui @@ -7,7 +7,7 @@ 0 0 500 - 152 + 168 @@ -29,7 +29,7 @@ - HTTP proxy settings + Proxy settings @@ -44,39 +44,68 @@ - + - - - Address: - - + + + + + Address: + + + + + + + + + + Port: + + + + + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + 1 + + + 65535 + + + 8080 + + + + - - - - - - Port: - - - - - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - 1 - - - 65535 - - - 8080 - - + + + + + Proxy type: + + + + + + + HTTP proxy + + + + + + + SOCKS5 proxy + + + +