Ignore:
Timestamp:
10/05/17 18:31:15 (5 years ago)
Author:
gregor herrmann <gregor@…>
Branches:
master
Children:
9b513f6
Parents:
0ede0a2
git-author:
gregor herrmann <gregor@…> (10/05/17 14:13:38)
git-committer:
gregor herrmann <gregor@…> (10/05/17 18:31:15)
Message:

Settings (dialog): add HTTP+SOCKS5 radio buttons and use them

Hopefully fixes: #59

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/gui/settingsdialog.cpp

    r0ede0a2 r68efead  
    2222#include "appsettings.h"
    2323#include <QDebug>
    24 #include <QNetworkProxy>
    2524
    2625SettingsDialog::SettingsDialog(QWidget *aParent)
     
    3736    address->setText(AppSettings::proxyAddress());
    3837    port->setValue(AppSettings::proxyPort());
     38    const int proxyType = AppSettings::proxyType(); // QNetworkProxy::ProxyType
     39    proxyTypeHTTP->setChecked(proxyType != 1); // HTTP=3, but we enable it by default, i.e. unless SOCKS5=1
     40    proxyTypeSOCKS5->setChecked(proxyType == 1);
    3941    directConnection->setChecked(AppSettings::isDirectConnection());
    4042    proxyWidget->setDisabled(directConnection->isChecked());
     
    4749    AppSettings::setProxyAddress(address->text());
    4850    AppSettings::setProxyPort(port->value());
    49     AppSettings::setProxyType(QNetworkProxy::HttpProxy); // TODO!!
     51    AppSettings::setProxyType(proxyTypeHTTP->isChecked() ? 3 : proxyTypeSOCKS5->isChecked() ? 1 : 0);
    5052    AppSettings::setDirectConnection(directConnection->isChecked());
    5153}
Note: See TracChangeset for help on using the changeset viewer.