]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_ContextMenuMgr.cpp
Salome HOME
ModuleBase_ViewerPrs is wrapped into shared_ptr: remove include of this class from...
[modules/shaper.git] / src / XGUI / XGUI_ContextMenuMgr.cpp
1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
2
3 #include "XGUI_ContextMenuMgr.h"
4 #include "XGUI_Workshop.h"
5 #include "XGUI_ObjectsBrowser.h"
6 #include "XGUI_SelectionMgr.h"
7 #include "XGUI_Displayer.h"
8 #include "XGUI_ViewerProxy.h"
9 #include "XGUI_Selection.h"
10 #include "XGUI_SalomeConnector.h"
11 #include "XGUI_DataModel.h"
12 #include "XGUI_OperationMgr.h"
13 #include "XGUI_Tools.h"
14
15 #ifndef HAVE_SALOME
16 #include <AppElements_MainWindow.h>
17 #endif
18
19 //#include "PartSetPlugin_Part.h"
20
21 #include <ModelAPI_Data.h>
22 #include <ModelAPI_AttributeDocRef.h>
23 #include <ModelAPI_Object.h>
24 #include <ModelAPI_Session.h>
25 #include <ModelAPI_ResultGroup.h>
26 #include <ModelAPI_ResultParameter.h>
27 #include <ModelAPI_ResultConstruction.h>
28 #include <ModelAPI_ResultBody.h>
29 #include <ModelAPI_Tools.h>
30
31 #include <ModuleBase_IModule.h>
32 #include <ModuleBase_Tools.h>
33 #include <ModuleBase_OperationAction.h>
34 #include <ModuleBase_ViewerPrs.h>
35
36 #include <QAction>
37 #include <QActionGroup>
38 #include <QContextMenuEvent>
39 #include <QMenu>
40 #include <QMdiArea>
41 #include <QMainWindow>
42
43
44 XGUI_ContextMenuMgr::XGUI_ContextMenuMgr(XGUI_Workshop* theParent)
45     : QObject(theParent),
46       myWorkshop(theParent),
47       mySeparator(0)
48 {
49 }
50
51 XGUI_ContextMenuMgr::~XGUI_ContextMenuMgr()
52 {
53 }
54
55 void XGUI_ContextMenuMgr::createActions()
56 {
57 #ifdef HAVE_SALOME
58   QMainWindow* aDesktop = myWorkshop->salomeConnector()->desktop();
59 #else
60   QMainWindow* aDesktop = myWorkshop->mainWindow();
61 #endif
62
63   QAction* aAction = new QAction(QIcon(":pictures/delete.png"), tr("Delete"), this);
64   aDesktop->addAction(aAction);
65
66   addAction("DELETE_CMD", aAction);
67   aAction->setShortcutContext(Qt::ApplicationShortcut);
68
69   aAction = new QAction(QIcon(":pictures/rename_edit.png"), tr("Rename"), this);
70   addAction("RENAME_CMD", aAction);
71   connect(aAction, SIGNAL(triggered(bool)), this, SLOT(onRename()));
72
73   aAction = new QAction(QIcon(":pictures/move.png"), XGUI_Workshop::MOVE_TO_END_COMMAND, this);
74   addAction("MOVE_CMD", aAction);
75
76   aAction = new QAction(QIcon(":pictures/clean_history.png"), tr("Clean history"), this);
77   addAction("CLEAN_HISTORY_CMD", aAction);
78
79   aAction = new QAction(QIcon(":pictures/color.png"), tr("Color..."), this);
80   addAction("COLOR_CMD", aAction);
81
82   aAction = new QAction(QIcon(":pictures/eye_pencil.png"), tr("Show"), this);
83   addAction("SHOW_CMD", aAction);
84
85   aAction = new QAction(QIcon(":pictures/eye_pencil.png"), tr("Show only"), this);
86   addAction("SHOW_ONLY_CMD", aAction);
87
88   aAction = new QAction(QIcon(":pictures/eye_pencil_closed.png"), tr("Hide"), this);
89   addAction("HIDE_CMD", aAction);
90
91   aAction = new QAction(QIcon(":pictures/eye_pencil_closed.png"), tr("Hide all"), this);
92   addAction("HIDEALL_CMD", aAction);
93
94   aAction = new QAction(QIcon(":pictures/shading.png"), tr("Shading"), this);
95   addAction("SHADING_CMD", aAction);
96
97   aAction = new QAction(QIcon(":pictures/wireframe.png"), tr("Wireframe"), this);
98   addAction("WIREFRAME_CMD", aAction);
99
100   mySeparator = new QAction(this);
101   mySeparator->setSeparator(true);
102
103   mySelectActions = new QActionGroup(this);
104   mySelectActions->setExclusive(true);
105
106   aAction = new QAction(QIcon(":pictures/vertex.png"), tr("Vertices"), this);
107   aAction->setCheckable(true);
108   addAction("SELECT_VERTEX_CMD", aAction);
109   mySelectActions->addAction(aAction);
110
111   aAction = new QAction(QIcon(":pictures/edge.png"), tr("Edges"), this);
112   aAction->setCheckable(true);
113   addAction("SELECT_EDGE_CMD", aAction);
114   mySelectActions->addAction(aAction);
115
116   aAction = new QAction(QIcon(":pictures/face.png"), tr("Faces"), this);
117   aAction->setCheckable(true);
118   addAction("SELECT_FACE_CMD", aAction);
119   mySelectActions->addAction(aAction);
120
121   aAction = new QAction(QIcon(":pictures/result.png"), tr("Result"), this);
122   aAction->setCheckable(true);
123   addAction("SELECT_RESULT_CMD", aAction);
124   mySelectActions->addAction(aAction);
125
126   aAction->setChecked(true);
127
128   buildObjBrowserMenu();
129   buildViewerMenu();
130 }
131
132 void XGUI_ContextMenuMgr::addAction(const QString& theId, QAction* theAction)
133 {
134   if (myActions.contains(theId))
135     qCritical("A command with Id = '%s' already defined!", qPrintable(theId));
136   theAction->setData(theId);
137   connect(theAction, SIGNAL(triggered(bool)), this, SLOT(onAction(bool)));
138   myActions[theId] = theAction;
139 }
140
141 QAction* XGUI_ContextMenuMgr::action(const QString& theId) const
142 {
143   if (myActions.contains(theId))
144     return myActions[theId];
145   return 0;
146 }
147
148 QAction* XGUI_ContextMenuMgr::actionByName(const QString& theName) const
149 {
150   foreach(QAction* eachAction, myActions) {
151     if (eachAction->text() == theName) {
152       return eachAction;
153     }
154   }
155   return NULL;
156 }
157
158 QStringList XGUI_ContextMenuMgr::actionIds() const
159 {
160   return myActions.keys();
161 }
162
163 void XGUI_ContextMenuMgr::onAction(bool isChecked)
164 {
165   QAction* aAction = static_cast<QAction*>(sender());
166   emit actionTriggered(aAction->data().toString(), isChecked);
167 }
168
169 void XGUI_ContextMenuMgr::updateCommandsStatus()
170 {
171 }
172
173 void XGUI_ContextMenuMgr::onContextMenuRequest(QContextMenuEvent* theEvent)
174 {
175   QMenu* aMenu = new QMenu();
176   if (sender() == myWorkshop->objectBrowser()) {
177     updateObjectBrowserMenu();
178     addObjBrowserMenu(aMenu);
179   } else if (sender() == myWorkshop->viewer()) {
180     updateViewerMenu();
181     addViewerMenu(aMenu);
182   }
183
184   if (aMenu && (aMenu->actions().size() > 0)) {
185     // it is possible that some objects should do something before and after the popup menu exec
186     // e.g. a sketch manager changes an internal flag on this signals in order to do not hide
187     // a created entity
188     emit beforeContextMenu();
189     aMenu->exec(theEvent->globalPos());
190     emit afterContextMenu();
191     delete aMenu;
192   }
193 }
194
195 void XGUI_ContextMenuMgr::updateObjectBrowserMenu() 
196 {
197   foreach(QAction* aAction, myActions)
198     aAction->setEnabled(false);
199
200   XGUI_SelectionMgr* aSelMgr = myWorkshop->selector();
201   QObjectPtrList aObjects = aSelMgr->selection()->selectedObjects();
202   int aSelected = aObjects.size();
203   if (aSelected > 0) {
204     SessionPtr aMgr = ModelAPI_Session::get();
205     XGUI_Displayer* aDisplayer = myWorkshop->displayer();
206     bool hasResult = false;
207     bool hasFeature = false;
208     bool hasParameter = false;
209     bool hasSubFeature = false;
210     ModuleBase_Tools::checkObjects(aObjects, hasResult, hasFeature, hasParameter, hasSubFeature);
211
212     //Process Feature
213     if (aSelected == 1) {
214       ObjectPtr aObject = aObjects.first();
215       if (aObject) {
216         if (hasResult && myWorkshop->canBeShaded(aObject)) {
217           XGUI_Displayer::DisplayMode aMode = aDisplayer->displayMode(aObject);
218           if (aMode != XGUI_Displayer::NoMode) {
219             action("WIREFRAME_CMD")->setEnabled(aMode == XGUI_Displayer::Shading);
220             action("SHADING_CMD")->setEnabled(aMode == XGUI_Displayer::Wireframe);
221           } else {
222             action("WIREFRAME_CMD")->setEnabled(true);
223             action("SHADING_CMD")->setEnabled(true);
224           }
225         }
226         if (!hasFeature) {
227           bool aHasSubResults = ModelAPI_Tools::hasSubResults(
228                                             std::dynamic_pointer_cast<ModelAPI_Result>(aObject));
229           if (aHasSubResults) {
230             action("HIDE_CMD")->setEnabled(true);
231             action("SHOW_CMD")->setEnabled(true);
232           }
233           else {
234             if (aObject->isDisplayed()) {
235               action("HIDE_CMD")->setEnabled(true);
236             } else if (hasResult && (!hasParameter)) {
237               action("SHOW_CMD")->setEnabled(true);
238             }
239           }
240           if (!(hasParameter || hasFeature))
241             action("SHOW_ONLY_CMD")->setEnabled(true);
242         }
243         else if (hasFeature && myWorkshop->canMoveFeature())
244           action("MOVE_CMD")->setEnabled(true);
245
246         else if (hasFeature || hasParameter)
247           action("CLEAN_HISTORY_CMD")->setEnabled(!hasSubFeature);
248
249         if( aMgr->activeDocument() == aObject->document() )
250         {
251           action("RENAME_CMD")->setEnabled(true);
252           action("DELETE_CMD")->setEnabled(!hasSubFeature);
253         }
254       }
255     } else {
256       // parameter is commented because the actions are not in the list of result parameter actions
257       if (hasResult /*&& (!hasParameter)*/) {
258         action("SHOW_CMD")->setEnabled(true);
259         action("HIDE_CMD")->setEnabled(true);
260         action("SHOW_ONLY_CMD")->setEnabled(true);
261         action("SHADING_CMD")->setEnabled(true);
262         action("WIREFRAME_CMD")->setEnabled(true);
263       }
264     }
265     bool allActive = true;
266     foreach( ObjectPtr aObject, aObjects )
267       if( aMgr->activeDocument() != aObject->document() )  {
268         allActive = false;
269         break;
270       }
271     if (!hasSubFeature && allActive ) {
272       if (hasFeature || hasParameter)
273         action("DELETE_CMD")->setEnabled(true);
274     }
275     if (!hasSubFeature && allActive && (hasFeature|| hasParameter))
276       action("CLEAN_HISTORY_CMD")->setEnabled(true);
277   }
278
279   // Show/Hide command has to be disabled for objects from non active document
280   bool aDeactivate = false;
281   foreach (ObjectPtr aObj, aObjects) {
282     if (!aObj->document()->isActive()) {
283       if ((aObj->document() != ModelAPI_Session::get()->moduleDocument()) ||
284            aObj->groupName() == ModelAPI_ResultPart::group()) {
285         aDeactivate = true;
286         break;
287       }
288     }
289   }
290   if (aDeactivate) {
291     // If at leas a one objec can not be edited then Show/Hide has to be disabled
292     action("SHOW_CMD")->setEnabled(false);
293     action("HIDE_CMD")->setEnabled(false);
294     action("SHOW_ONLY_CMD")->setEnabled(false);
295   }
296
297   if (myWorkshop->canChangeColor())
298     action("COLOR_CMD")->setEnabled(true);
299
300   ModuleBase_IModule* aModule = myWorkshop->module();
301   if (aModule)
302     aModule->updateObjectBrowserMenu(myActions);
303 }
304
305 void XGUI_ContextMenuMgr::updateViewerMenu()
306 {
307   foreach(QAction* aAction, myActions)
308     aAction->setEnabled(false);
309
310   XGUI_SelectionMgr* aSelMgr = myWorkshop->selector();
311   XGUI_Displayer* aDisplayer = myWorkshop->displayer();
312   QList<ModuleBase_ViewerPrsPtr> aPrsList = aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer);
313   if (aPrsList.size() > 0) {
314     bool isVisible = false;
315     bool isShading = false;
316     bool canBeShaded = false;
317     ObjectPtr aObject;
318     foreach(ModuleBase_ViewerPrsPtr aPrs, aPrsList) {
319       aObject = aPrs->object();
320       ResultPtr aRes = std::dynamic_pointer_cast<ModelAPI_Result>(aObject);
321       if (aRes && aRes->isDisplayed()) {
322         isVisible = true;
323         canBeShaded = myWorkshop->displayer()->canBeShaded(aObject);
324         isShading = (myWorkshop->displayer()->displayMode(aObject) == XGUI_Displayer::Shading);      
325         break;
326       }
327     }
328     if (isVisible) {
329       if (canBeShaded) {
330         XGUI_Displayer::DisplayMode aMode = aDisplayer->displayMode(aObject);
331         if (aMode != XGUI_Displayer::NoMode) {
332           action("WIREFRAME_CMD")->setEnabled(aMode == XGUI_Displayer::Shading);
333           action("SHADING_CMD")->setEnabled(aMode == XGUI_Displayer::Wireframe);
334         } else {
335           action("WIREFRAME_CMD")->setEnabled(true);
336           action("SHADING_CMD")->setEnabled(true);
337         }
338       }
339       action("SHOW_ONLY_CMD")->setEnabled(true);
340       action("HIDE_CMD")->setEnabled(true);
341     } else
342       action("SHOW_CMD")->setEnabled(true);
343   }
344   if (myWorkshop->displayer()->objectsCount() > 0)
345     action("HIDEALL_CMD")->setEnabled(true);
346   if (myWorkshop->canChangeColor())
347     action("COLOR_CMD")->setEnabled(true);
348
349   action("DELETE_CMD")->setEnabled(true);
350
351   // Update selection menu
352   QIntList aModes = aDisplayer->activeSelectionModes();
353   if (aModes.count() <= 1) {
354     action("SELECT_VERTEX_CMD")->setEnabled(true);
355     action("SELECT_EDGE_CMD")->setEnabled(true);
356     action("SELECT_FACE_CMD")->setEnabled(true);
357     action("SELECT_RESULT_CMD")->setEnabled(true);
358     if (aModes.count() == 1) {
359       switch (aModes.first()) {
360       case TopAbs_VERTEX: 
361         action("SELECT_VERTEX_CMD")->setChecked(true);
362         break;
363       case TopAbs_EDGE: 
364         action("SELECT_EDGE_CMD")->setChecked(true);
365         break;
366       case TopAbs_FACE:
367         action("SELECT_FACE_CMD")->setChecked(true);
368         break;
369       default:
370         action("SELECT_RESULT_CMD")->setChecked(true);
371       }
372     } else 
373       action("SELECT_RESULT_CMD")->setChecked(true);
374   }
375   ModuleBase_IModule* aModule = myWorkshop->module();
376   if (aModule)
377     aModule->updateViewerMenu(myActions);
378 }
379
380 void XGUI_ContextMenuMgr::connectObjectBrowser()
381 {
382   connect(myWorkshop->objectBrowser(), SIGNAL(contextMenuRequested(QContextMenuEvent*)), this,
383           SLOT(onContextMenuRequest(QContextMenuEvent*)));
384 }
385
386 void XGUI_ContextMenuMgr::connectViewer()
387 {
388   connect(myWorkshop->viewer(), SIGNAL(contextMenuRequested(QContextMenuEvent*)), this,
389           SLOT(onContextMenuRequest(QContextMenuEvent*)));
390 }
391
392
393 void XGUI_ContextMenuMgr::buildObjBrowserMenu()
394 {
395   QAction* aSeparator = new QAction(this);
396   aSeparator->setSeparator(true);
397
398   QActionsList aList;
399   
400   // Result construction menu
401   aList.append(action("SHOW_CMD"));
402   aList.append(action("HIDE_CMD"));
403   aList.append(action("SHOW_ONLY_CMD"));
404   aList.append(action("COLOR_CMD"));
405   aList.append(mySeparator);
406   aList.append(action("RENAME_CMD"));
407   myObjBrowserMenus[ModelAPI_ResultConstruction::group()] = aList;
408   //-------------------------------------
409   // Result body menu
410   aList.clear();
411   aList.append(action("WIREFRAME_CMD"));
412   aList.append(action("SHADING_CMD"));
413   aList.append(action("COLOR_CMD"));
414   aList.append(mySeparator);
415   aList.append(action("SHOW_CMD"));
416   aList.append(action("HIDE_CMD"));
417   aList.append(action("SHOW_ONLY_CMD"));
418   aList.append(mySeparator);
419   aList.append(action("RENAME_CMD"));
420   myObjBrowserMenus[ModelAPI_ResultBody::group()] = aList;
421   // Group menu
422   myObjBrowserMenus[ModelAPI_ResultGroup::group()] = aList;
423   // Result part menu
424   myObjBrowserMenus[ModelAPI_ResultPart::group()] = aList;
425   //-------------------------------------
426   // Feature menu
427   aList.clear();
428   aList.append(action("DELETE_CMD"));
429   aList.append(action("MOVE_CMD"));
430   aList.append(action("CLEAN_HISTORY_CMD"));
431   aList.append(mySeparator);
432   aList.append(action("RENAME_CMD"));
433   myObjBrowserMenus[ModelAPI_Feature::group()] = aList;
434
435   aList.clear();
436   aList.append(action("DELETE_CMD"));
437   aList.append(action("CLEAN_HISTORY_CMD"));
438   aList.append(mySeparator);
439   aList.append(action("RENAME_CMD"));
440   myObjBrowserMenus[ModelAPI_ResultParameter::group()] = aList;
441   //-------------------------------------
442 }
443
444 void XGUI_ContextMenuMgr::buildViewerMenu()
445 {
446   QActionsList aList;
447   // Result construction menu
448   aList.append(action("HIDE_CMD"));
449   aList.append(action("SHOW_ONLY_CMD"));
450   aList.append(action("COLOR_CMD"));
451   myViewerMenu[ModelAPI_ResultConstruction::group()] = aList;
452   // Result part menu
453   myViewerMenu[ModelAPI_ResultPart::group()] = aList;
454   //-------------------------------------
455   // Result body menu
456   aList.clear();
457   aList.append(action("WIREFRAME_CMD"));
458   aList.append(action("SHADING_CMD"));
459   aList.append(action("COLOR_CMD"));
460   aList.append(mySeparator);
461   aList.append(action("HIDE_CMD"));
462   aList.append(action("SHOW_ONLY_CMD"));
463   myViewerMenu[ModelAPI_ResultBody::group()] = aList;
464   // Group menu
465   myViewerMenu[ModelAPI_ResultGroup::group()] = aList;
466   //-------------------------------------
467
468 }
469
470
471 void XGUI_ContextMenuMgr::addObjBrowserMenu(QMenu* theMenu) const
472 {
473   XGUI_SelectionMgr* aSelMgr = myWorkshop->selector();
474   QObjectPtrList aObjects = aSelMgr->selection()->selectedObjects();
475   int aSelected = aObjects.size();
476   QActionsList aActions;
477   if (aSelected == 1) {
478     ObjectPtr aObject = aObjects.first();
479     std::string aName = aObject->groupName();
480     if (myObjBrowserMenus.contains(aName))
481       aActions = myObjBrowserMenus[aName];
482   } else if (aSelected > 1) {
483       aActions.append(action("SHADING_CMD"));
484       aActions.append(action("WIREFRAME_CMD"));
485       aActions.append(mySeparator);
486       aActions.append(action("SHOW_CMD"));
487       aActions.append(action("HIDE_CMD"));
488       aActions.append(action("SHOW_ONLY_CMD"));
489       aActions.append(mySeparator);
490       aActions.append(action("DELETE_CMD"));
491       //aActions.append(action("MOVE_CMD"));
492       aActions.append(action("CLEAN_HISTORY_CMD"));
493       aActions.append(action("COLOR_CMD"));
494   }
495   theMenu->addActions(aActions);
496
497   ModuleBase_IModule* aModule = myWorkshop->module();
498   if (aModule) {
499     theMenu->addSeparator();
500     aModule->addObjectBrowserMenu(theMenu);
501   }
502   theMenu->addSeparator();
503   theMenu->addActions(myWorkshop->objectBrowser()->actions());
504 }
505
506 void XGUI_ContextMenuMgr::addViewerMenu(QMenu* theMenu) const
507 {
508   ModuleBase_IModule* aModule = myWorkshop->module();
509   if (aModule) {
510     if (aModule->addViewerMenu(theMenu, myActions))
511       theMenu->addSeparator();
512   }
513   XGUI_SelectionMgr* aSelMgr = myWorkshop->selector();
514   QList<ModuleBase_ViewerPrsPtr> aPrsList = aSelMgr->selection()->getSelected(ModuleBase_ISelection::Viewer);
515   int aSelected = aPrsList.size();
516   QActionsList aActions;
517
518   // Create selection menu
519   XGUI_OperationMgr* aOpMgr = myWorkshop->operationMgr();
520   QIntList aModes;
521   myWorkshop->module()->activeSelectionModes(aModes);
522   if ((!aOpMgr->hasOperation()) && aModes.isEmpty()) {
523     QMenu* aSelMenu = new QMenu(tr("Selection mode"), theMenu);
524     aSelMenu->addAction(action("SELECT_VERTEX_CMD"));
525     aSelMenu->addAction(action("SELECT_EDGE_CMD"));
526     aSelMenu->addAction(action("SELECT_FACE_CMD"));
527     aSelMenu->addAction(action("SELECT_RESULT_CMD"));
528     theMenu->addMenu(aSelMenu);
529     theMenu->addSeparator();
530   }
531   if (aSelected == 1) {
532     ObjectPtr aObject = aPrsList.first()->object();
533     if (aObject.get() != NULL) {
534       std::string aName = aObject->groupName();
535       if (myViewerMenu.contains(aName))
536         aActions = myViewerMenu[aName];
537     }
538     aActions.append(action("COLOR_CMD"));
539   } else if (aSelected > 1) {
540     aActions.append(action("HIDE_CMD"));
541     aActions.append(action("COLOR_CMD"));
542   }
543   // hide all is shown always even if selection in the viewer is empty
544   aActions.append(action("HIDEALL_CMD"));
545   theMenu->addActions(aActions);
546
547 #ifndef HAVE_SALOME
548   theMenu->addSeparator();
549   QMdiArea* aMDI = myWorkshop->mainWindow()->mdiArea();
550   if (aMDI->actions().size() > 0) {
551     QMenu* aSubMenu = theMenu->addMenu(tr("Windows"));
552     aSubMenu->addActions(aMDI->actions());
553   }
554 #endif
555 }
556
557 QStringList XGUI_ContextMenuMgr::actionObjectGroups(const QString& theName)
558 {
559   QStringList aGroups;
560
561   QMap<std::string, QActionsList>::const_iterator anIt = myObjBrowserMenus.begin(),
562                                                   aLast = myObjBrowserMenus.end();
563   for (; anIt != aLast; anIt++) {
564     QString aGroupName(anIt.key().c_str());
565     if (aGroups.contains(aGroupName))
566       continue;
567     QActionsList anActions = anIt.value();
568     QActionsList::const_iterator anAIt = anActions.begin(), anALast = anActions.end();
569     bool aFound = false;
570     for (; anAIt != anALast && !aFound; anAIt++)
571       aFound = (*anAIt)->data().toString() == theName;
572     if (aFound)
573       aGroups.append(aGroupName);
574   }
575   return aGroups;
576 }
577
578 void XGUI_ContextMenuMgr::onRename()
579 {
580   QObjectPtrList anObjects = myWorkshop->selector()->selection()->selectedObjects();
581   if (!myWorkshop->abortAllOperations())
582     return; 
583   // restore selection in case if dialog box was shown
584   myWorkshop->objectBrowser()->setObjectsSelected(anObjects);
585   myWorkshop->objectBrowser()->onEditItem();
586 }