Attacher: list ref. combinations in UI

This commit is contained in:
DeepSOIC 2016-04-21 03:30:59 +03:00
parent 7e14a044a6
commit 4a1a1480ce
3 changed files with 20 additions and 1 deletions

View File

@ -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

View File

@ -32,6 +32,7 @@
#include <vector>
#include <QString>
#include <QStringList>
#include <Mod/Part/App/Attacher.h>
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

View File

@ -658,7 +658,9 @@ void TaskDatumParameters::updateListOfModes(eMapMode curMode)
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]);
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){