Attacher: use the new strings in UI
* user-friendly mode names * tooltips
This commit is contained in:
parent
314617f16a
commit
cdc507fa36
|
@ -49,6 +49,7 @@
|
|||
#include <Mod/Part/App/PrimitiveFeature.h>
|
||||
#include <Mod/Part/App/DatumFeature.h>
|
||||
#include <Mod/PartDesign/App/Body.h>
|
||||
#include <Mod/Part/Gui/AttacherTexts.h>
|
||||
|
||||
#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<eRefType> hint)
|
||||
{
|
||||
QString result;
|
||||
for (std::set<eRefType>::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<QString> 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);
|
||||
|
|
Loading…
Reference in New Issue
Block a user