Back to index

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

#include <modifyconstrainttwoactivitiesorderedform.h>

Collaboration diagram for ModifyConstraintTwoActivitiesOrderedForm:
Collaboration graph
[legend]

List of all members.

Public Slots

void constraintChanged ()
void ok ()
void cancel ()
void filterChanged ()

Public Member Functions

 ModifyConstraintTwoActivitiesOrderedForm (QWidget *parent, ConstraintTwoActivitiesOrdered *ctr)
 ~ModifyConstraintTwoActivitiesOrderedForm ()
void updateActivitiesComboBox ()
bool filterOk (Activity *a)

Public Attributes

ConstraintTwoActivitiesOrdered_ctr

Private Attributes

QList< int > firstActivitiesList
QList< int > secondActivitiesList

Detailed Description

Definition at line 26 of file modifyconstrainttwoactivitiesorderedform.h.


Constructor & Destructor Documentation

Definition at line 23 of file modifyconstrainttwoactivitiesorderedform.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=firstActivitiesComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);
       QSize tmp6=secondActivitiesComboBox->minimumSizeHint();
       Q_UNUSED(tmp6);
       
       firstActivitiesComboBox->setMaximumWidth(maxRecommendedWidth(this));
       secondActivitiesComboBox->setMaximumWidth(maxRecommendedWidth(this));
       
       this->_ctr=ctr;
       
       weightLineEdit->setText(CustomFETString::number(ctr->weightPercentage));

       updateActivitiesComboBox();

       constraintChanged();
}

Here is the call graph for this function:

Definition at line 52 of file modifyconstrainttwoactivitiesorderedform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 164 of file modifyconstrainttwoactivitiesorderedform.cpp.

{
       this->close();
}

Here is the caller graph for this function:

Definition at line 113 of file modifyconstrainttwoactivitiesorderedform.cpp.

{
}

Here is the caller graph for this function:

Definition at line 66 of file modifyconstrainttwoactivitiesorderedform.cpp.

Here is the call graph for this function:

Definition at line 57 of file modifyconstrainttwoactivitiesorderedform.cpp.

{
       Q_UNUSED(act);

       int ok=true;
       
       return ok;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 117 of file modifyconstrainttwoactivitiesorderedform.cpp.

{
       double weight;
       QString tmp=weightLineEdit->text();
       weight_sscanf(tmp, "%lf", &weight);
       if(weight<0.0 || weight>100.0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid weight (percentage)"));
              return;
       }

       int tmp2=firstActivitiesComboBox->currentIndex();
       assert(tmp2<gt.rules.activitiesList.size());
       assert(tmp2<firstActivitiesList.size());
       if(tmp2<0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid first activity"));
              return;
       }
       int fid=firstActivitiesList.at(tmp2);
       
       int tmp3=secondActivitiesComboBox->currentIndex();
       assert(tmp3<gt.rules.activitiesList.size());
       assert(tmp3<secondActivitiesList.size());
       if(tmp3<0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid second activity"));
              return;
       }
       int sid=secondActivitiesList.at(tmp3);

       if(sid==fid){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Same activities - impossible"));
              return;
       }
       
       this->_ctr->weightPercentage=weight;
       this->_ctr->firstActivityId=fid;
       this->_ctr->secondActivityId=sid;
       
       gt.rules.internalStructureComputed=false;
       setRulesModifiedAndOtherThings(&gt.rules);

       this->close();
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 71 of file modifyconstrainttwoactivitiesorderedform.cpp.

                                                                       {
       firstActivitiesComboBox->clear();
       firstActivitiesList.clear();

       secondActivitiesComboBox->clear();
       secondActivitiesList.clear();
       
       int i=0, j=-1;
       for(int k=0; k<gt.rules.activitiesList.size(); k++){
              Activity* act=gt.rules.activitiesList[k];
              if(filterOk(act)){
                     firstActivitiesComboBox->addItem(act->getDescription(gt.rules));
                     this->firstActivitiesList.append(act->id);

                     if(act->id==this->_ctr->firstActivityId)
                            j=i;
                            
                     i++;
              }
       }
       //assert(j>=0); only first time
       firstActivitiesComboBox->setCurrentIndex(j);

       i=0, j=-1;
       for(int k=0; k<gt.rules.activitiesList.size(); k++){
              Activity* act=gt.rules.activitiesList[k];
              if(filterOk(act)){
                     secondActivitiesComboBox->addItem(act->getDescription(gt.rules));
                     this->secondActivitiesList.append(act->id);

                     if(act->id==this->_ctr->secondActivityId)
                            j=i;
                            
                     i++;
              }
       }
       //assert(j>=0); only first time
       secondActivitiesComboBox->setCurrentIndex(j);

       constraintChanged();
}

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 modifyconstrainttwoactivitiesorderedform.h.

Definition at line 47 of file modifyconstrainttwoactivitiesorderedform.h.

Definition at line 48 of file modifyconstrainttwoactivitiesorderedform.h.


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