AddConstraintTeacherActivityTagMaxHoursDailyForm::AddConstraintTeacherActivityTagMaxHoursDailyForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp1=teachersComboBox->minimumSizeHint(); Q_UNUSED(tmp1); QSize tmp4=activityTagsComboBox->minimumSizeHint(); Q_UNUSED(tmp4); updateMaxHoursSpinBox(); teachersComboBox->clear(); for(int i=0; i<gt.rules.teachersList.size(); i++){ Teacher* tch=gt.rules.teachersList[i]; teachersComboBox->addItem(tch->name); } activityTagsComboBox->clear(); foreach(ActivityTag* at, gt.rules.activityTagsList) activityTagsComboBox->addItem(at->name); constraintChanged(); }
ModifyConstraintStudentsSetMaxDaysPerWeekForm::ModifyConstraintStudentsSetMaxDaysPerWeekForm(QWidget* parent, ConstraintStudentsSetMaxDaysPerWeek* ctr): QDialog(parent) { setupUi(this); okPushButton->setDefault(true); connect(okPushButton, SIGNAL(clicked()), this, SLOT(ok())); connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancel())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp2=studentsComboBox->minimumSizeHint(); Q_UNUSED(tmp2); this->_ctr=ctr; weightLineEdit->setText(CustomFETString::number(ctr->weightPercentage)); updateMaxDaysSpinBox(); updateStudentsComboBox(parent); maxDaysSpinBox->setValue(ctr->maxDaysPerWeek); constraintChanged(); }
ModifyConstraintTwoActivitiesConsecutiveForm::ModifyConstraintTwoActivitiesConsecutiveForm(QWidget* parent, ConstraintTwoActivitiesConsecutive* ctr): QDialog(parent) { setupUi(this); okPushButton->setDefault(true); connect(okPushButton, SIGNAL(clicked()), this, SLOT(ok())); connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancel())); connect(swapPushButton, SIGNAL(clicked()), this, SLOT(swap())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp5=firstActivitiesComboBox->minimumSizeHint(); Q_UNUSED(tmp5); QSize tmp6=secondActivitiesComboBox->minimumSizeHint(); Q_UNUSED(tmp6); firstActivitiesComboBox->setMaximumWidth(maxRecommendedWidth(this)); secondActivitiesComboBox->setMaximumWidth(maxRecommendedWidth(this)); this->_ctr=ctr; weightLineEdit->setText(CustomFETString::number(ctr->weightPercentage)); updateActivitiesComboBox(); constraintChanged(); }
void ModifyConstraintStudentsSetMaxDaysPerWeekForm::updateStudentsComboBox(QWidget* parent){ studentsComboBox->clear(); int i=0, j=-1; for(int m=0; m<gt.rules.yearsList.size(); m++){ StudentsYear* sty=gt.rules.yearsList[m]; studentsComboBox->addItem(sty->name); if(sty->name==this->_ctr->students) j=i; i++; for(int n=0; n<sty->groupsList.size(); n++){ StudentsGroup* stg=sty->groupsList[n]; studentsComboBox->addItem(stg->name); if(stg->name==this->_ctr->students) j=i; i++; if(SHOW_SUBGROUPS_IN_COMBO_BOXES) for(int p=0; p<stg->subgroupsList.size(); p++){ StudentsSubgroup* sts=stg->subgroupsList[p]; studentsComboBox->addItem(sts->name); if(sts->name==this->_ctr->students) j=i; i++; } } } if(j<0) showWarningForInvisibleSubgroupConstraint(parent, this->_ctr->students); else assert(j>=0); studentsComboBox->setCurrentIndex(j); constraintChanged(); }
AddConstraintStudentsSetEarlyMaxBeginningsAtSecondHourForm::AddConstraintStudentsSetEarlyMaxBeginningsAtSecondHourForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp2=studentsComboBox->minimumSizeHint(); Q_UNUSED(tmp2); studentsComboBox->clear(); for(int i=0; i<gt.rules.yearsList.size(); i++){ StudentsYear* sty=gt.rules.yearsList[i]; studentsComboBox->addItem(sty->name); for(int j=0; j<sty->groupsList.size(); j++){ StudentsGroup* stg=sty->groupsList[j]; studentsComboBox->addItem(stg->name); if(SHOW_SUBGROUPS_IN_COMBO_BOXES) for(int k=0; k<stg->subgroupsList.size(); k++){ StudentsSubgroup* sts=stg->subgroupsList[k]; studentsComboBox->addItem(sts->name); } } } maxBeginningsSpinBox->setMinimum(0); maxBeginningsSpinBox->setMaximum(gt.rules.nDaysPerWeek); maxBeginningsSpinBox->setValue(0); constraintChanged(); }
ModifyConstraintTeacherMaxBuildingChangesPerWeekForm::ModifyConstraintTeacherMaxBuildingChangesPerWeekForm(QWidget* parent, ConstraintTeacherMaxBuildingChangesPerWeek* ctr): QDialog(parent) { setupUi(this); okPushButton->setDefault(true); connect(okPushButton, SIGNAL(clicked()), this, SLOT(ok())); connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancel())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp1=teachersComboBox->minimumSizeHint(); Q_UNUSED(tmp1); this->_ctr=ctr; weightLineEdit->setText(CustomFETString::number(ctr->weightPercentage)); updateTeachersComboBox(); maxChangesSpinBox->setMinimum(0); maxChangesSpinBox->setMaximum(gt.rules.nDaysPerWeek*gt.rules.nHoursPerDay); maxChangesSpinBox->setValue(ctr->maxBuildingChangesPerWeek); constraintChanged(); }
AddConstraintTeacherMaxGapsPerWeekForm::AddConstraintTeacherMaxGapsPerWeekForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp1=teachersComboBox->minimumSizeHint(); Q_UNUSED(tmp1); maxGapsSpinBox->setMinimum(0); maxGapsSpinBox->setMaximum(gt.rules.nDaysPerWeek*gt.rules.nHoursPerDay); maxGapsSpinBox->setValue(3); teachersComboBox->clear(); for(int i=0; i<gt.rules.teachersList.size(); i++){ Teacher* tch=gt.rules.teachersList[i]; teachersComboBox->addItem(tch->name); } constraintChanged(); }
void ModifyConstraintStudentsSetMaxGapsPerDayForm::updateStudentsComboBox(){ studentsComboBox->clear(); int i=0, j=-1; for(int m=0; m<gt.rules.yearsList.size(); m++){ StudentsYear* sty=gt.rules.yearsList[m]; studentsComboBox->addItem(sty->name); if(sty->name==this->_ctr->students) j=i; i++; for(int n=0; n<sty->groupsList.size(); n++){ StudentsGroup* stg=sty->groupsList[n]; studentsComboBox->addItem(stg->name); if(stg->name==this->_ctr->students) j=i; i++; for(int p=0; p<stg->subgroupsList.size(); p++){ StudentsSubgroup* sts=stg->subgroupsList[p]; studentsComboBox->addItem(sts->name); if(sts->name==this->_ctr->students) j=i; i++; } } } assert(j>=0); studentsComboBox->setCurrentIndex(j); constraintChanged(); }
void AddConstraintTeacherIntervalMaxDaysPerWeekForm::updateTeachersComboBox(){ teachersComboBox->clear(); for(int i=0; i<gt.rules.teachersList.size(); i++){ Teacher* tch=gt.rules.teachersList[i]; teachersComboBox->addItem(tch->name); } constraintChanged(); }
void AddConstraintTeacherIntervalMaxDaysPerWeekForm::updateStartHoursComboBox() { startHourComboBox->clear(); for(int i=0; i<gt.rules.nHoursPerDay; i++) startHourComboBox->addItem(gt.rules.hoursOfTheDay[i]); startHourComboBox->setCurrentIndex(gt.rules.nHoursPerDay-1); constraintChanged(); }
void AddConstraintTeacherIntervalMaxDaysPerWeekForm::updateEndHoursComboBox() { endHourComboBox->clear(); for(int i=0; i<gt.rules.nHoursPerDay; i++) endHourComboBox->addItem(gt.rules.hoursOfTheDay[i]); endHourComboBox->addItem(tr("End of day")); endHourComboBox->setCurrentIndex(gt.rules.nHoursPerDay); constraintChanged(); }
void ConstraintActivitiesSameStartingTimeForm::refreshConstraintsListWidget() { this->visibleConstraintsList.clear(); constraintsListWidget->clear(); for(int i=0; i<gt.rules.timeConstraintsList.size(); i++){ TimeConstraint* ctr=gt.rules.timeConstraintsList[i]; if(filterOk(ctr)){ QString s; s=ctr->getDescription(gt.rules); visibleConstraintsList.append(ctr); constraintsListWidget->addItem(s); } } if(constraintsListWidget->count()>0){ constraintsListWidget->setCurrentRow(0); constraintChanged(constraintsListWidget->currentRow()); } else constraintChanged(-1); }
void ModifyConstraintTeacherIntervalMaxDaysPerWeekForm::updateTeachersComboBox(){ teachersComboBox->clear(); int i=0, j=-1; for(int k=0; k<gt.rules.teachersList.size(); k++, i++){ Teacher* tch=gt.rules.teachersList[k]; teachersComboBox->addItem(tch->name); if(tch->name==this->_ctr->teacherName) j=i; } assert(j>=0); teachersComboBox->setCurrentIndex(j); constraintChanged(); }
ModifyConstraintTeacherActivityTagMaxHoursContinuouslyForm::ModifyConstraintTeacherActivityTagMaxHoursContinuouslyForm(QWidget* parent, ConstraintTeacherActivityTagMaxHoursContinuously* ctr): QDialog(parent) { setupUi(this); okPushButton->setDefault(true); connect(okPushButton, SIGNAL(clicked()), this, SLOT(ok())); connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancel())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp1=teachersComboBox->minimumSizeHint(); Q_UNUSED(tmp1); QSize tmp4=activityTagsComboBox->minimumSizeHint(); Q_UNUSED(tmp4); this->_ctr=ctr; weightLineEdit->setText(CustomFETString::number(ctr->weightPercentage)); updateMaxHoursSpinBox(); maxHoursSpinBox->setValue(ctr->maxHoursContinuously); teachersComboBox->clear(); int i=0, j=-1; for(int k=0; k<gt.rules.teachersList.size(); k++, i++){ Teacher* tch=gt.rules.teachersList[k]; teachersComboBox->addItem(tch->name); if(tch->name==this->_ctr->teacherName) j=i; } assert(j>=0); teachersComboBox->setCurrentIndex(j); j=-1; activityTagsComboBox->clear(); for(int k=0; k<gt.rules.activityTagsList.count(); k++){ ActivityTag* at=gt.rules.activityTagsList.at(k); activityTagsComboBox->addItem(at->name); if(at->name==this->_ctr->activityTagName) j=k; } assert(j>=0); activityTagsComboBox->setCurrentIndex(j); constraintChanged(); }
void ModifyConstraintStudentsSetActivityTagMaxHoursDailyForm::updateActivityTagsComboBox() { activityTagsComboBox->clear(); int j=-1; for(int i=0; i<gt.rules.activityTagsList.count(); i++){ ActivityTag* at=gt.rules.activityTagsList.at(i); activityTagsComboBox->addItem(at->name); if(at->name==this->_ctr->activityTagName) j=i; } assert(j>=0); activityTagsComboBox->setCurrentIndex(j); constraintChanged(); }
void ConstraintTeachersMaxDaysPerWeekForm::filterChanged() { this->visibleConstraintsList.clear(); constraintsListWidget->clear(); for(int i=0; i<gt.rules.timeConstraintsList.size(); i++){ TimeConstraint* ctr=gt.rules.timeConstraintsList[i]; if(filterOk(ctr)){ visibleConstraintsList.append(ctr); constraintsListWidget->addItem(ctr->getDescription(gt.rules)); } } if(constraintsListWidget->count()>0) constraintsListWidget->setCurrentRow(0); else constraintChanged(-1); }
void AddConstraintStudentsSetIntervalMaxDaysPerWeekForm::updateStudentsComboBox() { studentsComboBox->clear(); for(int i=0; i<gt.rules.yearsList.size(); i++){ StudentsYear* sty=gt.rules.yearsList[i]; studentsComboBox->addItem(sty->name); for(int j=0; j<sty->groupsList.size(); j++){ StudentsGroup* stg=sty->groupsList[j]; studentsComboBox->addItem(stg->name); if(SHOW_SUBGROUPS_IN_COMBO_BOXES) for(int k=0; k<stg->subgroupsList.size(); k++){ StudentsSubgroup* sts=stg->subgroupsList[k]; studentsComboBox->addItem(sts->name); } } } constraintChanged(); }
void AddConstraintStudentsSetMaxGapsPerWeekForm::updateStudentsSetComboBox() { studentsComboBox->clear(); for(int i=0; i<gt.rules.yearsList.size(); i++){ StudentsYear* sty=gt.rules.yearsList[i]; studentsComboBox->addItem(sty->name); for(int j=0; j<sty->groupsList.size(); j++){ StudentsGroup* stg=sty->groupsList[j]; studentsComboBox->addItem(stg->name); for(int k=0; k<stg->subgroupsList.size(); k++){ StudentsSubgroup* sts=stg->subgroupsList[k]; studentsComboBox->addItem(sts->name); } } } constraintChanged(); }
AddConstraintStudentsMinGapsBetweenBuildingChangesForm::AddConstraintStudentsMinGapsBetweenBuildingChangesForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); minGapsSpinBox->setMinimum(1); minGapsSpinBox->setMaximum(gt.rules.nHoursPerDay); minGapsSpinBox->setValue(1); constraintChanged(); }
ModifyConstraintStudentsSetIntervalMaxDaysPerWeekForm::ModifyConstraintStudentsSetIntervalMaxDaysPerWeekForm(QWidget* parent, ConstraintStudentsSetIntervalMaxDaysPerWeek* ctr): QDialog(parent) { setupUi(this); okPushButton->setDefault(true); connect(okPushButton, SIGNAL(clicked()), this, SLOT(ok())); connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancel())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp2=studentsComboBox->minimumSizeHint(); Q_UNUSED(tmp2); QSize tmp5=startHourComboBox->minimumSizeHint(); Q_UNUSED(tmp5); QSize tmp6=endHourComboBox->minimumSizeHint(); Q_UNUSED(tmp6); this->_ctr=ctr; weightLineEdit->setText(CustomFETString::number(ctr->weightPercentage)); updateMaxDaysSpinBox(); updateStudentsComboBox(parent); maxDaysSpinBox->setValue(ctr->maxDaysPerWeek); for(int i=0; i<gt.rules.nHoursPerDay; i++){ startHourComboBox->addItem(gt.rules.hoursOfTheDay[i]); } startHourComboBox->setCurrentIndex(ctr->startHour); for(int i=0; i<gt.rules.nHoursPerDay; i++){ endHourComboBox->addItem(gt.rules.hoursOfTheDay[i]); } endHourComboBox->addItem(tr("End of day")); endHourComboBox->setCurrentIndex(ctr->endHour); constraintChanged(); }
void ModifyConstraintActivityPreferredStartingTimeForm::updateActivitiesComboBox(){ activitiesComboBox->clear(); activitiesList.clear(); int i=0, j=-1; for(int k=0; k<gt.rules.activitiesList.size(); k++){ Activity* act=gt.rules.activitiesList[k]; if(filterOk(act)){ activitiesComboBox->addItem(act->getDescription(gt.rules)); this->activitiesList.append(act->id); if(act->id==this->_ctr->activityId) j=i; i++; } } //assert(j>=0); only first time activitiesComboBox->setCurrentIndex(j); constraintChanged(); }
AddConstraintTeachersMinRestingHoursForm::AddConstraintTeachersMinRestingHoursForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); circularCheckBox->setChecked(true); minRestingHoursSpinBox->setMinimum(1); minRestingHoursSpinBox->setMaximum(gt.rules.nHoursPerDay); minRestingHoursSpinBox->setValue(1); constraintChanged(); }
void AddConstraintTwoActivitiesOrderedForm::updateActivitiesComboBox(){ firstActivitiesComboBox->clear(); firstActivitiesList.clear(); secondActivitiesComboBox->clear(); secondActivitiesList.clear(); for(int i=0; i<gt.rules.activitiesList.size(); i++){ Activity* act=gt.rules.activitiesList[i]; if(filterOk(act)){ firstActivitiesComboBox->addItem(act->getDescription(gt.rules)); this->firstActivitiesList.append(act->id); secondActivitiesComboBox->addItem(act->getDescription(gt.rules)); this->secondActivitiesList.append(act->id); } } constraintChanged(); }
AddConstraintStudentsSetMaxSpanPerDayForm::AddConstraintStudentsSetMaxSpanPerDayForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp2=studentsComboBox->minimumSizeHint(); Q_UNUSED(tmp2); maxSpanSpinBox->setMinimum(1); maxSpanSpinBox->setMaximum(gt.rules.nHoursPerDay); maxSpanSpinBox->setValue(gt.rules.nHoursPerDay); updateStudentsSetComboBox(); constraintChanged(); }
ModifyConstraintActivityPreferredStartingTimeForm::ModifyConstraintActivityPreferredStartingTimeForm(QWidget* parent, ConstraintActivityPreferredStartingTime* ctr): QDialog(parent) { setupUi(this); okPushButton->setDefault(true); connect(okPushButton, SIGNAL(clicked()), this, SLOT(ok())); connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancel())); connect(teachersComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged())); connect(studentsComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged())); connect(subjectsComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged())); connect(activityTagsComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp1=teachersComboBox->minimumSizeHint(); Q_UNUSED(tmp1); QSize tmp2=studentsComboBox->minimumSizeHint(); Q_UNUSED(tmp2); QSize tmp3=subjectsComboBox->minimumSizeHint(); Q_UNUSED(tmp3); QSize tmp4=activityTagsComboBox->minimumSizeHint(); Q_UNUSED(tmp4); QSize tmp5=activitiesComboBox->minimumSizeHint(); Q_UNUSED(tmp5); QSize tmp6=dayComboBox->minimumSizeHint(); Q_UNUSED(tmp6); QSize tmp7=startHourComboBox->minimumSizeHint(); Q_UNUSED(tmp7); activitiesComboBox->setMaximumWidth(maxRecommendedWidth(this)); this->_ctr=ctr; weightLineEdit->setText(CustomFETString::number(ctr->weightPercentage)); teachersComboBox->addItem(""); for(int i=0; i<gt.rules.teachersList.size(); i++){ Teacher* tch=gt.rules.teachersList[i]; teachersComboBox->addItem(tch->name); } teachersComboBox->setCurrentIndex(0); subjectsComboBox->addItem(""); for(int i=0; i<gt.rules.subjectsList.size(); i++){ Subject* sb=gt.rules.subjectsList[i]; subjectsComboBox->addItem(sb->name); } subjectsComboBox->setCurrentIndex(0); activityTagsComboBox->addItem(""); for(int i=0; i<gt.rules.activityTagsList.size(); i++){ ActivityTag* st=gt.rules.activityTagsList[i]; activityTagsComboBox->addItem(st->name); } activityTagsComboBox->setCurrentIndex(0); studentsComboBox->addItem(""); for(int i=0; i<gt.rules.yearsList.size(); i++){ StudentsYear* sty=gt.rules.yearsList[i]; studentsComboBox->addItem(sty->name); for(int j=0; j<sty->groupsList.size(); j++){ StudentsGroup* stg=sty->groupsList[j]; studentsComboBox->addItem(stg->name); if(SHOW_SUBGROUPS_IN_COMBO_BOXES) for(int k=0; k<stg->subgroupsList.size(); k++){ StudentsSubgroup* sts=stg->subgroupsList[k]; studentsComboBox->addItem(sts->name); } } } studentsComboBox->setCurrentIndex(0); updatePeriodGroupBox(); updateActivitiesComboBox(); if(ctr->day>=0 && ctr->day<gt.rules.nDaysPerWeek) dayComboBox->setCurrentIndex(ctr->day); else dayComboBox->setCurrentIndex(-1); if(ctr->hour>=0 && ctr->hour<gt.rules.nHoursPerDay) startHourComboBox->setCurrentIndex(ctr->hour); else startHourComboBox->setCurrentIndex(-1); permLockedCheckBox->setChecked(this->_ctr->permanentlyLocked); constraintChanged(); }