Back to index

fet  5.18.0
Public Slots | Public Member Functions | Private Attributes
ModifyConstraintTeacherHomeRoomForm Class Reference

#include <modifyconstraintteacherhomeroomform.h>

Collaboration diagram for ModifyConstraintTeacherHomeRoomForm:
Collaboration graph
[legend]

List of all members.

Public Slots

void ok ()
void cancel ()

Public Member Functions

 ModifyConstraintTeacherHomeRoomForm (QWidget *parent, ConstraintTeacherHomeRoom *ctr)
 ~ModifyConstraintTeacherHomeRoomForm ()
void updateTeachersComboBox ()
void updateRoomsComboBox ()

Private Attributes

ConstraintTeacherHomeRoom_ctr

Detailed Description

Definition at line 26 of file modifyconstraintteacherhomeroomform.h.


Constructor & Destructor Documentation

Definition at line 23 of file modifyconstraintteacherhomeroomform.cpp.

                                                                                                                       : QDialog(parent)
{
       setupUi(this);

       okPushButton->setDefault(true);

       connect(cancelPushButton, SIGNAL(clicked()), this, SLOT(cancel()));
       connect(okPushButton, SIGNAL(clicked()), this, SLOT(ok()));

       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);

       QSize tmp1=teachersComboBox->minimumSizeHint();
       Q_UNUSED(tmp1);
       
       QSize tmp5=roomsComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);
       
       this->_ctr=ctr;
       
       weightLineEdit->setText(CustomFETString::number(ctr->weightPercentage));

       updateTeachersComboBox();
       updateRoomsComboBox();
}

Here is the call graph for this function:

Definition at line 49 of file modifyconstraintteacherhomeroomform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 82 of file modifyconstraintteacherhomeroomform.cpp.

{
       this->close();
}

Here is the caller graph for this function:

Definition at line 87 of file modifyconstraintteacherhomeroomform.cpp.

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

       this->_ctr->weightPercentage=weight;
       this->_ctr->roomName=room;
       this->_ctr->teacherName=teacher;

       gt.rules.internalStructureComputed=false;
       setRulesModifiedAndOtherThings(&gt.rules);
       
       this->close();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 67 of file modifyconstraintteacherhomeroomform.cpp.

{
       int i=0, j=-1;
       roomsComboBox->clear();
       for(int k=0; k<gt.rules.roomsList.size(); k++){
              Room* rm=gt.rules.roomsList[k];
              roomsComboBox->addItem(rm->name);
              if(rm->name==this->_ctr->roomName)
                     j=i;
              i++;
       }
       assert(j>=0);
       roomsComboBox->setCurrentIndex(j);
}

Here is the caller graph for this function:

Definition at line 54 of file modifyconstraintteacherhomeroomform.cpp.

                                                                {
       teachersComboBox->clear();
       int i=0, j=-1;
       for(int k=0; k<gt.rules.teachersList.size(); k++, i++){
              Teacher* tch=gt.rules.teachersList[k];
              teachersComboBox->addItem(tch->name);
              if(tch->name==this->_ctr->teacherName)
                     j=i;
       }
       assert(j>=0);
       teachersComboBox->setCurrentIndex(j);
}

Here is the caller graph for this function:


Member Data Documentation

Definition at line 29 of file modifyconstraintteacherhomeroomform.h.


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