Fixed issue "Rotation tool - Cannot edit formula after creation".

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2016-05-24 13:29:13 +03:00
parent b7b1ea3db7
commit 66cc34ed64
2 changed files with 20 additions and 11 deletions

View File

@ -48,7 +48,8 @@ DialogRotation::DialogRotation(const VContainer *data, const quint32 &toolId, QW
formulaAngle(), formulaAngle(),
formulaBaseHeightAngle(0), formulaBaseHeightAngle(0),
objects(), objects(),
stage1(true) stage1(true),
m_suffix()
{ {
ui->setupUi(this); ui->setupUi(this);
@ -126,12 +127,13 @@ void DialogRotation::SetAngle(const QString &value)
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
QString DialogRotation::GetSuffix() const QString DialogRotation::GetSuffix() const
{ {
return ui->lineEditSuffix->text(); return m_suffix;
} }
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogRotation::SetSuffix(const QString &value) void DialogRotation::SetSuffix(const QString &value)
{ {
m_suffix = value;
ui->lineEditSuffix->setText(value); ui->lineEditSuffix->setText(value);
} }
@ -288,6 +290,8 @@ void DialogRotation::SuffixChanged()
return; return;
} }
else else
{
if (m_suffix != suffix)
{ {
QRegularExpression rx(NameRegExp()); QRegularExpression rx(NameRegExp());
const QStringList uniqueNames = data->AllUniqueNames(); const QStringList uniqueNames = data->AllUniqueNames();
@ -303,6 +307,7 @@ void DialogRotation::SuffixChanged()
} }
} }
} }
}
flagName = true; flagName = true;
ChangeColor(ui->labelSuffix, okColor); ChangeColor(ui->labelSuffix, okColor);
@ -328,6 +333,8 @@ void DialogRotation::ShowVisualization()
//--------------------------------------------------------------------------------------------------------------------- //---------------------------------------------------------------------------------------------------------------------
void DialogRotation::SaveData() void DialogRotation::SaveData()
{ {
m_suffix = ui->lineEditSuffix->text();
formulaAngle = ui->plainTextEditFormula->toPlainText(); formulaAngle = ui->plainTextEditFormula->toPlainText();
formulaAngle.replace("\n", " "); formulaAngle.replace("\n", " ");

View File

@ -98,6 +98,8 @@ private:
bool stage1; bool stage1;
QString m_suffix;
void EvalAngle(); void EvalAngle();
}; };