Still improving program options

This commit is contained in:
Christophe Dumez 2010-06-21 20:29:51 +00:00
parent 08a08e4b24
commit b81c8d29ba
3 changed files with 276 additions and 390 deletions

View file

@ -161,9 +161,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Connect signals / slots
// General tab
connect(checkShowSystray, SIGNAL(toggled(bool)), this, SLOT(setSystrayOptionsState(bool)));
// Downloads tab
connect(checkTempFolder, SIGNAL(toggled(bool)), this, SLOT(enableTempPathInput(bool)));
connect(checkExportDir, SIGNAL(toggled(bool)), this, SLOT(enableTorrentExport(bool)));
// Connection tab
connect(checkUploadLimit, SIGNAL(toggled(bool)), this, SLOT(enableUploadLimit(bool)));
connect(checkDownloadLimit, SIGNAL(toggled(bool)), this, SLOT(enableDownloadLimit(bool)));
@ -185,7 +182,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// Misc tab
connect(checkIPFilter, SIGNAL(toggled(bool)), this, SLOT(enableFilter(bool)));
connect(checkEnableRSS, SIGNAL(toggled(bool)), this, SLOT(enableRSS(bool)));
connect(checkEnableQueueing, SIGNAL(toggled(bool)), this, SLOT(enableQueueingSystem(bool)));
// Web UI tab
connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableWebUi(bool)));
@ -619,10 +615,8 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
if(Preferences::isTempPathEnabled()) {
// enable
checkTempFolder->setChecked(true);
enableTempPathInput(checkTempFolder->isChecked());
} else {
checkTempFolder->setChecked(false);
enableTempPathInput(checkTempFolder->isChecked());
}
QString temp_path = Preferences::getTempPath();
#ifdef Q_WS_WIN
@ -641,7 +635,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
if(strValue.isEmpty()) {
// Disable
checkExportDir->setChecked(false);
enableTorrentExport(checkExportDir->isChecked());
} else {
// enable
checkExportDir->setChecked(true);
@ -649,7 +642,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
strValue = strValue.replace("/", "\\");
#endif
textExportDir->setText(strValue);
enableTorrentExport(checkExportDir->isChecked());
}
intValue = Preferences::getActionOnDblClOnTorrentDl();
@ -849,7 +841,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
// End RSS preferences
// Queueing system preferences
checkEnableQueueing->setChecked(Preferences::isQueueingSystemEnabled());
enableQueueingSystem(checkEnableQueueing->isChecked());
spinMaxActiveDownloads->setValue(Preferences::getMaxActiveDownloads());
spinMaxActiveUploads->setValue(Preferences::getMaxActiveUploads());
spinMaxActiveTorrents->setValue(Preferences::getMaxActiveTorrents());
@ -1109,16 +1100,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
}
}
void options_imp::enableTempPathInput(bool checked){
if(checked){
textTempPath->setEnabled(true);
browseTempDirButton->setEnabled(true);
}else{
textTempPath->setEnabled(false);
browseTempDirButton->setEnabled(false);
}
}
bool options_imp::useAdditionDialog() const{
return checkAdditionDialog->isChecked();
}
@ -1133,15 +1114,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
spinMaxConnec->setEnabled(checked);
}
void options_imp::enableQueueingSystem(bool checked) {
spinMaxActiveDownloads->setEnabled(checked);
spinMaxActiveUploads->setEnabled(checked);
label_max_active_dl->setEnabled(checked);
label_max_active_up->setEnabled(checked);
maxActiveTorrents_lbl->setEnabled(checked);
spinMaxActiveTorrents->setEnabled(checked);
}
void options_imp::enableMaxConnecsLimitPerTorrent(bool checked){
spinMaxConnecPerTorrent->setEnabled(checked);
}
@ -1264,11 +1236,6 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
textProxyPassword_http->setEnabled(checked);
}
void options_imp::enableTorrentExport(bool checked) {
textExportDir->setEnabled(checked);
browseExportDirButton->setEnabled(checked);
}
bool options_imp::isSlashScreenDisabled() const {
return !checkShowSplash->isChecked();
}