Fix bug in dialog Seam allowance tool.

When create a piece and call a context menu Valentina blocks creating because
of wrong formulas.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2017-11-15 15:25:05 +02:00
parent a0643e5712
commit 037d1daaaa

View File

@ -969,8 +969,8 @@ void DialogSeamAllowance::NodeChanged(int index)
} }
else else
{ {
uiTabPaths->plainTextEditFormulaWidthBefore->setPlainText(""); uiTabPaths->plainTextEditFormulaWidthBefore->setPlainText(currentSeamAllowance);
uiTabPaths->plainTextEditFormulaWidthAfter->setPlainText(""); uiTabPaths->plainTextEditFormulaWidthAfter->setPlainText(currentSeamAllowance);
uiTabPaths->comboBoxAngle->setCurrentIndex(-1); uiTabPaths->comboBoxAngle->setCurrentIndex(-1);
} }
uiTabPaths->comboBoxAngle->blockSignals(false); uiTabPaths->comboBoxAngle->blockSignals(false);
@ -2037,6 +2037,8 @@ void DialogSeamAllowance::EvalWidth()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::EvalWidthBefore() void DialogSeamAllowance::EvalWidthBefore()
{
if (uiTabPaths->checkBoxSeams->isChecked())
{ {
labelEditFormula = uiTabPaths->labelEditBefore; labelEditFormula = uiTabPaths->labelEditBefore;
const QString postfix = UnitsToStr(qApp->patternUnit(), true); const QString postfix = UnitsToStr(qApp->patternUnit(), true);
@ -2047,9 +2049,12 @@ void DialogSeamAllowance::EvalWidthBefore()
UpdateNodeSABefore(formulaSABefore); UpdateNodeSABefore(formulaSABefore);
EnableDefButton(uiTabPaths->pushButtonDefBefore, formulaSABefore); EnableDefButton(uiTabPaths->pushButtonDefBefore, formulaSABefore);
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::EvalWidthAfter() void DialogSeamAllowance::EvalWidthAfter()
{
if (uiTabPaths->checkBoxSeams->isChecked())
{ {
labelEditFormula = uiTabPaths->labelEditAfter; labelEditFormula = uiTabPaths->labelEditAfter;
const QString postfix = UnitsToStr(qApp->patternUnit(), true); const QString postfix = UnitsToStr(qApp->patternUnit(), true);
@ -2060,6 +2065,7 @@ void DialogSeamAllowance::EvalWidthAfter()
UpdateNodeSAAfter(formulaSAAfter); UpdateNodeSAAfter(formulaSAAfter);
EnableDefButton(uiTabPaths->pushButtonDefAfter, formulaSAAfter); EnableDefButton(uiTabPaths->pushButtonDefAfter, formulaSAAfter);
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::FXWidth() void DialogSeamAllowance::FXWidth()
@ -2117,21 +2123,27 @@ void DialogSeamAllowance::WidthChanged()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::WidthBeforeChanged() void DialogSeamAllowance::WidthBeforeChanged()
{
if (uiTabPaths->checkBoxSeams->isChecked())
{ {
labelEditFormula = uiTabPaths->labelEditBefore; labelEditFormula = uiTabPaths->labelEditBefore;
labelResultCalculation = uiTabPaths->labelResultBefore; labelResultCalculation = uiTabPaths->labelResultBefore;
const QString postfix = UnitsToStr(qApp->patternUnit(), true); const QString postfix = UnitsToStr(qApp->patternUnit(), true);
ValFormulaChanged(flagFormulaBefore, uiTabPaths->plainTextEditFormulaWidthBefore, m_timerWidthBefore, postfix); ValFormulaChanged(flagFormulaBefore, uiTabPaths->plainTextEditFormulaWidthBefore, m_timerWidthBefore, postfix);
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::WidthAfterChanged() void DialogSeamAllowance::WidthAfterChanged()
{
if (uiTabPaths->checkBoxSeams->isChecked())
{ {
labelEditFormula = uiTabPaths->labelEditAfter; labelEditFormula = uiTabPaths->labelEditAfter;
labelResultCalculation = uiTabPaths->labelResultAfter; labelResultCalculation = uiTabPaths->labelResultAfter;
const QString postfix = UnitsToStr(qApp->patternUnit(), true); const QString postfix = UnitsToStr(qApp->patternUnit(), true);
ValFormulaChanged(flagFormulaAfter, uiTabPaths->plainTextEditFormulaWidthAfter, m_timerWidthAfter, postfix); ValFormulaChanged(flagFormulaAfter, uiTabPaths->plainTextEditFormulaWidthAfter, m_timerWidthAfter, postfix);
} }
}
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogSeamAllowance::DeployWidthFormulaTextEdit() void DialogSeamAllowance::DeployWidthFormulaTextEdit()