Show translated names in combobox.

--HG--
branch : develop
This commit is contained in:
Roman Telezhynskyi 2015-07-03 20:06:30 +03:00
parent fb71593e93
commit 1a67aafe05

View File

@ -155,10 +155,20 @@ void DialogTool::FillComboBoxCurves(QComboBox *box) const
obj->getType() == GOType::SplinePath) && obj->getMode() == Draw::Calculation)
{
const QSharedPointer<VAbstractCurve> curve = data->GeometricObject<VAbstractCurve>(i.key());
QString newName = curve->name();
int bias = 0;
if (qApp->TrVars()->VariablesToUser(newName, 0, curve->name(), bias))
{
list[newName] = i.key();
}
else
{
list[curve->name()] = i.key();
}
}
}
}
FillList(box, list);
}
@ -508,9 +518,7 @@ CrossCirclesPoint DialogTool::getCurrentCrossPoint(QComboBox *box) const
bool DialogTool::SetObject(const quint32 &id, QComboBox *box, const QString &toolTip)
{
SCASSERT(box != nullptr);
const QSharedPointer<VGObject> obj = data->GetGObject(id);
SCASSERT(obj.isNull() == false);
const qint32 index = box->findText(obj->name());
const qint32 index = box->findData(id);
if ( index != -1 )
{ // -1 for not found
box->setCurrentIndex(index);
@ -519,7 +527,7 @@ bool DialogTool::SetObject(const quint32 &id, QComboBox *box, const QString &too
}
else
{
qWarning()<<"Can't find object by name"<<obj->name();
qWarning()<<"Can't find object by id"<<id;
}
return false;
}
@ -832,10 +840,20 @@ void DialogTool::FillCombo(QComboBox *box, GOType gType, FillComboBox rule, cons
if (obj->getType() == gType && obj->getMode() == Draw::Calculation)
{
const QSharedPointer<GObject> arc = data->GeometricObject<GObject>(i.key());
QString newName = arc->name();
int bias = 0;
if (qApp->TrVars()->VariablesToUser(newName, 0, arc->name(), bias))
{
list[newName] = i.key();
}
else
{
list[arc->name()] = i.key();
}
}
}
}
else
{
if (i.key() != toolId)
@ -844,11 +862,21 @@ void DialogTool::FillCombo(QComboBox *box, GOType gType, FillComboBox rule, cons
if (obj->getType() == gType && obj->getMode() == Draw::Calculation)
{
const QSharedPointer<GObject> arc = data->GeometricObject<GObject>(i.key());
QString newName = arc->name();
int bias = 0;
if (qApp->TrVars()->VariablesToUser(newName, 0, arc->name(), bias))
{
list[newName] = i.key();
}
else
{
list[arc->name()] = i.key();
}
}
}
}
}
FillList(box, list);
box->blockSignals(false);