Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddRoomForm Class Reference

#include <addroomform.h>

List of all members.

Public Slots

void addRoom ()
void help ()

Public Member Functions

 AddRoomForm (QWidget *parent)
 ~AddRoomForm ()

Detailed Description

Definition at line 27 of file addroomform.h.


Constructor & Destructor Documentation

AddRoomForm::AddRoomForm ( QWidget *  parent)

Definition at line 24 of file addroomform.cpp.

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

       connect(closePushButton, SIGNAL(clicked()), this, SLOT(close()));
       connect(helpPushButton, SIGNAL(clicked()), this, SLOT(help()));
       connect(addRoomPushButton, SIGNAL(clicked()), this, SLOT(addRoom()));

       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);

       QSize tmp5=buildingsComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);
       
       buildingsComboBox->clear();
       buildingsComboBox->addItem("");
       for(int i=0; i<gt.rules.buildingsList.size(); i++)
              buildingsComboBox->addItem(gt.rules.buildingsList.at(i)->name);
              
       capacitySpinBox->setMinimum(1);
       capacitySpinBox->setMaximum(MAX_ROOM_CAPACITY);
       capacitySpinBox->setValue(MAX_ROOM_CAPACITY);
}

Here is the call graph for this function:

Definition at line 50 of file addroomform.cpp.

Here is the call graph for this function:


Member Function Documentation

void AddRoomForm::addRoom ( ) [slot]

Definition at line 55 of file addroomform.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;
       }
       Room* rm=new Room();
       rm->name=nameLineEdit->text();
       rm->building=buildingsComboBox->currentText();
       rm->capacity=capacitySpinBox->value();
       if(!gt.rules.addRoom(rm)){
              QMessageBox::information(this, tr("Room insertion dialog"),
                     tr("Could not insert item. Must be a duplicate"));
              delete rm;
       }
       else{
              QMessageBox::information(this, tr("Room insertion dialog"),
                     tr("Room added"));
       }

       nameLineEdit->selectAll();
       nameLineEdit->setFocus();
}

Here is the call graph for this function:

Here is the caller graph for this function:

void AddRoomForm::help ( ) [slot]

Definition at line 83 of file addroomform.cpp.

{
       QString s;
       
       s=tr("It is advisable to generate the timetable without the rooms (or without rooms' constraints), then, if a solution is possible, to add rooms or rooms' constraints");
        
       s+="\n\n";
       
       s+=tr("Please note that each room can hold a single activity at a specified period. If you"
        " have a very large room, which can hold more activities at one time, please add more rooms,"
        " representing this larger room");
        
       LongTextMessageBox::largeInformation(this, tr("FET - help on adding room(s)"), s);
}

Here is the call graph for this function:

Here is the caller graph for this function:


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