diff --git a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp index b7790d303..d5f794222 100644 --- a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp @@ -49,6 +49,7 @@ #include #include #include +#include #include "ReferenceSelection.h" #include "Utils.h" @@ -232,50 +233,13 @@ TaskDatumParameters::TaskDatumParameters(ViewProviderDatum *DatumView,QWidget *p DatumView->setPickable(false); } -QString getShTypeText(eRefType type) -{ - //get rid of flags in type - type = eRefType(type & (rtFlagHasPlacement - 1)); - - const char* eRefTypeStrings[] = { - QT_TR_NOOP("Any"), - QT_TR_NOOP("Vertex"), - QT_TR_NOOP("Edge"), - QT_TR_NOOP("Face"), - - QT_TR_NOOP("Line"), - QT_TR_NOOP("Curve"), - QT_TR_NOOP("Circle"), - QT_TR_NOOP("Conic"), - QT_TR_NOOP("Ellipse"), - QT_TR_NOOP("Parabola"), - QT_TR_NOOP("Hyperbola"), - - QT_TR_NOOP("Plane"), - QT_TR_NOOP("Sphere"), - QT_TR_NOOP("Revolve"), - QT_TR_NOOP("Cylinder"), - QT_TR_NOOP("Torus"), - QT_TR_NOOP("Cone"), - // - QT_TR_NOOP("Object"), - QT_TR_NOOP("Solid"), - QT_TR_NOOP("Wire"), - NULL - }; - - if (type >= 0 && type < rtDummy_numberOfShapeTypes) - if (eRefTypeStrings[int(type)]) - return QObject::tr(eRefTypeStrings[int(type)]); - throw Base::Exception("getShTypeText: type value is wrong, or a string is missing in the list"); -} const QString makeHintText(std::set hint) { QString result; for (std::set::const_iterator t = hint.begin(); t != hint.end(); t++) { QString tText; - tText = getShTypeText(*t); + tText = AttacherGui::getShapeTypeText(*t); result += QString::fromLatin1(result.size() == 0 ? "" : "/") + tText; } @@ -691,12 +655,14 @@ void TaskDatumParameters::updateListOfModes(eMapMode curMode) if (modesInList.size()>0) { for (size_t i = 0 ; i < modesInList.size() ; ++i){ eMapMode mmode = modesInList[i]; - ui->listOfModes->addItem(QString::fromLatin1(AttachEngine::eMapModeStrings[mmode])); + std::vector mstr = AttacherGui::getUIStrings(pcDatum->attacher().getTypeId(),mmode); + ui->listOfModes->addItem(mstr[0]); + QListWidgetItem* item = ui->listOfModes->item(i); + item->setToolTip(mstr[1]); if (mmode == curMode) iSelect = ui->listOfModes->item(i); if (mmode == suggMode){ //make it bold - QListWidgetItem* item = ui->listOfModes->item(i); assert (item); QFont fnt = item->font(); fnt.setBold(true);