|
|
@ -520,13 +520,22 @@ int options_imp::getPeerProxyType() const{ |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int options_imp::getHTTPProxyType() const { |
|
|
|
int options_imp::getHTTPProxyType() const { |
|
|
|
if(comboProxyType_http->currentIndex() > 0){ |
|
|
|
switch(comboProxyType_http->currentIndex()) { |
|
|
|
|
|
|
|
case 1: { |
|
|
|
if(isHTTPProxyAuthEnabled()){ |
|
|
|
if(isHTTPProxyAuthEnabled()){ |
|
|
|
return HTTP_PW; |
|
|
|
return HTTP_PW; |
|
|
|
} |
|
|
|
} |
|
|
|
return HTTP; |
|
|
|
return HTTP; |
|
|
|
} |
|
|
|
} |
|
|
|
return -1; // disabled
|
|
|
|
case 2: { |
|
|
|
|
|
|
|
if(isHTTPProxyAuthEnabled()) { |
|
|
|
|
|
|
|
return SOCKS5_PW; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return SOCKS5; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return -1; // Disabled
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int options_imp::getStyle() const{ |
|
|
|
int options_imp::getStyle() const{ |
|
|
@ -637,17 +646,18 @@ void options_imp::loadOptions(){ |
|
|
|
checkResolveHosts->setChecked(Preferences::resolvePeerHostNames()); |
|
|
|
checkResolveHosts->setChecked(Preferences::resolvePeerHostNames()); |
|
|
|
|
|
|
|
|
|
|
|
intValue = Preferences::getPeerProxyType(); |
|
|
|
intValue = Preferences::getPeerProxyType(); |
|
|
|
if(intValue <= 0) { |
|
|
|
switch(intValue) { |
|
|
|
intValue = 0; |
|
|
|
case SOCKS4: |
|
|
|
} else { |
|
|
|
comboProxyType->setCurrentIndex(1); |
|
|
|
if(intValue%2 == 0) { |
|
|
|
break; |
|
|
|
intValue = 2; |
|
|
|
case SOCKS5: |
|
|
|
}else { |
|
|
|
case SOCKS5_PW: |
|
|
|
intValue = 1; |
|
|
|
comboProxyType->setCurrentIndex(2); |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
comboProxyType->setCurrentIndex(0); |
|
|
|
} |
|
|
|
} |
|
|
|
comboProxyType->setCurrentIndex(intValue); |
|
|
|
enablePeerProxy(comboProxyType->currentIndex()); |
|
|
|
enablePeerProxy(intValue); |
|
|
|
|
|
|
|
//if(isProxyEnabled()) {
|
|
|
|
//if(isProxyEnabled()) {
|
|
|
|
// Proxy is enabled, save settings
|
|
|
|
// Proxy is enabled, save settings
|
|
|
|
textProxyIP->setText(Preferences::getPeerProxyIp()); |
|
|
|
textProxyIP->setText(Preferences::getPeerProxyIp()); |
|
|
@ -658,13 +668,18 @@ void options_imp::loadOptions(){ |
|
|
|
enablePeerProxyAuth(checkProxyAuth->isChecked()); |
|
|
|
enablePeerProxyAuth(checkProxyAuth->isChecked()); |
|
|
|
//}
|
|
|
|
//}
|
|
|
|
intValue = Preferences::getHTTPProxyType(); |
|
|
|
intValue = Preferences::getHTTPProxyType(); |
|
|
|
if(intValue <= 0) { |
|
|
|
switch(intValue) { |
|
|
|
intValue = 0; |
|
|
|
case HTTP: |
|
|
|
} else { |
|
|
|
comboProxyType_http->setCurrentIndex(1); |
|
|
|
intValue = 1; |
|
|
|
break; |
|
|
|
|
|
|
|
case SOCKS5: |
|
|
|
|
|
|
|
case SOCKS5_PW: |
|
|
|
|
|
|
|
comboProxyType_http->setCurrentIndex(2); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
comboProxyType_http->setCurrentIndex(0); |
|
|
|
} |
|
|
|
} |
|
|
|
comboProxyType_http->setCurrentIndex(intValue); |
|
|
|
enableHTTPProxy(comboProxyType_http->currentIndex()); |
|
|
|
enableHTTPProxy(intValue); |
|
|
|
|
|
|
|
textProxyUsername_http->setText(Preferences::getHTTPProxyUsername()); |
|
|
|
textProxyUsername_http->setText(Preferences::getHTTPProxyUsername()); |
|
|
|
textProxyPassword_http->setText(Preferences::getHTTPProxyPassword()); |
|
|
|
textProxyPassword_http->setText(Preferences::getHTTPProxyPassword()); |
|
|
|
textProxyIP_http->setText(Preferences::getHTTPProxyIp()); |
|
|
|
textProxyIP_http->setText(Preferences::getHTTPProxyIp()); |
|
|
|