Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddConstraintStudentsSetHomeRoomForm Class Reference

#include <addconstraintstudentssethomeroomform.h>

List of all members.

Public Slots

void addConstraint ()

Public Member Functions

 AddConstraintStudentsSetHomeRoomForm (QWidget *parent)
 ~AddConstraintStudentsSetHomeRoomForm ()
void updateStudentsComboBox ()
void updateRoomsComboBox ()

Detailed Description

Definition at line 26 of file addconstraintstudentssethomeroomform.h.


Constructor & Destructor Documentation

Definition at line 25 of file addconstraintstudentssethomeroomform.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 tmp2=studentsComboBox->minimumSizeHint();
       Q_UNUSED(tmp2);
       
       QSize tmp5=roomsComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);

       updateStudentsComboBox();
       updateRoomsComboBox();
}

Here is the call graph for this function:

Definition at line 47 of file addconstraintstudentssethomeroomform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 77 of file addconstraintstudentssethomeroomform.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 students=studentsComboBox->currentText();
       assert(gt.rules.searchStudentsSet(students)!=NULL);

       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 ConstraintStudentsSetHomeRoom(weight, students, 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 68 of file addconstraintstudentssethomeroomform.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 addconstraintstudentssethomeroomform.cpp.

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


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