Refactoring.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-06-02 16:56:49 +03:00
parent ab01a5b064
commit 48ad6cb678

View File

@ -123,36 +123,36 @@ void DialogEditWrongFormula::ValChenged(int row)
{
if (item->text()==data->HeightName())
{
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->height()).arg(tr("Height"));
const QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->height()).arg(tr("Height"));
ui->labelDescription->setText(desc);
}
if (item->text()==data->SizeName())
{
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->size()).arg(tr("Size"));
const QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->size()).arg(tr("Size"));
ui->labelDescription->setText(desc);
}
return;
}
if (ui->radioButtonStandardTable->isChecked())
{
QString name = qApp->VarFromUser(item->text());
QSharedPointer<VMeasurement> stable = data->GetVariable<VMeasurement>(name);
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(name))
const QString name = qApp->VarFromUser(item->text());
const QSharedPointer<VMeasurement> stable = data->GetVariable<VMeasurement>(name);
const QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(name))
.arg(stable->GetGuiText());
ui->labelDescription->setText(desc);
return;
}
if (ui->radioButtonIncrements->isChecked())
{
QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(item->text());
QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(item->text()))
const QSharedPointer<VIncrement> incr = data->GetVariable<VIncrement>(item->text());
const QString desc = QString("%1(%2) - %3").arg(item->text()).arg(data->GetTableValue(item->text()))
.arg(incr->GetDescription());
ui->labelDescription->setText(desc);
return;
}
if (ui->radioButtonLengthLine->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
const QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VLengthLine>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Line length"));
ui->labelDescription->setText(desc);
@ -160,7 +160,7 @@ void DialogEditWrongFormula::ValChenged(int row)
}
if (ui->radioButtonLengthArc->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
const QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VArcLength>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Arc length"));
ui->labelDescription->setText(desc);
@ -168,7 +168,7 @@ void DialogEditWrongFormula::ValChenged(int row)
}
if (ui->radioButtonLengthSpline->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
const QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VSplineLength>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Curve length"));
ui->labelDescription->setText(desc);
@ -176,7 +176,7 @@ void DialogEditWrongFormula::ValChenged(int row)
}
if (ui->radioButtonAngleLine->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
const QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VLineAngle>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Line Angle"));
ui->labelDescription->setText(desc);
@ -184,7 +184,7 @@ void DialogEditWrongFormula::ValChenged(int row)
}
if (ui->radioButtonRadiusesArcs->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
const QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VArcRadius>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Arc radius"));
ui->labelDescription->setText(desc);
@ -192,7 +192,7 @@ void DialogEditWrongFormula::ValChenged(int row)
}
if (ui->radioButtonAnglesArcs->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
const QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VArcAngle>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Arc angle"));
ui->labelDescription->setText(desc);
@ -200,7 +200,7 @@ void DialogEditWrongFormula::ValChenged(int row)
}
if (ui->radioButtonAnglesCurves->isChecked())
{
QString desc = QString("%1(%2) - %3").arg(item->text())
const QString desc = QString("%1(%2) - %3").arg(item->text())
.arg(*data->GetVariable<VCurveAngle>(qApp->VarFromUser(item->text()))->GetValue())
.arg(tr("Curve angle"));
ui->labelDescription->setText(desc);