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.
- [#909] Valentina produces wrong united path.
- [#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
- [#885] Regression. Broken support for multi size measurements.

View File

@ -748,34 +748,52 @@ void DialogPiecePath::EvalWidth()
void DialogPiecePath::EvalWidthBefore()
{
labelEditFormula = ui->labelEditBefore;
const QString postfix = UnitsToStr(qApp->patternUnit(), true);
QString formula = ui->plainTextEditFormulaWidthBefore->toPlainText();
Eval(formula, m_flagFormulaBefore, ui->labelResultBefore, postfix, false, true);
formula = GetFormulaSAWidthBefore();
if (formula != currentSeamAllowance)
if (ui->comboBoxNodes->count() > 0)
{
ui->pushButtonDefBefore->setEnabled(true);
}
const QString postfix = UnitsToStr(qApp->patternUnit(), true);
QString formula = ui->plainTextEditFormulaWidthBefore->toPlainText();
Eval(formula, m_flagFormulaBefore, ui->labelResultBefore, postfix, false, true);
UpdateNodeSABefore(formula);
formula = GetFormulaSAWidthBefore();
if (formula != currentSeamAllowance)
{
ui->pushButtonDefBefore->setEnabled(true);
}
UpdateNodeSABefore(formula);
}
else
{
ChangeColor(labelEditFormula, okColor);
ui->labelResultBefore->setText(tr("<Empty>"));
m_flagFormulaBefore = true;
}
}
//---------------------------------------------------------------------------------------------------------------------
void DialogPiecePath::EvalWidthAfter()
{
labelEditFormula = ui->labelEditAfter;
const QString postfix = UnitsToStr(qApp->patternUnit(), true);
QString formula = ui->plainTextEditFormulaWidthAfter->toPlainText();
Eval(formula, m_flagFormulaAfter, ui->labelResultAfter, postfix, false, true);
formula = GetFormulaSAWidthAfter();
if (formula != currentSeamAllowance)
if (ui->comboBoxNodes->count() > 0)
{
ui->pushButtonDefAfter->setEnabled(true);
}
const QString postfix = UnitsToStr(qApp->patternUnit(), true);
QString formula = ui->plainTextEditFormulaWidthAfter->toPlainText();
Eval(formula, m_flagFormulaAfter, ui->labelResultAfter, postfix, false, true);
UpdateNodeSAAfter(formula);
formula = GetFormulaSAWidthAfter();
if (formula != currentSeamAllowance)
{
ui->pushButtonDefAfter->setEnabled(true);
}
UpdateNodeSAAfter(formula);
}
else
{
ChangeColor(labelEditFormula, okColor);
ui->labelResultAfter->setText(tr("<Empty>"));
m_flagFormulaAfter = true;
}
}
//---------------------------------------------------------------------------------------------------------------------

View File

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