Back to index

fet  5.18.0
Public Slots | Public Member Functions | Public Attributes
ConstraintStudentsActivityTagMaxHoursDailyForm Class Reference

#include <constraintstudentsactivitytagmaxhoursdailyform.h>

List of all members.

Public Slots

void constraintChanged (int index)
void addConstraint ()
void modifyConstraint ()
void removeConstraint ()
void help ()
void filterChanged ()

Public Member Functions

 ConstraintStudentsActivityTagMaxHoursDailyForm (QWidget *parent)
 ~ConstraintStudentsActivityTagMaxHoursDailyForm ()
bool filterOk (TimeConstraint *ctr)

Public Attributes

TimeConstraintsList visibleConstraintsList

Detailed Description

Definition at line 26 of file constraintstudentsactivitytagmaxhoursdailyform.h.


Constructor & Destructor Documentation

Definition at line 32 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

                                                                                                             : QDialog(parent)
{
       setupUi(this);

       currentConstraintTextEdit->setReadOnly(true);

       modifyConstraintPushButton->setDefault(true);

       constraintsListWidget->setSelectionMode(QAbstractItemView::SingleSelection);

       connect(constraintsListWidget, SIGNAL(currentRowChanged(int)), this, SLOT(constraintChanged(int)));
       connect(addConstraintPushButton, SIGNAL(clicked()), this, SLOT(addConstraint()));
       connect(closePushButton, SIGNAL(clicked()), this, SLOT(close()));
       connect(removeConstraintPushButton, SIGNAL(clicked()), this, SLOT(removeConstraint()));
       connect(modifyConstraintPushButton, SIGNAL(clicked()), this, SLOT(modifyConstraint()));
       connect(constraintsListWidget, SIGNAL(itemDoubleClicked(QListWidgetItem*)), this, SLOT(modifyConstraint()));
       connect(activityTagsComboBox, SIGNAL(activated(QString)), this, SLOT(filterChanged()));
       connect(helpPushButton, SIGNAL(clicked()), this, SLOT(help()));

       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);

       QSize tmp4=activityTagsComboBox->minimumSizeHint();
       Q_UNUSED(tmp4);
       
       activityTagsComboBox->clear();
       activityTagsComboBox->addItem("");
       foreach(ActivityTag* at, gt.rules.activityTagsList)
              activityTagsComboBox->addItem(at->name);

       this->filterChanged();
}

Here is the call graph for this function:

Definition at line 65 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 110 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

{
       AddConstraintStudentsActivityTagMaxHoursDailyForm form(this);
       setParentAndOtherThings(&form, this);
       form.exec();

       filterChanged();
       
       constraintsListWidget->setCurrentRow(constraintsListWidget->count()-1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 98 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

{
       if(index<0){
              currentConstraintTextEdit->setPlainText("");
              return;
       }
       assert(index<this->visibleConstraintsList.size());
       TimeConstraint* ctr=this->visibleConstraintsList.at(index);
       assert(ctr!=NULL);
       currentConstraintTextEdit->setPlainText(ctr->getDetailedDescription(gt.rules));
}

Here is the caller graph for this function:

Definition at line 80 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

{
       this->visibleConstraintsList.clear();
       constraintsListWidget->clear();
       for(int i=0; i<gt.rules.timeConstraintsList.size(); i++){
              TimeConstraint* ctr=gt.rules.timeConstraintsList[i];
              if(filterOk(ctr)){
                     visibleConstraintsList.append(ctr);
                     constraintsListWidget->addItem(ctr->getDescription(gt.rules));
              }
       }
       
       if(constraintsListWidget->count()>0)
              constraintsListWidget->setCurrentRow(0);
       else
              this->constraintChanged(-1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 70 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

{
       if(ctr->type==CONSTRAINT_STUDENTS_ACTIVITY_TAG_MAX_HOURS_DAILY){
              ConstraintStudentsActivityTagMaxHoursDaily* c=(ConstraintStudentsActivityTagMaxHoursDaily*) ctr;
              return (c->activityTagName==activityTagsComboBox->currentText() || activityTagsComboBox->currentText()=="");
       }
       else
              return false;
}

Here is the caller graph for this function:

Definition at line 189 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

Here is the caller graph for this function:

Definition at line 121 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

{
       int valv=constraintsListWidget->verticalScrollBar()->value();
       int valh=constraintsListWidget->horizontalScrollBar()->value();

       int i=constraintsListWidget->currentRow();
       if(i<0){
              QMessageBox::information(this, tr("FET information"), tr("Invalid selected constraint"));
              return;
       }
       TimeConstraint* ctr=this->visibleConstraintsList.at(i);

       ModifyConstraintStudentsActivityTagMaxHoursDailyForm form(this, (ConstraintStudentsActivityTagMaxHoursDaily*)ctr);
       setParentAndOtherThings(&form, this);
       form.exec();

       filterChanged();

       constraintsListWidget->verticalScrollBar()->setValue(valv);
       constraintsListWidget->horizontalScrollBar()->setValue(valh);

       if(i>=constraintsListWidget->count())
              i=constraintsListWidget->count()-1;

       if(i>=0)
              constraintsListWidget->setCurrentRow(i);
       else
              this->constraintChanged(-1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 151 of file constraintstudentsactivitytagmaxhoursdailyform.cpp.

{
       int i=constraintsListWidget->currentRow();
       if(i<0){
              QMessageBox::information(this, tr("FET information"), tr("Invalid selected constraint"));
              return;
       }
       TimeConstraint* ctr=this->visibleConstraintsList.at(i);
       QString s;
       s=tr("Remove constraint?");
       s+="\n\n";
       s+=ctr->getDetailedDescription(gt.rules);
       
       QListWidgetItem* item;

       switch( LongTextMessageBox::confirmation( this, tr("FET confirmation"),
              s, tr("Yes"), tr("No"), 0, 0, 1 ) ){
       case 0: // The user clicked the OK button or pressed Enter
              gt.rules.removeTimeConstraint(ctr);
              
              visibleConstraintsList.removeAt(i);
              constraintsListWidget->setCurrentRow(-1);
              item=constraintsListWidget->takeItem(i);
              delete item;
              
              break;
       case 1: // The user clicked the Cancel button or pressed Escape
              break;
       }
       
       if(i>=constraintsListWidget->count())
              i=constraintsListWidget->count()-1;
       if(i>=0)
              constraintsListWidget->setCurrentRow(i);
       else
              this->constraintChanged(-1);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation


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