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(); }
AddConstraintStudentsSetIntervalMaxDaysPerWeekForm::AddConstraintStudentsSetIntervalMaxDaysPerWeekForm(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); QSize tmp5=startHourComboBox->minimumSizeHint(); Q_UNUSED(tmp5); QSize tmp6=endHourComboBox->minimumSizeHint(); Q_UNUSED(tmp6); updateMaxDaysSpinBox(); updateStudentsComboBox(); updateStartHoursComboBox(); updateEndHoursComboBox(); }
AddConstraintTeacherNotAvailableTimesForm::AddConstraintTeacherNotAvailableTimesForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); connect(notAllowedTimesTable, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(itemClicked(QTableWidgetItem*))); connect(pushButton5, SIGNAL(clicked()), this, SLOT(help())); connect(setAllAvailablePushButton, SIGNAL(clicked()), this, SLOT(setAllAvailable())); connect(setAllNotAvailablePushButton, SIGNAL(clicked()), this, SLOT(setAllNotAvailable())); centerWidgetOnScreen(this); restoreFETDialogGeometry(this); QSize tmp1=teachersComboBox->minimumSizeHint(); Q_UNUSED(tmp1); updateTeachersComboBox(); notAllowedTimesTable->setRowCount(gt.rules.nHoursPerDay); notAllowedTimesTable->setColumnCount(gt.rules.nDaysPerWeek); for(int j=0; j<gt.rules.nDaysPerWeek; j++){ QTableWidgetItem* item=new QTableWidgetItem(gt.rules.daysOfTheWeek[j]); notAllowedTimesTable->setHorizontalHeaderItem(j, item); } for(int i=0; i<gt.rules.nHoursPerDay; i++){ QTableWidgetItem* item=new QTableWidgetItem(gt.rules.hoursOfTheDay[i]); notAllowedTimesTable->setVerticalHeaderItem(i, item); } for(int i=0; i<gt.rules.nHoursPerDay; i++) for(int j=0; j<gt.rules.nDaysPerWeek; j++){ QTableWidgetItem* item=new QTableWidgetItem(NO); item->setTextAlignment(Qt::AlignCenter); item->setFlags(Qt::ItemIsSelectable|Qt::ItemIsEnabled); colorItem(item); if(SHOW_TOOLTIPS_FOR_CONSTRAINTS_WITH_TABLES) item->setToolTip(gt.rules.daysOfTheWeek[j]+QString("\n")+gt.rules.hoursOfTheDay[i]); notAllowedTimesTable->setItem(i, j, item); } notAllowedTimesTable->resizeRowsToContents(); connect(notAllowedTimesTable->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(horizontalHeaderClicked(int))); connect(notAllowedTimesTable->verticalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(verticalHeaderClicked(int))); notAllowedTimesTable->setSelectionMode(QAbstractItemView::NoSelection); tableWidgetUpdateBug(notAllowedTimesTable); setStretchAvailabilityTableNicely(notAllowedTimesTable); }
AddConstraintBasicCompulsoryTimeForm::AddConstraintBasicCompulsoryTimeForm(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); }
AddConstraintTeachersMaxDaysPerWeekForm::AddConstraintTeachersMaxDaysPerWeekForm(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); updateMaxDaysSpinBox(); }
AddConstraintStudentsMaxHoursContinuouslyForm::AddConstraintStudentsMaxHoursContinuouslyForm(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); maxHoursSpinBox->setMinimum(1); maxHoursSpinBox->setMaximum(gt.rules.nHoursPerDay); maxHoursSpinBox->setValue(gt.rules.nHoursPerDay); }
AddConstraintTeachersMinGapsBetweenBuildingChangesForm::AddConstraintTeachersMinGapsBetweenBuildingChangesForm(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(); }
AddConstraintStudentsSetMaxBuildingChangesPerDayForm::AddConstraintStudentsSetMaxBuildingChangesPerDayForm(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); maxChangesSpinBox->setMinimum(0); maxChangesSpinBox->setMaximum(gt.rules.nHoursPerDay); maxChangesSpinBox->setValue(1); updateStudentsSetComboBox(); }
AddConstraintActivityPreferredStartingTimeForm::AddConstraintActivityPreferredStartingTimeForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); 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)); 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); for(int k=0; k<stg->subgroupsList.size(); k++){ StudentsSubgroup* sts=stg->subgroupsList[k]; studentsComboBox->addItem(sts->name); } } } studentsComboBox->setCurrentIndex(0); updatePeriodGroupBox(); updateActivitiesComboBox(); }
AddConstraintActivitiesMaxSimultaneousInSelectedTimeSlotsForm::AddConstraintActivitiesMaxSimultaneousInSelectedTimeSlotsForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); allActivitiesListWidget->setSelectionMode(QAbstractItemView::SingleSelection); selectedActivitiesListWidget->setSelectionMode(QAbstractItemView::SingleSelection); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); connect(selectedTimesTable, SIGNAL(itemClicked(QTableWidgetItem*)), this, SLOT(itemClicked(QTableWidgetItem*))); connect(setAllUnselectedPushButton, SIGNAL(clicked()), this, SLOT(setAllUnselected())); connect(setAllSelectedPushButton, SIGNAL(clicked()), this, SLOT(setAllSelected())); connect(allActivitiesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(addActivity())); connect(addAllActivitiesPushButton, SIGNAL(clicked()), this, SLOT(addAllActivities())); connect(selectedActivitiesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(removeActivity())); connect(clearPushButton, SIGNAL(clicked()), this, SLOT(clear())); 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); tabWidget->setCurrentIndex(0); maxSimultaneousSpinBox->setMinimum(0); maxSimultaneousSpinBox->setMaximum(MAX_ACTIVITIES); maxSimultaneousSpinBox->setValue(0); selectedTimesTable->setRowCount(gt.rules.nHoursPerDay); selectedTimesTable->setColumnCount(gt.rules.nDaysPerWeek); for(int j=0; j<gt.rules.nDaysPerWeek; j++){ QTableWidgetItem* item=new QTableWidgetItem(gt.rules.daysOfTheWeek[j]); selectedTimesTable->setHorizontalHeaderItem(j, item); } for(int i=0; i<gt.rules.nHoursPerDay; i++){ QTableWidgetItem* item=new QTableWidgetItem(gt.rules.hoursOfTheDay[i]); selectedTimesTable->setVerticalHeaderItem(i, item); } for(int i=0; i<gt.rules.nHoursPerDay; i++) for(int j=0; j<gt.rules.nDaysPerWeek; j++){ QTableWidgetItem* item=new QTableWidgetItem(NO); item->setTextAlignment(Qt::AlignCenter); item->setFlags(Qt::ItemIsSelectable | Qt::ItemIsEnabled); colorItem(item); if(SHOW_TOOLTIPS_FOR_CONSTRAINTS_WITH_TABLES) item->setToolTip(gt.rules.daysOfTheWeek[j]+QString("\n")+gt.rules.hoursOfTheDay[i]); selectedTimesTable->setItem(i, j, item); } selectedTimesTable->resizeRowsToContents(); //selectedTimesTable->resizeColumnsToContents(); connect(selectedTimesTable->horizontalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(horizontalHeaderClicked(int))); connect(selectedTimesTable->verticalHeader(), SIGNAL(sectionClicked(int)), this, SLOT(verticalHeaderClicked(int))); selectedTimesTable->setSelectionMode(QAbstractItemView::NoSelection); tableWidgetUpdateBug(selectedTimesTable); setStretchAvailabilityTableNicely(selectedTimesTable); //activities 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); 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); selectedActivitiesListWidget->clear(); selectedActivitiesList.clear(); filterChanged(); }
AddConstraintActivitiesOccupyMaxDifferentRoomsForm::AddConstraintActivitiesOccupyMaxDifferentRoomsForm(QWidget* parent): QDialog(parent) { setupUi(this); addConstraintPushButton->setDefault(true); allActivitiesListWidget->setSelectionMode(QAbstractItemView::SingleSelection); selectedActivitiesListWidget->setSelectionMode(QAbstractItemView::SingleSelection); connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addCurrentConstraint())); connect(closePushButton, SIGNAL(clicked()), this, SLOT(close())); connect(allActivitiesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(addActivity())); connect(addAllActivitiesPushButton, SIGNAL(clicked()), this, SLOT(addAllActivities())); connect(selectedActivitiesListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(removeActivity())); connect(clearPushButton, SIGNAL(clicked()), this, SLOT(clear())); 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); maxDifferentRoomsSpinBox->setMinimum(1); maxDifferentRoomsSpinBox->setMaximum(MAX_ROOMS); maxDifferentRoomsSpinBox->setValue(1); //activities 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); 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); selectedActivitiesListWidget->clear(); selectedActivitiesList.clear(); filterChanged(); }