|
|
@ -166,10 +166,8 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ |
|
|
|
connect(checkMaxUploadsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableMaxUploadsLimitPerTorrent(bool))); |
|
|
|
connect(checkMaxUploadsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableMaxUploadsLimitPerTorrent(bool))); |
|
|
|
connect(checkMaxRatio, SIGNAL(toggled(bool)), this, SLOT(enableMaxRatio(bool))); |
|
|
|
connect(checkMaxRatio, SIGNAL(toggled(bool)), this, SLOT(enableMaxRatio(bool))); |
|
|
|
// Proxy tab
|
|
|
|
// Proxy tab
|
|
|
|
connect(comboProxyType_http, SIGNAL(currentIndexChanged(int)),this, SLOT(enableHTTPProxy(int))); |
|
|
|
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enableProxy(int))); |
|
|
|
connect(checkProxyAuth_http, SIGNAL(toggled(bool)), this, SLOT(enableHTTPProxyAuth(bool))); |
|
|
|
connect(checkProxyAuth, SIGNAL(toggled(bool)), this, SLOT(enableProxyAuth(bool))); |
|
|
|
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enablePeerProxy(int))); |
|
|
|
|
|
|
|
connect(checkProxyAuth, SIGNAL(toggled(bool)), this, SLOT(enablePeerProxyAuth(bool))); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Apply button is activated when a value is changed
|
|
|
|
// Apply button is activated when a value is changed
|
|
|
|
// General tab
|
|
|
|
// General tab
|
|
|
@ -232,12 +230,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){ |
|
|
|
connect(spinMaxRatio, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinMaxRatio, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(comboRatioLimitAct, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); |
|
|
|
connect(comboRatioLimitAct, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); |
|
|
|
// Proxy tab
|
|
|
|
// Proxy tab
|
|
|
|
connect(comboProxyType_http, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); |
|
|
|
|
|
|
|
connect(textProxyIP_http, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
|
|
|
|
connect(spinProxyPort_http, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
|
|
|
|
connect(checkProxyAuth_http, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
|
|
|
|
connect(textProxyUsername_http, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
|
|
|
|
connect(textProxyPassword_http, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
|
|
|
|
connect(comboProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); |
|
|
|
connect(comboProxyType, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton())); |
|
|
|
connect(textProxyIP, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(textProxyIP, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinProxyPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinProxyPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
@ -418,18 +410,12 @@ void options_imp::saveOptions(){ |
|
|
|
pref.setSchedulerStartTime(schedule_from->time()); |
|
|
|
pref.setSchedulerStartTime(schedule_from->time()); |
|
|
|
pref.setSchedulerEndTime(schedule_to->time()); |
|
|
|
pref.setSchedulerEndTime(schedule_to->time()); |
|
|
|
pref.setSchedulerDays((scheduler_days)schedule_days->currentIndex()); |
|
|
|
pref.setSchedulerDays((scheduler_days)schedule_days->currentIndex()); |
|
|
|
pref.setPeerProxyType(getPeerProxyType()); |
|
|
|
pref.setProxyType(getProxyType()); |
|
|
|
pref.setPeerProxyIp(getPeerProxyIp()); |
|
|
|
pref.setProxyIp(getProxyIp()); |
|
|
|
pref.setPeerProxyPort(getPeerProxyPort()); |
|
|
|
pref.setProxyPort(getProxyPort()); |
|
|
|
pref.setPeerProxyAuthEnabled(isPeerProxyAuthEnabled()); |
|
|
|
pref.setProxyAuthEnabled(isProxyAuthEnabled()); |
|
|
|
pref.setPeerProxyUsername(getPeerProxyUsername()); |
|
|
|
pref.setProxyUsername(getProxyUsername()); |
|
|
|
pref.setPeerProxyPassword(getPeerProxyPassword()); |
|
|
|
pref.setProxyPassword(getProxyPassword()); |
|
|
|
pref.setHTTPProxyType(getHTTPProxyType()); |
|
|
|
|
|
|
|
pref.setHTTPProxyIp(getHTTPProxyIp()); |
|
|
|
|
|
|
|
pref.setHTTPProxyPort(getHTTPProxyPort()); |
|
|
|
|
|
|
|
pref.setHTTPProxyAuthEnabled(isHTTPProxyAuthEnabled()); |
|
|
|
|
|
|
|
pref.setHTTPProxyUsername(getHTTPProxyUsername()); |
|
|
|
|
|
|
|
pref.setHTTPProxyPassword(getHTTPProxyPassword()); |
|
|
|
|
|
|
|
// End Connection preferences
|
|
|
|
// End Connection preferences
|
|
|
|
// Bittorrent preferences
|
|
|
|
// Bittorrent preferences
|
|
|
|
pref.setMaxConnecs(getMaxConnecs()); |
|
|
|
pref.setMaxConnecs(getMaxConnecs()); |
|
|
@ -480,18 +466,18 @@ bool options_imp::isFilteringEnabled() const{ |
|
|
|
return checkIPFilter->isChecked(); |
|
|
|
return checkIPFilter->isChecked(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int options_imp::getPeerProxyType() const{ |
|
|
|
int options_imp::getProxyType() const{ |
|
|
|
switch(comboProxyType->currentIndex()) { |
|
|
|
switch(comboProxyType->currentIndex()) { |
|
|
|
case 1: |
|
|
|
case 1: |
|
|
|
return Proxy::SOCKS4; |
|
|
|
return Proxy::SOCKS4; |
|
|
|
break; |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
case 2: |
|
|
|
if(isPeerProxyAuthEnabled()){ |
|
|
|
if(isProxyAuthEnabled()){ |
|
|
|
return Proxy::SOCKS5_PW; |
|
|
|
return Proxy::SOCKS5_PW; |
|
|
|
} |
|
|
|
} |
|
|
|
return Proxy::SOCKS5; |
|
|
|
return Proxy::SOCKS5; |
|
|
|
case 3: |
|
|
|
case 3: |
|
|
|
if(isPeerProxyAuthEnabled()){ |
|
|
|
if(isProxyAuthEnabled()){ |
|
|
|
return Proxy::HTTP_PW; |
|
|
|
return Proxy::HTTP_PW; |
|
|
|
} |
|
|
|
} |
|
|
|
return Proxy::HTTP; |
|
|
|
return Proxy::HTTP; |
|
|
@ -500,25 +486,6 @@ int options_imp::getPeerProxyType() const{ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
int options_imp::getHTTPProxyType() const { |
|
|
|
|
|
|
|
switch(comboProxyType_http->currentIndex()) { |
|
|
|
|
|
|
|
case 1: { |
|
|
|
|
|
|
|
if(isHTTPProxyAuthEnabled()){ |
|
|
|
|
|
|
|
return Proxy::HTTP_PW; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Proxy::HTTP; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
case 2: { |
|
|
|
|
|
|
|
if(isHTTPProxyAuthEnabled()) { |
|
|
|
|
|
|
|
return Proxy::SOCKS5_PW; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return Proxy::SOCKS5; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
return -1; // Disabled
|
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString options_imp::getStyle() const{ |
|
|
|
QString options_imp::getStyle() const{ |
|
|
|
return comboStyle->itemText(comboStyle->currentIndex()); |
|
|
|
return comboStyle->itemText(comboStyle->currentIndex()); |
|
|
|
} |
|
|
|
} |
|
|
@ -529,10 +496,6 @@ void options_imp::setStyle(QString style) { |
|
|
|
comboStyle->setCurrentIndex(index); |
|
|
|
comboStyle->setCurrentIndex(index); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool options_imp::isHTTPProxyAuthEnabled() const{ |
|
|
|
|
|
|
|
return checkProxyAuth_http->isChecked(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void options_imp::loadOptions(){ |
|
|
|
void options_imp::loadOptions(){ |
|
|
|
int intValue; |
|
|
|
int intValue; |
|
|
|
float floatValue; |
|
|
|
float floatValue; |
|
|
@ -638,7 +601,7 @@ void options_imp::loadOptions(){ |
|
|
|
schedule_to->setTime(pref.getSchedulerEndTime()); |
|
|
|
schedule_to->setTime(pref.getSchedulerEndTime()); |
|
|
|
schedule_days->setCurrentIndex((int)pref.getSchedulerDays()); |
|
|
|
schedule_days->setCurrentIndex((int)pref.getSchedulerDays()); |
|
|
|
|
|
|
|
|
|
|
|
intValue = pref.getPeerProxyType(); |
|
|
|
intValue = pref.getProxyType(); |
|
|
|
switch(intValue) { |
|
|
|
switch(intValue) { |
|
|
|
case Proxy::SOCKS4: |
|
|
|
case Proxy::SOCKS4: |
|
|
|
comboProxyType->setCurrentIndex(1); |
|
|
|
comboProxyType->setCurrentIndex(1); |
|
|
@ -654,37 +617,16 @@ void options_imp::loadOptions(){ |
|
|
|
default: |
|
|
|
default: |
|
|
|
comboProxyType->setCurrentIndex(0); |
|
|
|
comboProxyType->setCurrentIndex(0); |
|
|
|
} |
|
|
|
} |
|
|
|
enablePeerProxy(comboProxyType->currentIndex()); |
|
|
|
enableProxy(comboProxyType->currentIndex()); |
|
|
|
//if(isProxyEnabled()) {
|
|
|
|
//if(isProxyEnabled()) {
|
|
|
|
// Proxy is enabled, save settings
|
|
|
|
// Proxy is enabled, save settings
|
|
|
|
textProxyIP->setText(pref.getPeerProxyIp()); |
|
|
|
textProxyIP->setText(pref.getProxyIp()); |
|
|
|
spinProxyPort->setValue(pref.getPeerProxyPort()); |
|
|
|
spinProxyPort->setValue(pref.getProxyPort()); |
|
|
|
checkProxyAuth->setChecked(pref.isPeerProxyAuthEnabled()); |
|
|
|
checkProxyAuth->setChecked(pref.isProxyAuthEnabled()); |
|
|
|
textProxyUsername->setText(pref.getPeerProxyUsername()); |
|
|
|
textProxyUsername->setText(pref.getProxyUsername()); |
|
|
|
textProxyPassword->setText(pref.getPeerProxyPassword()); |
|
|
|
textProxyPassword->setText(pref.getProxyPassword()); |
|
|
|
enablePeerProxyAuth(checkProxyAuth->isChecked()); |
|
|
|
enableProxyAuth(checkProxyAuth->isChecked()); |
|
|
|
//}
|
|
|
|
//}
|
|
|
|
intValue = pref.getHTTPProxyType(); |
|
|
|
|
|
|
|
switch(intValue) { |
|
|
|
|
|
|
|
case Proxy::HTTP: |
|
|
|
|
|
|
|
case Proxy::HTTP_PW: |
|
|
|
|
|
|
|
comboProxyType_http->setCurrentIndex(1); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
case Proxy::SOCKS5: |
|
|
|
|
|
|
|
case Proxy::SOCKS5_PW: |
|
|
|
|
|
|
|
comboProxyType_http->setCurrentIndex(2); |
|
|
|
|
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
|
|
|
|
comboProxyType_http->setCurrentIndex(0); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
enableHTTPProxy(comboProxyType_http->currentIndex()); |
|
|
|
|
|
|
|
textProxyUsername_http->setText(pref.getHTTPProxyUsername()); |
|
|
|
|
|
|
|
textProxyPassword_http->setText(pref.getHTTPProxyPassword()); |
|
|
|
|
|
|
|
textProxyIP_http->setText(pref.getHTTPProxyIp()); |
|
|
|
|
|
|
|
spinProxyPort_http->setValue(pref.getHTTPProxyPort()); |
|
|
|
|
|
|
|
checkProxyAuth_http->setChecked(pref.isHTTPProxyAuthEnabled()); |
|
|
|
|
|
|
|
enableHTTPProxyAuth(checkProxyAuth_http->isChecked()); |
|
|
|
|
|
|
|
// End HTTPProxy
|
|
|
|
|
|
|
|
// End Connection preferences
|
|
|
|
// End Connection preferences
|
|
|
|
// Bittorrent preferences
|
|
|
|
// Bittorrent preferences
|
|
|
|
intValue = pref.getMaxConnecs(); |
|
|
|
intValue = pref.getMaxConnecs(); |
|
|
@ -987,7 +929,7 @@ void options_imp::enableMaxRatio(bool checked){ |
|
|
|
comboRatioLimitAct->setEnabled(checked); |
|
|
|
comboRatioLimitAct->setEnabled(checked); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void options_imp::enablePeerProxy(int index){ |
|
|
|
void options_imp::enableProxy(int index){ |
|
|
|
if(index){ |
|
|
|
if(index){ |
|
|
|
//enable
|
|
|
|
//enable
|
|
|
|
lblProxyIP->setEnabled(true); |
|
|
|
lblProxyIP->setEnabled(true); |
|
|
@ -1011,32 +953,13 @@ void options_imp::enablePeerProxy(int index){ |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void options_imp::enableHTTPProxy(int index){ |
|
|
|
void options_imp::enableProxyAuth(bool checked){ |
|
|
|
bool enable = (index > 0); |
|
|
|
|
|
|
|
lblProxyIP_http->setEnabled(enable); |
|
|
|
|
|
|
|
textProxyIP_http->setEnabled(enable); |
|
|
|
|
|
|
|
lblProxyPort_http->setEnabled(enable); |
|
|
|
|
|
|
|
spinProxyPort_http->setEnabled(enable); |
|
|
|
|
|
|
|
checkProxyAuth_http->setEnabled(enable); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if(!enable) |
|
|
|
|
|
|
|
checkProxyAuth_http->setChecked(false); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void options_imp::enablePeerProxyAuth(bool checked){ |
|
|
|
|
|
|
|
lblProxyUsername->setEnabled(checked); |
|
|
|
lblProxyUsername->setEnabled(checked); |
|
|
|
lblProxyPassword->setEnabled(checked); |
|
|
|
lblProxyPassword->setEnabled(checked); |
|
|
|
textProxyUsername->setEnabled(checked); |
|
|
|
textProxyUsername->setEnabled(checked); |
|
|
|
textProxyPassword->setEnabled(checked); |
|
|
|
textProxyPassword->setEnabled(checked); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
void options_imp::enableHTTPProxyAuth(bool checked){ |
|
|
|
|
|
|
|
lblProxyUsername_http->setEnabled(checked); |
|
|
|
|
|
|
|
lblProxyPassword_http->setEnabled(checked); |
|
|
|
|
|
|
|
textProxyUsername_http->setEnabled(checked); |
|
|
|
|
|
|
|
textProxyPassword_http->setEnabled(checked); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool options_imp::isSlashScreenDisabled() const { |
|
|
|
bool options_imp::isSlashScreenDisabled() const { |
|
|
|
return !checkShowSplash->isChecked(); |
|
|
|
return !checkShowSplash->isChecked(); |
|
|
|
} |
|
|
|
} |
|
|
@ -1054,62 +977,36 @@ bool options_imp::isDHTPortSameAsBT() const { |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// Proxy settings
|
|
|
|
// Proxy settings
|
|
|
|
bool options_imp::isPeerProxyEnabled() const{ |
|
|
|
bool options_imp::isProxyEnabled() const{ |
|
|
|
return comboProxyType->currentIndex(); |
|
|
|
return comboProxyType->currentIndex(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
bool options_imp::isHTTPProxyEnabled() const { |
|
|
|
bool options_imp::isProxyAuthEnabled() const{ |
|
|
|
return comboProxyType_http->currentIndex(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
bool options_imp::isPeerProxyAuthEnabled() const{ |
|
|
|
|
|
|
|
return checkProxyAuth->isChecked(); |
|
|
|
return checkProxyAuth->isChecked(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString options_imp::getPeerProxyIp() const{ |
|
|
|
QString options_imp::getProxyIp() const{ |
|
|
|
QString ip = textProxyIP->text(); |
|
|
|
QString ip = textProxyIP->text(); |
|
|
|
ip = ip.trimmed(); |
|
|
|
ip = ip.trimmed(); |
|
|
|
return ip; |
|
|
|
return ip; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString options_imp::getHTTPProxyIp() const{ |
|
|
|
unsigned short options_imp::getProxyPort() const{ |
|
|
|
QString ip = textProxyIP_http->text(); |
|
|
|
|
|
|
|
ip = ip.trimmed(); |
|
|
|
|
|
|
|
return ip; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
unsigned short options_imp::getPeerProxyPort() const{ |
|
|
|
|
|
|
|
return spinProxyPort->value(); |
|
|
|
return spinProxyPort->value(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
unsigned short options_imp::getHTTPProxyPort() const{ |
|
|
|
QString options_imp::getProxyUsername() const{ |
|
|
|
return spinProxyPort_http->value(); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString options_imp::getPeerProxyUsername() const{ |
|
|
|
|
|
|
|
QString username = textProxyUsername->text(); |
|
|
|
QString username = textProxyUsername->text(); |
|
|
|
username = username.trimmed(); |
|
|
|
username = username.trimmed(); |
|
|
|
return username; |
|
|
|
return username; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString options_imp::getHTTPProxyUsername() const{ |
|
|
|
QString options_imp::getProxyPassword() const{ |
|
|
|
QString username = textProxyUsername_http->text(); |
|
|
|
|
|
|
|
username = username.trimmed(); |
|
|
|
|
|
|
|
return username; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
QString options_imp::getPeerProxyPassword() const{ |
|
|
|
|
|
|
|
QString password = textProxyPassword->text(); |
|
|
|
QString password = textProxyPassword->text(); |
|
|
|
password = password.trimmed(); |
|
|
|
password = password.trimmed(); |
|
|
|
return password; |
|
|
|
return password; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
QString options_imp::getHTTPProxyPassword() const{ |
|
|
|
|
|
|
|
QString password = textProxyPassword_http->text(); |
|
|
|
|
|
|
|
password = password.trimmed(); |
|
|
|
|
|
|
|
return password; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// Locale Settings
|
|
|
|
// Locale Settings
|
|
|
|
QString options_imp::getLocale() const{ |
|
|
|
QString options_imp::getLocale() const{ |
|
|
|
return locales.at(comboI18n->currentIndex()); |
|
|
|
return locales.at(comboI18n->currentIndex()); |
|
|
|