Fixed issue #913. Unable to save changes for piece path if it doesn't contain a

point.
(grafted from 0cf04b80083754dc5ed7e54ed95be63b97a7503a)

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2018-12-20 17:54:54 +02:00
parent e23438347a
commit 5bed94c31b
3 changed files with 67 additions and 30 deletions

View File

@ -9,6 +9,7 @@
- [#905] Valentina crashes with error: This id is not unique. - [#905] Valentina crashes with error: This id is not unique.
- [#909] Valentina produces wrong united path. - [#909] Valentina produces wrong united path.
- [#912] Labels in inactive state return to initial color. - [#912] Labels in inactive state return to initial color.
- [#913] Unable to save changes for piece path if it doesn't contain a point.
# Version 0.6.1 October 23, 2018 # Version 0.6.1 October 23, 2018
- [#885] Regression. Broken support for multi size measurements. - [#885] Regression. Broken support for multi size measurements.

View File

@ -748,6 +748,8 @@ void DialogPiecePath::EvalWidth()
void DialogPiecePath::EvalWidthBefore() void DialogPiecePath::EvalWidthBefore()
{ {
labelEditFormula = ui->labelEditBefore; labelEditFormula = ui->labelEditBefore;
if (ui->comboBoxNodes->count() > 0)
{
const QString postfix = UnitsToStr(qApp->patternUnit(), true); const QString postfix = UnitsToStr(qApp->patternUnit(), true);
QString formula = ui->plainTextEditFormulaWidthBefore->toPlainText(); QString formula = ui->plainTextEditFormulaWidthBefore->toPlainText();
Eval(formula, m_flagFormulaBefore, ui->labelResultBefore, postfix, false, true); Eval(formula, m_flagFormulaBefore, ui->labelResultBefore, postfix, false, true);
@ -759,12 +761,21 @@ void DialogPiecePath::EvalWidthBefore()
} }
UpdateNodeSABefore(formula); UpdateNodeSABefore(formula);
}
else
{
ChangeColor(labelEditFormula, okColor);
ui->labelResultBefore->setText(tr("<Empty>"));
m_flagFormulaBefore = true;
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogPiecePath::EvalWidthAfter() void DialogPiecePath::EvalWidthAfter()
{ {
labelEditFormula = ui->labelEditAfter; labelEditFormula = ui->labelEditAfter;
if (ui->comboBoxNodes->count() > 0)
{
const QString postfix = UnitsToStr(qApp->patternUnit(), true); const QString postfix = UnitsToStr(qApp->patternUnit(), true);
QString formula = ui->plainTextEditFormulaWidthAfter->toPlainText(); QString formula = ui->plainTextEditFormulaWidthAfter->toPlainText();
Eval(formula, m_flagFormulaAfter, ui->labelResultAfter, postfix, false, true); Eval(formula, m_flagFormulaAfter, ui->labelResultAfter, postfix, false, true);
@ -776,6 +787,13 @@ void DialogPiecePath::EvalWidthAfter()
} }
UpdateNodeSAAfter(formula); UpdateNodeSAAfter(formula);
}
else
{
ChangeColor(labelEditFormula, okColor);
ui->labelResultAfter->setText(tr("<Empty>"));
m_flagFormulaAfter = true;
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------

View File

@ -2079,6 +2079,8 @@ void DialogSeamAllowance::EvalWidthBefore()
if (uiTabPaths->checkBoxSeams->isChecked()) if (uiTabPaths->checkBoxSeams->isChecked())
{ {
labelEditFormula = uiTabPaths->labelEditBefore; labelEditFormula = uiTabPaths->labelEditBefore;
if (uiTabPaths->comboBoxNodes->count() > 0)
{
const QString postfix = UnitsToStr(qApp->patternUnit(), true); const QString postfix = UnitsToStr(qApp->patternUnit(), true);
const QString formula = uiTabPaths->plainTextEditFormulaWidthBefore->toPlainText(); const QString formula = uiTabPaths->plainTextEditFormulaWidthBefore->toPlainText();
Eval(formula, flagFormulaBefore, uiTabPaths->labelResultBefore, postfix, false, true); Eval(formula, flagFormulaBefore, uiTabPaths->labelResultBefore, postfix, false, true);
@ -2087,6 +2089,13 @@ void DialogSeamAllowance::EvalWidthBefore()
UpdateNodeSABefore(formulaSABefore); UpdateNodeSABefore(formulaSABefore);
EnableDefButton(uiTabPaths->pushButtonDefBefore, formulaSABefore); EnableDefButton(uiTabPaths->pushButtonDefBefore, formulaSABefore);
} }
else
{
ChangeColor(labelEditFormula, okColor);
uiTabPaths->labelResultBefore->setText(tr("<Empty>"));
flagFormulaBefore = true;
}
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
@ -2095,6 +2104,8 @@ void DialogSeamAllowance::EvalWidthAfter()
if (uiTabPaths->checkBoxSeams->isChecked()) if (uiTabPaths->checkBoxSeams->isChecked())
{ {
labelEditFormula = uiTabPaths->labelEditAfter; labelEditFormula = uiTabPaths->labelEditAfter;
if (uiTabPaths->comboBoxNodes->count() > 0)
{
const QString postfix = UnitsToStr(qApp->patternUnit(), true); const QString postfix = UnitsToStr(qApp->patternUnit(), true);
const QString formula = uiTabPaths->plainTextEditFormulaWidthAfter->toPlainText(); const QString formula = uiTabPaths->plainTextEditFormulaWidthAfter->toPlainText();
Eval(formula, flagFormulaAfter, uiTabPaths->labelResultAfter, postfix, false, true); Eval(formula, flagFormulaAfter, uiTabPaths->labelResultAfter, postfix, false, true);
@ -2103,6 +2114,13 @@ void DialogSeamAllowance::EvalWidthAfter()
UpdateNodeSAAfter(formulaSAAfter); UpdateNodeSAAfter(formulaSAAfter);
EnableDefButton(uiTabPaths->pushButtonDefAfter, formulaSAAfter); EnableDefButton(uiTabPaths->pushButtonDefAfter, formulaSAAfter);
} }
else
{
ChangeColor(labelEditFormula, okColor);
uiTabPaths->labelResultAfter->setText(tr("<Empty>"));
flagFormulaAfter = true;
}
}
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------