|
|
@ -124,10 +124,13 @@ options_imp::options_imp(QWidget *parent): |
|
|
|
#ifndef Q_WS_WIN |
|
|
|
#ifndef Q_WS_WIN |
|
|
|
groupFileAssociation->setVisible(false); |
|
|
|
groupFileAssociation->setVisible(false); |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
|
|
|
|
#if LIBTORRENT_VERSION_MINOR < 16 |
|
|
|
|
|
|
|
checkAnonymousMode->setVisible(false); |
|
|
|
|
|
|
|
#endif |
|
|
|
|
|
|
|
|
|
|
|
// Connect signals / slots
|
|
|
|
// Connect signals / slots
|
|
|
|
// Proxy tab
|
|
|
|
|
|
|
|
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enableProxy(int))); |
|
|
|
connect(comboProxyType, SIGNAL(currentIndexChanged(int)),this, SLOT(enableProxy(int))); |
|
|
|
|
|
|
|
connect(checkAnonymousMode, SIGNAL(toggled(bool)), this, SLOT(toggleAnonymousMode(bool))); |
|
|
|
|
|
|
|
|
|
|
|
// Apply button is activated when a value is changed
|
|
|
|
// Apply button is activated when a value is changed
|
|
|
|
// General tab
|
|
|
|
// General tab
|
|
|
@ -196,6 +199,9 @@ options_imp::options_imp(QWidget *parent): |
|
|
|
connect(spinMaxConnecPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinMaxConnecPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinMaxUploadsPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinMaxUploadsPerTorrent, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
connect(checkDHT, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
|
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 |
|
|
|
|
|
|
|
connect(checkAnonymousMode, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
|
|
|
|
#endif |
|
|
|
connect(checkPeX, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
connect(checkPeX, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
connect(checkDifferentDHTPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
connect(checkDifferentDHTPort, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinDHTPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
|
connect(spinDHTPort, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton())); |
|
|
@ -443,6 +449,9 @@ void options_imp::saveOptions(){ |
|
|
|
pref.setDHTPort(getDHTPort()); |
|
|
|
pref.setDHTPort(getDHTPort()); |
|
|
|
pref.setLSDEnabled(isLSDEnabled()); |
|
|
|
pref.setLSDEnabled(isLSDEnabled()); |
|
|
|
pref.setEncryptionSetting(getEncryptionSetting()); |
|
|
|
pref.setEncryptionSetting(getEncryptionSetting()); |
|
|
|
|
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 |
|
|
|
|
|
|
|
pref.enableAnonymousMode(checkAnonymousMode->isChecked()); |
|
|
|
|
|
|
|
#endif |
|
|
|
pref.setGlobalMaxRatio(getMaxRatio()); |
|
|
|
pref.setGlobalMaxRatio(getMaxRatio()); |
|
|
|
pref.setMaxRatioAction(comboRatioLimitAct->currentIndex()); |
|
|
|
pref.setMaxRatioAction(comboRatioLimitAct->currentIndex()); |
|
|
|
// End Bittorrent preferences
|
|
|
|
// End Bittorrent preferences
|
|
|
@ -700,6 +709,9 @@ void options_imp::loadOptions(){ |
|
|
|
checkPeX->setChecked(pref.isPeXEnabled()); |
|
|
|
checkPeX->setChecked(pref.isPeXEnabled()); |
|
|
|
checkLSD->setChecked(pref.isLSDEnabled()); |
|
|
|
checkLSD->setChecked(pref.isLSDEnabled()); |
|
|
|
comboEncryption->setCurrentIndex(pref.getEncryptionSetting()); |
|
|
|
comboEncryption->setCurrentIndex(pref.getEncryptionSetting()); |
|
|
|
|
|
|
|
#if LIBTORRENT_VERSION_MINOR > 15 |
|
|
|
|
|
|
|
checkAnonymousMode->setChecked(pref.isAnonymousModeEnabled()); |
|
|
|
|
|
|
|
#endif |
|
|
|
// Ratio limit
|
|
|
|
// Ratio limit
|
|
|
|
floatValue = pref.getGlobalMaxRatio(); |
|
|
|
floatValue = pref.getGlobalMaxRatio(); |
|
|
|
if(floatValue >= 0.) { |
|
|
|
if(floatValue >= 0.) { |
|
|
@ -1301,3 +1313,22 @@ void options_imp::setSslCertificate(const QByteArray &cert, bool interactive) |
|
|
|
} |
|
|
|
} |
|
|
|
#endif |
|
|
|
#endif |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void options_imp::toggleAnonymousMode(bool enabled) |
|
|
|
|
|
|
|
{ |
|
|
|
|
|
|
|
if (enabled) { |
|
|
|
|
|
|
|
// Disable DHT, LSD, UPnP / NAT-PMP
|
|
|
|
|
|
|
|
checkDHT->setEnabled(false); |
|
|
|
|
|
|
|
checkDifferentDHTPort->setEnabled(false); |
|
|
|
|
|
|
|
checkDHT->setChecked(false); |
|
|
|
|
|
|
|
checkLSD->setEnabled(false); |
|
|
|
|
|
|
|
checkLSD->setChecked(false); |
|
|
|
|
|
|
|
checkUPnP->setEnabled(false); |
|
|
|
|
|
|
|
checkUPnP->setChecked(false); |
|
|
|
|
|
|
|
} else { |
|
|
|
|
|
|
|
checkDHT->setEnabled(true); |
|
|
|
|
|
|
|
checkDifferentDHTPort->setEnabled(true); |
|
|
|
|
|
|
|
checkLSD->setEnabled(true); |
|
|
|
|
|
|
|
checkUPnP->setEnabled(true); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
} |
|
|
|