- extending Queueing system to seeding list (unfinished)

This commit is contained in:
Christophe Dumez 2008-07-14 22:01:05 +00:00
parent b73d0548c8
commit 20ae3d997c
11 changed files with 414 additions and 169 deletions

View file

@ -210,6 +210,7 @@ options_imp::options_imp(QWidget *parent):QDialog(parent){
connect(checkEnableRSS, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(checkEnableQueueing, SIGNAL(stateChanged(int)), this, SLOT(enableApplyButton()));
connect(spinMaxActiveDownloads, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
connect(spinMaxActiveTorrents, SIGNAL(valueChanged(QString)), this, SLOT(enableApplyButton()));
// Web UI tab
connect(checkWebUi, SIGNAL(toggled(bool)), this, SLOT(enableApplyButton()));
connect(spinWebUiPort, SIGNAL(valueChanged(int)), this, SLOT(enableApplyButton()));
@ -354,6 +355,7 @@ void options_imp::saveOptions(){
settings.beginGroup("Queueing");
settings.setValue(QString::fromUtf8("QueueingEnabled"), isQueueingSystemEnabled());
settings.setValue(QString::fromUtf8("MaxActiveDownloads"), spinMaxActiveDownloads->value());
settings.setValue(QString::fromUtf8("MaxActiveTorrents"), spinMaxActiveTorrents->value());
// End Queueing system preferences
settings.endGroup();
// Web UI
@ -635,6 +637,7 @@ void options_imp::loadOptions(){
if(isQueueingSystemEnabled()) {
enableQueueingSystem(2); // Enable
spinMaxActiveDownloads->setValue(settings.value(QString::fromUtf8("MaxActiveDownloads"), 3).toInt());
spinMaxActiveTorrents->setValue(settings.value(QString::fromUtf8("MaxActiveTorrents"), 5).toInt());
} else {
enableQueueingSystem(0); // Disable
}
@ -665,6 +668,10 @@ int options_imp::getMaxActiveDownloads() const {
return spinMaxActiveDownloads->value();
}
int options_imp::getMaxActiveTorrents() const {
return spinMaxActiveTorrents->value();
}
bool options_imp::minimizeToTray() const{
if(checkNoSystray->isChecked()) return false;
return checkMinimizeToSysTray->isChecked();
@ -855,10 +862,14 @@ void options_imp::enableQueueingSystem(int checkBoxValue) {
//Disable
spinMaxActiveDownloads->setEnabled(false);
label_max_active->setEnabled(false);
maxActiveTorrents_lbl->setEnabled(false);
spinMaxActiveTorrents->setEnabled(false);
}else{
//enable
spinMaxActiveDownloads->setEnabled(true);
label_max_active->setEnabled(true);
maxActiveTorrents_lbl->setEnabled(true);
spinMaxActiveTorrents->setEnabled(true);
}
}