diff --git a/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp b/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp index a3188e0a7..ea75e9f19 100644 --- a/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp +++ b/src/libs/vtools/dialogs/tools/dialogpiecepath.cpp @@ -348,7 +348,7 @@ void DialogPiecePath::NodeChanged(int index) QString w2Formula = node.GetFormulaSAAfter(); if (w2Formula != currentSeamAllowance) { - ui->pushButtonDefBefore->setEnabled(true); + ui->pushButtonDefAfter->setEnabled(true); } if (w2Formula.length() > 80)// increase height if needed. { @@ -458,12 +458,20 @@ void DialogPiecePath::PassmarkChanged(int index) void DialogPiecePath::ReturnDefBefore() { ui->plainTextEditFormulaWidthBefore->setPlainText(currentSeamAllowance); + if (QPushButton* button = qobject_cast(sender())) + { + button->setEnabled(false); + } } //--------------------------------------------------------------------------------------------------------------------- void DialogPiecePath::ReturnDefAfter() { ui->plainTextEditFormulaWidthAfter->setPlainText(currentSeamAllowance); + if (QPushButton* button = qobject_cast(sender())) + { + button->setEnabled(false); + } } //--------------------------------------------------------------------------------------------------------------------- @@ -571,6 +579,11 @@ void DialogPiecePath::EvalWidthBefore() bool flagFormula = false; // fake flag Eval(formula, flagFormula, ui->labelResultBefore, postfix, false, true); + if (formula != currentSeamAllowance) + { + ui->pushButtonDefBefore->setEnabled(true); + } + UpdateNodeSABefore(GetFormulaSAWidthBefore()); } @@ -583,6 +596,11 @@ void DialogPiecePath::EvalWidthAfter() bool flagFormula = false; // fake flag Eval(formula, flagFormula, ui->labelResultAfter, postfix, false, true); + if (formula != currentSeamAllowance) + { + ui->pushButtonDefAfter->setEnabled(true); + } + UpdateNodeSABefore(GetFormulaSAWidthAfter()); } diff --git a/src/libs/vtools/dialogs/tools/dialogpiecepath.ui b/src/libs/vtools/dialogs/tools/dialogpiecepath.ui index 553af560c..51812884f 100644 --- a/src/libs/vtools/dialogs/tools/dialogpiecepath.ui +++ b/src/libs/vtools/dialogs/tools/dialogpiecepath.ui @@ -326,7 +326,7 @@ - false + true