Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddConstraintSubjectActivityTagPreferredRoomForm Class Reference

#include <addconstraintsubjectactivitytagpreferredroomform.h>

List of all members.

Public Slots

void addConstraint ()

Public Member Functions

 AddConstraintSubjectActivityTagPreferredRoomForm (QWidget *parent)
 ~AddConstraintSubjectActivityTagPreferredRoomForm ()
void updateSubjectsComboBox ()
void updateActivityTagsComboBox ()
void updateRoomsComboBox ()

Detailed Description

Definition at line 26 of file addconstraintsubjectactivitytagpreferredroomform.h.


Constructor & Destructor Documentation

Definition at line 25 of file addconstraintsubjectactivitytagpreferredroomform.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 tmp4=activityTagsComboBox->minimumSizeHint();
       Q_UNUSED(tmp4);
       
       QSize tmp5=roomsComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);
       
       updateSubjectsComboBox();
       updateActivityTagsComboBox();
       updateRoomsComboBox();
}

Here is the call graph for this function:

Definition at line 50 of file addconstraintsubjectactivitytagpreferredroomform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 82 of file addconstraintsubjectactivitytagpreferredroomform.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=activityTagsComboBox->currentIndex();
       if(i<0 || activityTagsComboBox->count()<=0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid activity tag"));
              return;
       }
       QString activityTag=activityTagsComboBox->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 ConstraintSubjectActivityTagPreferredRoom(weight, subject, activityTag, 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 64 of file addconstraintsubjectactivitytagpreferredroomform.cpp.

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

Here is the caller graph for this function:

Definition at line 73 of file addconstraintsubjectactivitytagpreferredroomform.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 55 of file addconstraintsubjectactivitytagpreferredroomform.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: