From 4a1a1480ce1e1f8dbae1d8f1289429239f56e011 Mon Sep 17 00:00:00 2001 From: DeepSOIC Date: Thu, 21 Apr 2016 03:30:59 +0300 Subject: [PATCH] Attacher: list ref. combinations in UI --- src/Mod/Part/Gui/AttacherTexts.cpp | 14 ++++++++++++++ src/Mod/Part/Gui/AttacherTexts.h | 3 +++ src/Mod/PartDesign/Gui/TaskDatumParameters.cpp | 4 +++- 3 files changed, 20 insertions(+), 1 deletion(-) diff --git a/src/Mod/Part/Gui/AttacherTexts.cpp b/src/Mod/Part/Gui/AttacherTexts.cpp index 5990971a9454..71a6708a9772 100644 --- a/src/Mod/Part/Gui/AttacherTexts.cpp +++ b/src/Mod/Part/Gui/AttacherTexts.cpp @@ -342,4 +342,18 @@ QString getShapeTypeText(eRefType type) throw Base::Exception("getShTypeText: type value is wrong, or a string is missing in the list"); } +QStringList getRefListForMode(AttachEngine &attacher, eMapMode mmode) +{ + AttachEngine::refTypeStringList list = attacher.modeRefTypes[mmode]; + QStringList strlist; + for(AttachEngine::refTypeString &rts : list){ + QStringList buf; + for(eRefType rt : rts){ + buf.append(getShapeTypeText(rt)); + } + strlist.append(buf.join(QString::fromLatin1(", "))); + } + return strlist; +} + } //namespace AttacherGui diff --git a/src/Mod/Part/Gui/AttacherTexts.h b/src/Mod/Part/Gui/AttacherTexts.h index 7fc8cab73ba2..91bdee8bd3ab 100644 --- a/src/Mod/Part/Gui/AttacherTexts.h +++ b/src/Mod/Part/Gui/AttacherTexts.h @@ -32,6 +32,7 @@ #include #include +#include #include namespace AttacherGui { @@ -51,6 +52,8 @@ TextSet PartGuiExport getUIStrings(Base::Type attacherType, Attacher::eMapMode m QString PartGuiExport getShapeTypeText(Attacher::eRefType type); +QStringList PartGuiExport getRefListForMode(Attacher::AttachEngine &attacher, Attacher::eMapMode mmode); + } #endif diff --git a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp index d5f794222f1a..ad7a2f305fcd 100644 --- a/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp +++ b/src/Mod/PartDesign/Gui/TaskDatumParameters.cpp @@ -658,7 +658,9 @@ void TaskDatumParameters::updateListOfModes(eMapMode curMode) std::vector mstr = AttacherGui::getUIStrings(pcDatum->attacher().getTypeId(),mmode); ui->listOfModes->addItem(mstr[0]); QListWidgetItem* item = ui->listOfModes->item(i); - item->setToolTip(mstr[1]); + item->setToolTip(mstr[1] + QString::fromLatin1("\n\n") + + tr("Reference combinations:\n") + + AttacherGui::getRefListForMode(pcDatum->attacher(),mmode).join(QString::fromLatin1("\n"))); if (mmode == curMode) iSelect = ui->listOfModes->item(i); if (mmode == suggMode){