Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddConstraintSubjectPreferredRoomForm Class Reference

#include <addconstraintsubjectpreferredroomform.h>

List of all members.

Public Slots

void addConstraint ()

Public Member Functions

 AddConstraintSubjectPreferredRoomForm (QWidget *parent)
 ~AddConstraintSubjectPreferredRoomForm ()
void updateSubjectsComboBox ()
void updateRoomsComboBox ()

Detailed Description

Definition at line 26 of file addconstraintsubjectpreferredroomform.h.


Constructor & Destructor Documentation

Definition at line 25 of file addconstraintsubjectpreferredroomform.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 tmp3=subjectsComboBox->minimumSizeHint();
       Q_UNUSED(tmp3);

       QSize tmp5=roomsComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);
       
       updateSubjectsComboBox();
       updateRoomsComboBox();
}

Here is the call graph for this function:

Definition at line 47 of file addconstraintsubjectpreferredroomform.cpp.

Here is the call graph for this function:


Member Function Documentation

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

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

       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 ConstraintSubjectPreferredRoom(weight, subject, 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 61 of file addconstraintsubjectpreferredroomform.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 addconstraintsubjectpreferredroomform.cpp.

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

Here is the caller graph for this function:


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