Still simplifying program options

This commit is contained in:
Christophe Dumez 2010-06-21 21:39:29 +00:00
parent 335e7366fd
commit da599da36d
6 changed files with 8 additions and 114 deletions

View file

@ -168,7 +168,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(checkMaxConnecs, SIGNAL(toggled(bool)), this, SLOT(enableMaxConnecsLimit(bool)));
connect(checkMaxConnecsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableMaxConnecsLimitPerTorrent(bool)));
connect(checkMaxUploadsPerTorrent, SIGNAL(toggled(bool)), this, SLOT(enableMaxUploadsLimitPerTorrent(bool)));
connect(checkRatioLimit, SIGNAL(toggled(bool)), this, SLOT(enableShareRatio(bool)));
connect(checkRatioRemove, SIGNAL(toggled(bool)), this, SLOT(enableDeleteRatio(bool)));
connect(comboPeerID, SIGNAL(currentIndexChanged(int)), this, SLOT(enableSpoofingSettings(int)));
// Proxy tab
@ -231,9 +230,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(client_version, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
connect(client_build, SIGNAL(textChanged(QString)), this, SLOT(enableApplyButton()));
connect(comboEncryption, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
connect(checkRatioLimit, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(checkRatioRemove, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(spinRatio, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinMaxRatio, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
// Proxy tab
connect(comboProxyType_http, SIGNAL(currentIndexChanged(int)), this, SLOT(enableApplyButton()));
@ -471,7 +468,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
Preferences::setPeerID("qB");
}
settings.setValue(QString::fromUtf8("Encryption"), getEncryptionSetting());
settings.setValue(QString::fromUtf8("DesiredRatio"), getDesiredRatio());
settings.setValue(QString::fromUtf8("MaxRatio"), getDeleteRatio());
// End Bittorrent preferences
settings.endGroup();
@ -793,17 +789,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
}
}
comboEncryption->setCurrentIndex(Preferences::getEncryptionSetting());
floatValue = Preferences::getDesiredRatio();
if(floatValue >= 1.) {
// Enable
checkRatioLimit->setChecked(true);
spinRatio->setEnabled(true);
spinRatio->setValue(floatValue);
} else {
// Disable
checkRatioLimit->setChecked(false);
spinRatio->setEnabled(false);
}
// Ratio limit
floatValue = Preferences::getDeleteRatio();
if(floatValue >= 1.) {
// Enable
@ -989,14 +975,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
return spinDHTPort->value();
}
// Return Share ratio
float options_imp::getDesiredRatio() const{
if(checkRatioLimit->isChecked()){
return spinRatio->value();
}
return -1;
}
// Return Share ratio
float options_imp::getDeleteRatio() const{
if(checkRatioRemove->isChecked()){
@ -1132,10 +1110,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
applyButton->setEnabled(true);
}
void options_imp::enableShareRatio(bool checked){
spinRatio->setEnabled(checked);
}
void options_imp::enableDeleteRatio(bool checked){
spinMaxRatio->setEnabled(checked);
}