+}
+
+//**************************************************************
+bool XGUI_Workshop::displayObject(ObjectPtr theObj)
+{
+ if (!myModule->canDisplayObject(theObj))
+ return false;
+
+ ResultBodyPtr aBody = std::dynamic_pointer_cast<ModelAPI_ResultBody>(theObj);
+ if (aBody.get() != NULL) {
+ int aNb = myDisplayer->objectsCount();
+ myDisplayer->display(theObj, false);
+ if (aNb == 0)
+ viewer()->fitAll();
+ } else if (!(myIsLoadingData || myPartActivating))
+ myDisplayer->display(theObj, false);
+
+ return true;
+}
+
+void XGUI_Workshop::addHistoryMenu(QObject* theObject, const char* theSignal, const char* theSlot)
+{
+ XGUI_HistoryMenu* aMenu = NULL;
+ if (isSalomeMode()) {
+ QAction* anAction = qobject_cast<QAction*>(theObject);
+ if (!anAction)
+ return;
+ aMenu = new XGUI_HistoryMenu(anAction);
+ } else {
+ QToolButton* aButton = qobject_cast<QToolButton*>(theObject);
+ aMenu = new XGUI_HistoryMenu(aButton);
+ }
+ connect(this, theSignal, aMenu, SLOT(setHistory(const QList<ActionInfo>&)));
+ connect(aMenu, SIGNAL(actionSelected(int)), this, theSlot);
+}
+
+QList<ActionInfo> XGUI_Workshop::processHistoryList(const std::list<std::string>& theList) const
+{
+ QList<ActionInfo> aResult;
+ std::list<std::string>::const_iterator it = theList.cbegin();
+ for (; it != theList.cend(); it++) {
+ QString anId = QString::fromStdString(*it);
+ bool isEditing = anId.endsWith(ModuleBase_Operation::EditSuffix());
+ if (isEditing) {
+ anId.chop(ModuleBase_Operation::EditSuffix().size());
+ }
+ ActionInfo anInfo;
+ QAction* aContextMenuAct = myContextMenuMgr->actionByName(anId);
+ if (aContextMenuAct) {
+ anInfo.initFrom(aContextMenuAct);
+ } else {
+ anInfo = myActionsMgr->actionInfoById(anId);
+ }
+ if (isEditing) {
+ anInfo.text = anInfo.text.prepend("Modify ");
+ }
+ aResult << anInfo;
+ }
+ return aResult;