|
|
@ -53,17 +53,19 @@ namespace gui { |
|
|
|
void acceptValues() { |
|
|
|
void acceptValues() { |
|
|
|
QNetworkProxy::ProxyType type(QNetworkProxy::NoProxy); |
|
|
|
QNetworkProxy::ProxyType type(QNetworkProxy::NoProxy); |
|
|
|
switch (_type->currentIndex()) { |
|
|
|
switch (_type->currentIndex()) { |
|
|
|
case 0: try { |
|
|
|
case 0: { |
|
|
|
_url->setEnabled(false); |
|
|
|
_url->setEnabled(false); |
|
|
|
_port->setEnabled(false); |
|
|
|
_port->setEnabled(false); |
|
|
|
_auto.proxy(_testUrl); |
|
|
|
|
|
|
|
type=QNetworkProxy::NoProxy; |
|
|
|
type=QNetworkProxy::NoProxy; |
|
|
|
} catch (...) {} break; |
|
|
|
} break; |
|
|
|
case 1: type=QNetworkProxy::HttpProxy; break; |
|
|
|
case 1: type=QNetworkProxy::HttpProxy; break; |
|
|
|
case 2: type=QNetworkProxy::Socks5Proxy; break; |
|
|
|
case 2: type=QNetworkProxy::Socks5Proxy; break; |
|
|
|
} |
|
|
|
} |
|
|
|
QNetworkProxy::setApplicationProxy |
|
|
|
QNetworkProxy::setApplicationProxy |
|
|
|
(QNetworkProxy(type, _url->text(), _port->value())); |
|
|
|
(QNetworkProxy(type, _url->text(), _port->value())); |
|
|
|
|
|
|
|
try { |
|
|
|
|
|
|
|
_auto.proxy(_testUrl); |
|
|
|
|
|
|
|
} catch (...) {} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
Q_SIGNALS: |
|
|
|
Q_SIGNALS: |
|
|
|