Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddConstraintTeachersMinHoursDailyForm Class Reference

#include <addconstraintteachersminhoursdailyform.h>

List of all members.

Public Slots

void constraintChanged ()
void addCurrentConstraint ()
void on_allowEmptyDaysCheckBox_toggled ()

Public Member Functions

 AddConstraintTeachersMinHoursDailyForm (QWidget *parent)
 ~AddConstraintTeachersMinHoursDailyForm ()
void updateMinHoursSpinBox ()

Detailed Description

Definition at line 26 of file addconstraintteachersminhoursdailyform.h.


Constructor & Destructor Documentation

Definition at line 25 of file addconstraintteachersminhoursdailyform.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);
       
       updateMinHoursSpinBox();
       
       constraintChanged();
}

Here is the call graph for this function:

Definition at line 42 of file addconstraintteachersminhoursdailyform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 57 of file addconstraintteachersminhoursdailyform.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;
       }

       if(!allowEmptyDaysCheckBox->isChecked()){
              QMessageBox::warning(this, tr("FET information"), tr("Allow empty days check box must be checked. If you need to not allow empty days for the teachers, "
                     "please use the constraint teachers min days per week"));
              return;
       }

       int min_hours=minHoursSpinBox->value();

       ctr=new ConstraintTeachersMinHoursDaily(weight, min_hours, allowEmptyDaysCheckBox->isChecked());

       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 53 of file addconstraintteachersminhoursdailyform.cpp.

{
}

Here is the caller graph for this function:

Definition at line 96 of file addconstraintteachersminhoursdailyform.cpp.

{
       bool k=allowEmptyDaysCheckBox->isChecked();

       if(!k){
              allowEmptyDaysCheckBox->setChecked(true);
              QMessageBox::information(this, tr("FET information"), tr("This check box must remain checked. If you really need to not allow empty days for the teachers,"
                     " please use constraint teachers min days per week"));
       }
}

Definition at line 47 of file addconstraintteachersminhoursdailyform.cpp.

                                                                  {
       minHoursSpinBox->setMinimum(2);
       minHoursSpinBox->setMaximum(gt.rules.nHoursPerDay);
       minHoursSpinBox->setValue(2);
}

Here is the caller graph for this function:


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