Back to index

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

#include <constraintactivitiessamestartingdayform.h>

List of all members.

Public Slots

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

Public Member Functions

 ConstraintActivitiesSameStartingDayForm (QWidget *parent)
 ~ConstraintActivitiesSameStartingDayForm ()
void refreshConstraintsListWidget ()
bool filterOk (TimeConstraint *ctr)

Public Attributes

TimeConstraintsList visibleConstraintsList

Detailed Description

Definition at line 26 of file constraintactivitiessamestartingdayform.h.


Constructor & Destructor Documentation

Definition at line 30 of file constraintactivitiessamestartingdayform.cpp.

                                                                                               : QDialog(parent)
{
       setupUi(this);

       currentConstraintTextEdit->setReadOnly(true);

       modifyConstraintPushButton->setDefault(true);
       
       constraintsListWidget->setSelectionMode(QAbstractItemView::SingleSelection);

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

       centerWidgetOnScreen(this);
       restoreFETDialogGeometry(this);
       
       this->refreshConstraintsListWidget();
}

Here is the call graph for this function:

Definition at line 54 of file constraintactivitiessamestartingdayform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 101 of file constraintactivitiessamestartingdayform.cpp.

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

       this->refreshConstraintsListWidget();
       
       constraintsListWidget->setCurrentRow(constraintsListWidget->count()-1);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 87 of file constraintactivitiessamestartingdayform.cpp.

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

Here is the caller graph for this function:

Definition at line 79 of file constraintactivitiessamestartingdayform.cpp.

{
       if(ctr->type==CONSTRAINT_ACTIVITIES_SAME_STARTING_DAY)
              return true;
       else
              return false;
}

Here is the caller graph for this function:

Definition at line 180 of file constraintactivitiessamestartingdayform.cpp.

{
       QString s;

       s+=tr("IMPORTANT: after adding such constraints, it is necessary (otherwise generation might be impossible) to remove redundant constraints"
       " min days between activities. If you are sure that you don't have redundant constraints, you can skip this step, but it doesn't hurt to do it as a precaution."
       " Also, you don't have to do that after each added constraint, but only once after adding more constraints of this type."
       " Please read Help/Important tips - tip number 2 for details");

       LongTextMessageBox::largeInformation(this, tr("FET help"), s);
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 112 of file constraintactivitiessamestartingdayform.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);

       ModifyConstraintActivitiesSameStartingDayForm form(this, (ConstraintActivitiesSameStartingDay*)ctr);
       setParentAndOtherThings(&form, this);
       form.exec();

       refreshConstraintsListWidget();

       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 59 of file constraintactivitiessamestartingdayform.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)){
                     QString s;
                     s=ctr->getDescription(gt.rules);
                     visibleConstraintsList.append(ctr);
                     constraintsListWidget->addItem(s);
              }
       }

       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 142 of file constraintactivitiessamestartingdayform.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

Definition at line 29 of file constraintactivitiessamestartingdayform.h.


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