Back to index

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

#include <modifyroomform.h>

List of all members.

Public Slots

void ok ()
void cancel ()

Public Member Functions

 ModifyRoomForm (QWidget *parent, const QString &initialRoomName, const QString &initialRoomBuilding, int initialRoomCapacity)
 ~ModifyRoomForm ()

Private Attributes

QString _initialRoomName
QString _initialRoomType
QString _initialRoomBuilding
int _initialRoomCapacity

Detailed Description

Definition at line 27 of file modifyroomform.h.


Constructor & Destructor Documentation

ModifyRoomForm::ModifyRoomForm ( QWidget *  parent,
const QString &  initialRoomName,
const QString &  initialRoomBuilding,
int  initialRoomCapacity 
)

Definition at line 22 of file modifyroomform.cpp.

                                                                                                                                          : QDialog(parent)
{
       setupUi(this);
       
       okPushButton->setDefault(true);

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

       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);

       QSize tmp5=buildingsComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);
       
       capacitySpinBox->setMinimum(1);
       capacitySpinBox->setMaximum(MAX_ROOM_CAPACITY);
       capacitySpinBox->setValue(MAX_ROOM_CAPACITY);

       this->_initialRoomName=initialRoomName;
       this->_initialRoomBuilding=initialRoomBuilding;
       this->_initialRoomCapacity=initialRoomCapacity;
       capacitySpinBox->setValue(initialRoomCapacity);

       nameLineEdit->setText(initialRoomName);
       nameLineEdit->selectAll();
       nameLineEdit->setFocus();
       
       int i=0;
       int j=-1;
       buildingsComboBox->clear();
       buildingsComboBox->addItem("");
       if(initialRoomBuilding=="")
              j=i;
       i++;
       for(int k=0; k<gt.rules.buildingsList.size(); k++, i++){
              buildingsComboBox->addItem(gt.rules.buildingsList.at(k)->name);
              if(gt.rules.buildingsList.at(k)->name==initialRoomBuilding)
                     j=i;
       }
       assert(j>=0);
       buildingsComboBox->setCurrentIndex(j);
}

Here is the call graph for this function:

Definition at line 66 of file modifyroomform.cpp.

Here is the call graph for this function:


Member Function Documentation

void ModifyRoomForm::cancel ( ) [slot]

Definition at line 71 of file modifyroomform.cpp.

{
       this->close();
}

Here is the caller graph for this function:

void ModifyRoomForm::ok ( ) [slot]

Definition at line 76 of file modifyroomform.cpp.

{
       if(nameLineEdit->text().isEmpty()){
              QMessageBox::information(this, tr("FET information"), tr("Incorrect name"));
              return;
       }
       if(buildingsComboBox->currentIndex()<0){
              QMessageBox::information(this, tr("FET information"), tr("Incorrect building"));
              return;
       }
       if(this->_initialRoomName!=nameLineEdit->text() && gt.rules.searchRoom(nameLineEdit->text())>=0){
              QMessageBox::information(this, tr("FET information"), tr("Name existing - please choose another"));
              return;
       }
       
       bool t=gt.rules.modifyRoom(this->_initialRoomName, nameLineEdit->text()/*, typesComboBox->currentText()*/, buildingsComboBox->currentText(), capacitySpinBox->value());
       assert(t);
       
       this->close();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 32 of file modifyroomform.h.

Definition at line 33 of file modifyroomform.h.

Definition at line 30 of file modifyroomform.h.

Definition at line 31 of file modifyroomform.h.


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