From e96aafd6e1d72aed848dcd7595819c8bf0418e7a Mon Sep 17 00:00:00 2001 From: wmayer Date: Sat, 15 Apr 2017 12:58:35 +0200 Subject: [PATCH] do not use translated text for icon names --- .../PartDesign/Gui/TaskDatumParameters.cpp | 2 +- src/Mod/PartDesign/Gui/ViewProviderDatum.cpp | 26 ++++++++++++------- src/Mod/PartDesign/Gui/ViewProviderDatum.h | 1 + 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp index 55371fd648..29d4b76553 100644 --- a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp @@ -69,7 +69,7 @@ using namespace Attacher; TaskDatumParameters::TaskDatumParameters(ViewProviderDatum *ViewProvider,QWidget *parent) : PartGui::TaskAttacher(ViewProvider, parent, QString::fromLatin1("PartDesign_") + ViewProvider->datumType, - ViewProvider->datumType + tr(" parameters")) + ViewProvider->datumText + tr(" parameters")) { Gui::Selection().addSelectionGate(new NoDependentsSelection(ViewProvider->getObject())); ViewProvider->setPickable(false); diff --git a/src/Mod/PartDesign/Gui/ViewProviderDatum.cpp b/src/Mod/PartDesign/Gui/ViewProviderDatum.cpp index 2b6f7a8f4a..747e5b64e5 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderDatum.cpp +++ b/src/Mod/PartDesign/Gui/ViewProviderDatum.cpp @@ -116,14 +116,22 @@ void ViewProviderDatum::attach(App::DocumentObject *obj) // TODO remove this field (2015-09-08, Fat-Zer) App::DocumentObject* o = getObject(); - if (o->getTypeId() == PartDesign::Plane::getClassTypeId()) - datumType = QObject::tr("Plane"); - else if (o->getTypeId() == PartDesign::Line::getClassTypeId()) - datumType = QObject::tr("Line"); - else if (o->getTypeId() == PartDesign::Point::getClassTypeId()) - datumType = QObject::tr("Point"); - else if (o->getTypeId() == PartDesign::CoordinateSystem::getClassTypeId()) - datumType = QObject::tr("CoordinateSystem"); + if (o->getTypeId() == PartDesign::Plane::getClassTypeId()) { + datumType = QString::fromLatin1("Plane"); + datumText = QObject::tr("Plane"); + } + else if (o->getTypeId() == PartDesign::Line::getClassTypeId()) { + datumType = QString::fromLatin1("Line"); + datumText = QObject::tr("Line"); + } + else if (o->getTypeId() == PartDesign::Point::getClassTypeId()) { + datumType = QString::fromLatin1("Point"); + datumText = QObject::tr("Point"); + } + else if (o->getTypeId() == PartDesign::CoordinateSystem::getClassTypeId()) { + datumType = QString::fromLatin1("CoordinateSystem"); + datumText = QObject::tr("Coordinate System"); + } SoShapeHints* hints = new SoShapeHints(); hints->shapeType.setValue(SoShapeHints::UNKNOWN_SHAPE_TYPE); @@ -221,7 +229,7 @@ bool ViewProviderDatum::isSelectable(void) const void ViewProviderDatum::setupContextMenu(QMenu* menu, QObject* receiver, const char* member) { QAction* act; - act = menu->addAction(QObject::tr("Edit datum ") + datumType, receiver, member); + act = menu->addAction(QObject::tr("Edit datum"), receiver, member); act->setData(QVariant((int)ViewProvider::Default)); } diff --git a/src/Mod/PartDesign/Gui/ViewProviderDatum.h b/src/Mod/PartDesign/Gui/ViewProviderDatum.h index a38065d50c..ec306ff602 100644 --- a/src/Mod/PartDesign/Gui/ViewProviderDatum.h +++ b/src/Mod/PartDesign/Gui/ViewProviderDatum.h @@ -85,6 +85,7 @@ public: /// The datum type (Plane, Line or Point) // TODO remove this attribute (2015-09-08, Fat-Zer) QString datumType; + QString datumText; /** * Computes appropriate bounding box for the given list of objects to be passed to setExtents ()