Back to index

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

#include <modifyconstraintthreeactivitiesgroupedform.h>

Collaboration diagram for ModifyConstraintThreeActivitiesGroupedForm:
Collaboration graph
[legend]

List of all members.

Public Slots

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

Public Member Functions

 ModifyConstraintThreeActivitiesGroupedForm (QWidget *parent, ConstraintThreeActivitiesGrouped *ctr)
 ~ModifyConstraintThreeActivitiesGroupedForm ()
void updateActivitiesComboBox ()
bool filterOk (Activity *a)

Public Attributes

ConstraintThreeActivitiesGrouped_ctr

Private Attributes

QList< int > firstActivitiesList
QList< int > secondActivitiesList
QList< int > thirdActivitiesList

Detailed Description

Definition at line 26 of file modifyconstraintthreeactivitiesgroupedform.h.


Constructor & Destructor Documentation

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

       updateActivitiesComboBox();
}

Here is the call graph for this function:

Definition at line 53 of file modifyconstraintthreeactivitiesgroupedform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 189 of file modifyconstraintthreeactivitiesgroupedform.cpp.

{
       this->close();
}

Here is the caller graph for this function:

Definition at line 67 of file modifyconstraintthreeactivitiesgroupedform.cpp.

Here is the call graph for this function:

Definition at line 58 of file modifyconstraintthreeactivitiesgroupedform.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 131 of file modifyconstraintthreeactivitiesgroupedform.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);

       int tmp4=thirdActivitiesComboBox->currentIndex();
       assert(tmp4<gt.rules.activitiesList.size());
       assert(tmp4<thirdActivitiesList.size());
       if(tmp4<0){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Invalid third activity"));
              return;
       }
       int tid=thirdActivitiesList.at(tmp4);

       if(sid==fid || sid==tid || fid==tid){
              QMessageBox::warning(this, tr("FET information"),
                     tr("Same activities - impossible"));
              return;
       }
       
       this->_ctr->weightPercentage=weight;
       this->_ctr->firstActivityId=fid;
       this->_ctr->secondActivityId=sid;
       this->_ctr->thirdActivityId=tid;
       
       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 72 of file modifyconstraintthreeactivitiesgroupedform.cpp.

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

       secondActivitiesComboBox->clear();
       secondActivitiesList.clear();

       thirdActivitiesComboBox->clear();
       thirdActivitiesList.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);

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

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

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

Definition at line 47 of file modifyconstraintthreeactivitiesgroupedform.h.

Definition at line 48 of file modifyconstraintthreeactivitiesgroupedform.h.

Definition at line 49 of file modifyconstraintthreeactivitiesgroupedform.h.


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