Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddConstraintTeacherMinDaysPerWeekForm Class Reference

#include <addconstraintteachermindaysperweekform.h>

List of all members.

Public Slots

void addCurrentConstraint ()

Public Member Functions

 AddConstraintTeacherMinDaysPerWeekForm (QWidget *parent)
 ~AddConstraintTeacherMinDaysPerWeekForm ()
void updateMinDaysSpinBox ()
void updateTeachersComboBox ()

Detailed Description

Definition at line 26 of file addconstraintteachermindaysperweekform.h.


Constructor & Destructor Documentation

Definition at line 25 of file addconstraintteachermindaysperweekform.cpp.

                                                                                             : 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);
       
       updateMinDaysSpinBox();
       updateTeachersComboBox();
}

Here is the call graph for this function:

Definition at line 44 of file addconstraintteachermindaysperweekform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 63 of file addconstraintteachermindaysperweekform.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) - it has to be 100%"));
              return;
       }

       int min_days=minDaysSpinBox->value();

       QString teacher_name=teachersComboBox->currentText();
       int teacher_ID=gt.rules.searchTeacher(teacher_name);
       if(teacher_ID<0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid teacher"));
              return;
       }

       ctr=new ConstraintTeacherMinDaysPerWeek(weight, min_days, teacher_name);

       bool tmp2=gt.rules.addTimeConstraint(ctr);
       if(tmp2)
              LongTextMessageBox::information(this, tr("FET information"),
                     tr("Constraint added:")+"\n\n"+ctr->getDetailedDescription(gt.rules));
       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 57 of file addconstraintteachermindaysperweekform.cpp.

                                                                 {
       minDaysSpinBox->setMinimum(1);
       minDaysSpinBox->setMaximum(gt.rules.nDaysPerWeek);
       minDaysSpinBox->setValue(1);
}

Here is the caller graph for this function:

Definition at line 49 of file addconstraintteachermindaysperweekform.cpp.

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

Here is the caller graph for this function:


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