Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddConstraintTeacherHomeRoomForm Class Reference

#include <addconstraintteacherhomeroomform.h>

List of all members.

Public Slots

void addConstraint ()

Public Member Functions

 AddConstraintTeacherHomeRoomForm (QWidget *parent)
 ~AddConstraintTeacherHomeRoomForm ()
void updateTeachersComboBox ()
void updateRoomsComboBox ()

Detailed Description

Definition at line 26 of file addconstraintteacherhomeroomform.h.


Constructor & Destructor Documentation

Definition at line 25 of file addconstraintteacherhomeroomform.cpp.

                                                                                 : QDialog(parent)
{
       setupUi(this);

       addConstraintPushButton->setDefault(true);

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

       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);

       QSize tmp1=teachersComboBox->minimumSizeHint();
       Q_UNUSED(tmp1);
       
       QSize tmp5=roomsComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);
       
       updateTeachersComboBox();
       updateRoomsComboBox();
}

Here is the call graph for this function:

Definition at line 47 of file addconstraintteacherhomeroomform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 67 of file addconstraintteacherhomeroomform.cpp.

{
       SpaceConstraint *ctr=NULL;

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

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

       int i=roomsComboBox->currentIndex();
       if(i<0 || roomsComboBox->count()<=0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid room"));
              return;
       }
       QString room=roomsComboBox->currentText();

       ctr=new ConstraintTeacherHomeRoom(weight, teacher, room);

       bool tmp2=gt.rules.addSpaceConstraint(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 - error ?"));
              delete ctr;
       }
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 58 of file addconstraintteacherhomeroomform.cpp.

{
       roomsComboBox->clear();
       for(int i=0; i<gt.rules.roomsList.size(); i++){
              Room* rm=gt.rules.roomsList[i];
              roomsComboBox->addItem(rm->name);
       }
}

Here is the caller graph for this function:

Definition at line 52 of file addconstraintteacherhomeroomform.cpp.

                                                             {
       teachersComboBox->clear();
       foreach(Teacher* tch, gt.rules.teachersList)
              teachersComboBox->addItem(tch->name);
}

Here is the caller graph for this function:


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