1
0
Fork 0
mirror of https://github.com/opentx/opentx.git synced 2025-07-17 13:25:20 +03:00

Curve index is correctly resetted when its type is changed

This commit is contained in:
bsongis 2014-07-21 20:23:56 +02:00
parent 62fca3f8b6
commit deed7fc20f
2 changed files with 24 additions and 1 deletions

View file

@ -216,7 +216,7 @@ CurveGroup::CurveGroup(QComboBox *curveTypeCB, QCheckBox *curveGVarCB, QComboBox
curveValueCB->setMaxVisibleItems(10);
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveTypeCB, SIGNAL(currentIndexChanged(int)), this, SLOT(typeChanged(int)));
connect(curveGVarCB, SIGNAL(stateChanged(int)), this, SLOT(gvarCBChanged(int)));
connect(curveValueCB, SIGNAL(currentIndexChanged(int)), this, SLOT(valuesChanged()));
connect(curveValueSB, SIGNAL(editingFinished()), this, SLOT(valuesChanged()));
@ -300,6 +300,28 @@ void CurveGroup::gvarCBChanged(int state)
}
}
void CurveGroup::typeChanged(int value)
{
if (!lock) {
switch (value) {
case 0:
curve = CurveReference(CurveReference::CURVE_REF_DIFF, 0);
break;
case 1:
curve = CurveReference(CurveReference::CURVE_REF_EXPO, 0);
break;
case 2:
curve = CurveReference(CurveReference::CURVE_REF_FUNC, 0);
break;
case 3:
curve = CurveReference(CurveReference::CURVE_REF_CUSTOM, 0);
break;
}
update();
}
}
void CurveGroup::valuesChanged()
{
if (!lock) {