Back to index

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

#include <changemindaysselectivelyform.h>

List of all members.

Public Slots

void ok ()
void cancel ()

Public Member Functions

 ChangeMinDaysSelectivelyForm (QWidget *parent)
 ~ChangeMinDaysSelectivelyForm ()

Public Attributes

double oldWeight
int oldDays
int oldConsecutive
int oldNActs
double newWeight
int newDays
int newConsecutive

Detailed Description

Definition at line 28 of file changemindaysselectivelyform.h.


Constructor & Destructor Documentation

Definition at line 26 of file changemindaysselectivelyform.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=oldConsecutiveComboBox->minimumSizeHint();
       Q_UNUSED(tmp5);
       QSize tmp6=newConsecutiveComboBox->minimumSizeHint();
       Q_UNUSED(tmp6);
       
       oldConsecutiveComboBox->clear();
       oldConsecutiveComboBox->addItem(tr("Any"));
       oldConsecutiveComboBox->addItem(tr("Yes"));
       oldConsecutiveComboBox->addItem(tr("No"));
       oldConsecutiveComboBox->setCurrentIndex(0);
       
       oldDaysSpinBox->setMinimum(-1);
       oldDaysSpinBox->setMaximum(gt.rules.nDaysPerWeek);
       oldDaysSpinBox->setValue(-1);

       newConsecutiveComboBox->clear();
       newConsecutiveComboBox->addItem(tr("No change"));
       newConsecutiveComboBox->addItem(tr("Yes"));
       newConsecutiveComboBox->addItem(tr("No"));
       newConsecutiveComboBox->setCurrentIndex(0);
       
       newDaysSpinBox->setMinimum(-1);
       newDaysSpinBox->setMaximum(gt.rules.nDaysPerWeek);
       newDaysSpinBox->setValue(-1);
       
       oldNActsSpinBox->setMinimum(-1);
       oldNActsSpinBox->setMaximum(MAX_SPLIT_OF_AN_ACTIVITY);
       oldNActsSpinBox->setValue(-1);
}

Here is the call graph for this function:

Definition at line 68 of file changemindaysselectivelyform.cpp.

Here is the call graph for this function:


Member Function Documentation

Definition at line 123 of file changemindaysselectivelyform.cpp.

{
       this->reject();
}

Here is the caller graph for this function:

Definition at line 74 of file changemindaysselectivelyform.cpp.

{
       enum {ANY=0, YES=1, NO=2};
       enum {NOCHANGE=0};

       oldWeight=oldDays=oldConsecutive=oldNActs=-2;
       newWeight=newDays=newConsecutive=-2;

       QString oldWeightS=oldWeightLineEdit->text();
       weight_sscanf(oldWeightS, "%lf", &oldWeight);
       if(!(oldWeight==-1 || (oldWeight>=0.0 && oldWeight<=100.0))){
              QMessageBox::warning(this, tr("FET warning"), tr("Old weight must be -1 or both >=0 and <=100"));
              return;
       }
       
       QString newWeightS=newWeightLineEdit->text();
       weight_sscanf(newWeightS, "%lf", &newWeight);
       if(!(newWeight==-1 || (newWeight>=0.0 && newWeight<=100.0))){
              QMessageBox::warning(this, tr("FET warning"), tr("New weight must be -1 or both >=0 and <=100"));
              return;
       }
       
       oldDays=oldDaysSpinBox->value();
       if(!(oldDays==-1 || (oldDays>=1 && oldDays<=gt.rules.nDaysPerWeek))){
              QMessageBox::warning(this, tr("FET warning"), tr("Old min days must be -1 or both >=1 and <=n_days_per_week"));
              return;
       }
       
       newDays=newDaysSpinBox->value();
       if(!(newDays==-1 || (newDays>=1 && newDays<=gt.rules.nDaysPerWeek))){
              QMessageBox::warning(this, tr("FET warning"), tr("New min days must be -1 or both >=1 and <=n_days_per_week"));
              return;
       }
       
       oldConsecutive=oldConsecutiveComboBox->currentIndex();
       assert(oldConsecutive>=0 && oldConsecutive<=2);

       newConsecutive=newConsecutiveComboBox->currentIndex();
       assert(newConsecutive>=0 && newConsecutive<=2);

       oldNActs=oldNActsSpinBox->value();
       if(!(oldNActs==-1 || oldNActs>=1)){
              QMessageBox::warning(this, tr("FET warning"), tr("Old n_acts must be -1 or >=1"));
              return;
       }
       
       this->accept();
}

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

Definition at line 42 of file changemindaysselectivelyform.h.

Definition at line 41 of file changemindaysselectivelyform.h.

Definition at line 40 of file changemindaysselectivelyform.h.

Definition at line 37 of file changemindaysselectivelyform.h.

Definition at line 36 of file changemindaysselectivelyform.h.

Definition at line 38 of file changemindaysselectivelyform.h.

Definition at line 35 of file changemindaysselectivelyform.h.


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