Back to index

fet  5.18.0
Public Slots | Public Member Functions
AddStudentsYearForm Class Reference

#include <addstudentsyearform.h>

List of all members.

Public Slots

void addStudentsYear ()

Public Member Functions

 AddStudentsYearForm (QWidget *parent)
 ~AddStudentsYearForm ()

Detailed Description

Definition at line 27 of file addstudentsyearform.h.


Constructor & Destructor Documentation

Definition at line 22 of file addstudentsyearform.cpp.

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

       connect(addStudentsYearPushButton, SIGNAL(clicked()), this, SLOT(addStudentsYear()));
       connect(closePushButton, SIGNAL(clicked()), this, SLOT(close()));

       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);
       
       nameLineEdit->selectAll();
       nameLineEdit->setFocus();

       numberSpinBox->setMaximum(MAX_ROOM_CAPACITY);
       numberSpinBox->setMinimum(0);
       numberSpinBox->setValue(0);
}

Here is the call graph for this function:

Definition at line 42 of file addstudentsyearform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 47 of file addstudentsyearform.cpp.

{
       if(nameLineEdit->text().isEmpty()){
              QMessageBox::information(this, tr("FET information"), tr("Incorrect name"));
              return;
       }

       StudentsSet* ss=gt.rules.searchStudentsSet(nameLineEdit->text());
       if(ss!=NULL){
              if(ss->type==STUDENTS_SUBGROUP){
                     QMessageBox::information( this, tr("Year insertion dialog"),
                            tr("This name is taken for a subgroup - please consider another name"));
                     return;
              }
              else if(ss->type==STUDENTS_GROUP){
                     QMessageBox::information( this, tr("Year insertion dialog"),
                            tr("This name is taken for a group - please consider another name"));
                     return;
              }
              else if(ss->type==STUDENTS_YEAR){
                     QMessageBox::information( this, tr("Year insertion dialog"),
                            tr("This name is taken for a year - please consider another name"));
                     return;
              }
              else
                     assert(0);
       }

       StudentsYear* sy=new StudentsYear();
       sy->name=nameLineEdit->text();
       sy->numberOfStudents=numberSpinBox->value();
       
       if(gt.rules.searchYear(sy->name) >=0 ){
              QMessageBox::information( this, tr("Year insertion dialog"),
              tr("Could not insert item. Must be a duplicate"));
              delete sy;
       }
       else{
              bool tmp=gt.rules.addYear(sy);
              assert(tmp);

              QMessageBox::information(this, tr("Year insertion dialog"),
                     tr("Year added. You might want to divide it into sections - this is done in the years "
                     "dialog - button 'Divide year ...', or by manually adding groups and subgroups in the groups or subgroups menus\n\n"
                     " Important note: if you plan to use option 'divide', please try to use it only once for each year at the beginning, because"
                     " a second use of option 'divide' for the same year will remove all activities and constraints referring to old groups and subgroups"
                     " from this year."
                     ));
       }

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

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: