Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddConstraintActivitiesEndStudentsDayForm Class Reference

#include <addconstraintactivitiesendstudentsdayform.h>

List of all members.

Public Slots

void addConstraint ()

Public Member Functions

 AddConstraintActivitiesEndStudentsDayForm (QWidget *parent)
 ~AddConstraintActivitiesEndStudentsDayForm ()
void updateTeachersComboBox ()
void updateStudentsComboBox ()
void updateSubjectsComboBox ()
void updateActivityTagsComboBox ()

Detailed Description

Definition at line 26 of file addconstraintactivitiesendstudentsdayform.h.


Constructor & Destructor Documentation

Definition at line 26 of file addconstraintactivitiesendstudentsdayform.cpp.

                                                                                                   : QDialog(parent)
{
       setupUi(this);

       addConstraintPushButton->setDefault(true);

       connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addConstraint()));
       connect(closePushButton, SIGNAL(clicked()), this, SLOT(close()));

       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);
       
       updateTeachersComboBox();
       updateStudentsComboBox();
       updateSubjectsComboBox();
       updateActivityTagsComboBox();
}

Here is the call graph for this function:

Definition at line 53 of file addconstraintactivitiesendstudentsdayform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 102 of file addconstraintactivitiesendstudentsdayform.cpp.

{
       TimeConstraint *ctr=NULL;

       double weight;
       QString tmp=weightLineEdit->text();
       weight_sscanf(tmp, "%lf", &weight);
       if(weight<0.0 || weight>100.0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid weight (percentage)"));
              return;
       }
       if(weight!=100.0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid weight (percentage) - must be 100%"));
              return;
       }

       QString teacher=teachersComboBox->currentText();
       if(teacher!="")
              assert(gt.rules.searchTeacher(teacher)>=0);

       QString students=studentsComboBox->currentText();
       if(students!="")
              assert(gt.rules.searchStudentsSet(students)!=NULL);

       QString subject=subjectsComboBox->currentText();
       if(subject!="")
              assert(gt.rules.searchSubject(subject)>=0);
              
       QString activityTag=activityTagsComboBox->currentText();
       if(activityTag!="")
              assert(gt.rules.searchActivityTag(activityTag)>=0);
              
       ctr=new ConstraintActivitiesEndStudentsDay(weight, teacher, students, subject, activityTag);

       bool tmp2=gt.rules.addTimeConstraint(ctr);
       if(tmp2){
              QString s=tr("Constraint added:");
              s+="\n\n";
              s+=ctr->getDetailedDescription(gt.rules);
              LongTextMessageBox::information(this, tr("FET information"), s);
       }
       else{
              QMessageBox::warning(this, tr("FET information"),
                     tr("Constraint NOT added - please report error"));
              delete ctr;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 93 of file addconstraintactivitiesendstudentsdayform.cpp.

                                                                          {
       activityTagsComboBox->clear();
       activityTagsComboBox->addItem("");
       for(int i=0; i<gt.rules.activityTagsList.size(); i++){
              ActivityTag* s=gt.rules.activityTagsList[i];
              activityTagsComboBox->addItem(s->name);
       }
}

Here is the caller graph for this function:

Definition at line 67 of file addconstraintactivitiesendstudentsdayform.cpp.

                                                                      {
       studentsComboBox->clear();
       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);
                     }
              }
       }
}

Here is the caller graph for this function:

Definition at line 84 of file addconstraintactivitiesendstudentsdayform.cpp.

                                                                      {
       subjectsComboBox->clear();
       subjectsComboBox->addItem("");
       for(int i=0; i<gt.rules.subjectsList.size(); i++){
              Subject* s=gt.rules.subjectsList[i];
              subjectsComboBox->addItem(s->name);
       }
}

Here is the caller graph for this function:

Definition at line 58 of file addconstraintactivitiesendstudentsdayform.cpp.

                                                                      {
       teachersComboBox->clear();
       teachersComboBox->addItem("");
       for(int i=0; i<gt.rules.teachersList.size(); i++){
              Teacher* t=gt.rules.teachersList[i];
              teachersComboBox->addItem(t->name);
       }
}

Here is the caller graph for this function:


The documentation for this class was generated from the following files: