1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: XGUI_OperationMgr.cpp
4 // Created: 20 Apr 2014
5 // Author: Natalia ERMOLAEVA
7 #include "XGUI_OperationMgr.h"
8 #include "XGUI_ModuleConnector.h"
9 #include "XGUI_Workshop.h"
10 #include "XGUI_ErrorMgr.h"
11 #include "XGUI_Tools.h"
12 #include "XGUI_ObjectsBrowser.h"
13 #include "XGUI_ContextMenuMgr.h"
15 #include <ModuleBase_IPropertyPanel.h>
16 #include <ModuleBase_ModelWidget.h>
17 #include "ModuleBase_Operation.h"
18 #include "ModuleBase_IWorkshop.h"
19 #include "ModuleBase_IModule.h"
20 #include <ModuleBase_IViewer.h>
21 #include "ModuleBase_OperationDescription.h"
22 #include "ModuleBase_OperationFeature.h"
23 #include "ModuleBase_Tools.h"
25 #include "ModelAPI_CompositeFeature.h"
26 #include "ModelAPI_Session.h"
28 #include <XGUI_PropertyPanel.h>
29 #include <QToolButton>
32 #include <QMessageBox>
33 #include <QApplication>
36 //#define DEBUG_CURRENT_FEATURE
38 /// Processes "Delete" key event of application. This key is used by several application actions.
39 /// There is a logical order of the actions processing. So the key can not be set for actions
40 /// as a shortcut. The class listens the key event and call operation manager processor.
41 class XGUI_ShortCutListener : public QObject
45 /// \param theParent the parent to be deleted when the parent is deleted
46 /// \param theOperationMgr the class to perform deletion
47 XGUI_ShortCutListener(QObject* theParent, XGUI_OperationMgr* theOperationMgr)
48 : QObject(theParent), myOperationMgr(theOperationMgr)
50 qApp->installEventFilter(this);
52 ~XGUI_ShortCutListener() {}
54 /// Switch on short cut listener
55 void setActive(const bool theIsActive) { myIsActive = theIsActive; }
57 /// Redefinition of virtual function to process Delete key release
58 virtual bool eventFilter(QObject *theObject, QEvent *theEvent)
60 bool isAccepted = false;
61 if (myIsActive && theEvent->type() == QEvent::KeyRelease) {
62 QKeyEvent* aKeyEvent = dynamic_cast<QKeyEvent*>(theEvent);
64 switch (aKeyEvent->key()) {
66 isAccepted = myOperationMgr->onProcessDelete(theObject);
69 isAccepted = myOperationMgr->onKeyReleased(theObject, aKeyEvent);
75 isAccepted = QObject::eventFilter(theObject, theEvent);
80 XGUI_OperationMgr* myOperationMgr; /// processor for key event
81 bool myIsActive; /// boolean state whether the event filter perform own signal processing
84 XGUI_OperationMgr::XGUI_OperationMgr(QObject* theParent,
85 ModuleBase_IWorkshop* theWorkshop)
86 : QObject(theParent), myWorkshop(theWorkshop)
88 /// we need to install filter to the application in order to react to 'Delete' key button
89 /// this key can not be a short cut for a corresponded action because we need to set
90 /// the actions priority
91 myShortCutListener = new XGUI_ShortCutListener(theParent, this);
94 XGUI_OperationMgr::~XGUI_OperationMgr()
98 void XGUI_OperationMgr::activate()
100 myShortCutListener->setActive(true);
103 void XGUI_OperationMgr::deactivate()
105 myShortCutListener->setActive(false);
108 ModuleBase_Operation* XGUI_OperationMgr::currentOperation() const
110 return myOperations.count() > 0 ? myOperations.last() : 0;
113 bool XGUI_OperationMgr::isCurrentOperation(ModuleBase_Operation* theOperation)
117 return currentOperation() == theOperation;
120 bool XGUI_OperationMgr::hasOperation() const
122 return !myOperations.isEmpty() && (myOperations.last() != NULL);
125 bool XGUI_OperationMgr::hasOperation(const QString& theId) const
127 foreach(ModuleBase_Operation* aOp, myOperations) {
128 if (aOp->id() == theId)
134 ModuleBase_Operation* XGUI_OperationMgr::findOperation(const QString& theId) const
136 QList<ModuleBase_Operation*>::const_iterator anIt = myOperations.end();
137 while (anIt != myOperations.begin()) {
139 ModuleBase_Operation* anOperation = *anIt;
140 if (anOperation->id() == theId)
147 int XGUI_OperationMgr::operationsCount() const
149 return myOperations.count();
152 QStringList XGUI_OperationMgr::operationList() const
155 foreach(ModuleBase_Operation* eachOperation, myOperations) {
156 ModuleBase_OperationFeature* aFOperation =
157 dynamic_cast<ModuleBase_OperationFeature*>(eachOperation);
159 FeaturePtr aFeature = aFOperation->feature();
161 result << QString::fromStdString(aFeature->getKind());
168 ModuleBase_Operation* XGUI_OperationMgr::previousOperation(ModuleBase_Operation* theOperation) const
170 int idx = myOperations.lastIndexOf(theOperation);
171 if(idx == -1 || idx == 0) {
174 return myOperations.at(idx - 1);
177 bool XGUI_OperationMgr::startOperation(ModuleBase_Operation* theOperation)
180 currentOperation()->postpone();
181 myOperations.append(theOperation);
183 connect(theOperation, SIGNAL(beforeStarted()), SLOT(onBeforeOperationStarted()));
184 connect(theOperation, SIGNAL(beforeAborted()), SLOT(onBeforeOperationAborted()));
185 connect(theOperation, SIGNAL(beforeCommitted()), SLOT(onBeforeOperationCommitted()));
187 connect(theOperation, SIGNAL(started()), SLOT(onOperationStarted()));
188 connect(theOperation, SIGNAL(aborted()), SLOT(onOperationAborted()));
189 connect(theOperation, SIGNAL(committed()), SLOT(onOperationCommitted()));
191 connect(theOperation, SIGNAL(stopped()), SLOT(onOperationStopped()));
192 connect(theOperation, SIGNAL(resumed()), SLOT(onOperationResumed()));
194 bool isStarted = theOperation->start();
196 onValidateOperation();
200 bool XGUI_OperationMgr::abortAllOperations()
206 if (operationsCount() == 1) {
207 ModuleBase_Operation* aCurrentOperation = currentOperation();
208 if (canStopOperation(aCurrentOperation)) {
209 abortOperation(aCurrentOperation);
215 aResult = QMessageBox::question(qApp->activeWindow(),
216 tr("Abort operation"),
217 tr("All active operations will be aborted."),
218 QMessageBox::Ok | QMessageBox::Cancel,
219 QMessageBox::Cancel) == QMessageBox::Ok;
220 while(aResult && hasOperation()) {
221 abortOperation(currentOperation());
227 bool XGUI_OperationMgr::commitAllOperations()
229 bool isCompositeCommitted = false, anOperationProcessed = false;
230 while (hasOperation()) {
231 ModuleBase_Operation* anOperation = currentOperation();
232 if (XGUI_Tools::workshop(myWorkshop)->errorMgr()->isApplyEnabled()) {
233 anOperationProcessed = onCommitOperation();
235 abortOperation(anOperation);
236 anOperationProcessed = true;
238 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
241 FeaturePtr aFeature = aFOperation->feature();
242 CompositeFeaturePtr aComposite =
243 std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(aFeature);
244 isCompositeCommitted = aComposite.get();
245 if (isCompositeCommitted)
248 // not processed[committed] operation might be used in composite feature,
249 // so the while will be stopped by the previous check.
250 // this code is not necessary, but logically should be done when the processing will not
251 // be done for not composite feature by some reasons
252 if (!anOperationProcessed)
258 void XGUI_OperationMgr::onValidateOperation()
262 ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
263 (currentOperation());
264 if(aFOperation && aFOperation->feature().get())
265 XGUI_Tools::workshop(myWorkshop)->errorMgr()->updateActions(aFOperation->feature());
268 void XGUI_OperationMgr::updateApplyOfOperations(ModuleBase_Operation* theOperation)
270 XGUI_ErrorMgr* anErrorMgr = XGUI_Tools::workshop(myWorkshop)->errorMgr();
272 ModuleBase_OperationFeature* aFOperation =
273 dynamic_cast<ModuleBase_OperationFeature*>(theOperation);
275 anErrorMgr->updateAcceptAllAction(aFOperation->feature());
278 foreach(ModuleBase_Operation* anOperation, myOperations) {
280 updateApplyOfOperations(anOperation);
283 // Apply button of the current operation should also be updated
284 onValidateOperation();
287 bool XGUI_OperationMgr::canStopOperation(ModuleBase_Operation* theOperation)
289 //in case of nested (sketch) operation no confirmation needed
290 if (isGrantedOperation(theOperation->id()))
292 if (theOperation && theOperation->isModified()) {
293 QString aMessage = tr("%1 operation will be aborted.").arg(theOperation->id());
294 int anAnswer = QMessageBox::question(qApp->activeWindow(),
295 tr("Abort operation"),
297 QMessageBox::Ok | QMessageBox::Cancel,
298 QMessageBox::Cancel);
299 return anAnswer == QMessageBox::Ok;
304 bool XGUI_OperationMgr::commitOperation()
306 //if (hasOperation() && currentOperation()->isValid()) {
307 // onCommitOperation();
311 return onCommitOperation();
314 void XGUI_OperationMgr::resumeOperation(ModuleBase_Operation* theOperation)
316 theOperation->resume();
319 bool XGUI_OperationMgr::isGrantedOperation(const QString& theId)
321 bool isGranted = false;
323 QListIterator<ModuleBase_Operation*> anIt(myOperations);
325 ModuleBase_Operation* aPreviousOperation = 0;
326 while (anIt.hasPrevious() && !isGranted) {
327 ModuleBase_Operation* anOp = anIt.previous();
329 isGranted = anOp->isGranted(theId);
334 void XGUI_OperationMgr::setCurrentFeature(const FeaturePtr& theFeature)
336 SessionPtr aMgr = ModelAPI_Session::get();
337 DocumentPtr aDoc = aMgr->activeDocument();
338 bool aIsOp = aMgr->isOperation();
340 aMgr->startOperation(QString("Set current feature: %1")
341 .arg(theFeature->getKind().c_str()).toStdString());
342 aDoc->setCurrentFeature(theFeature, false);
343 #ifdef DEBUG_CURRENT_FEATURE
344 qDebug(QString(" document->setCurrentFeature(false) = %1 SET").arg(
345 ModuleBase_Tools::objectName(
346 ModelAPI_Session::get()->activeDocument()->currentFeature(false))).toStdString().c_str());
350 aMgr->finishOperation();
353 bool XGUI_OperationMgr::canStartOperation(const QString& theId, bool& isCommitted)
355 bool aCanStart = true;
357 ModuleBase_Operation* aCurrentOp = currentOperation();
359 bool aGranted = aCurrentOp->isGranted(theId);
360 // the started operation is granted for the current one,
361 // e.g. current - Sketch, started - Line
366 if (!isGrantedOperation(theId)) {
367 // the operation is not granted in the current list of operations
368 // e.g. Edit Parameter when Sketch, Line in Sketch is active.
369 aCanStart = abortAllOperations();
371 else if (canStopOperation(aCurrentOp)) {
372 // the started operation is granted in the parrent operation,
373 // e.g. current - Line in Sketch, started Circle
374 stopOperation(aCurrentOp, isCommitted);
383 void XGUI_OperationMgr::stopOperation(ModuleBase_Operation* theOperation, bool& isCommitted)
385 if (XGUI_Tools::workshop(myWorkshop)->errorMgr()->isApplyEnabled() && theOperation->isModified())
386 isCommitted = theOperation->commit();
389 abortOperation(theOperation);
393 void XGUI_OperationMgr::abortOperation(ModuleBase_Operation* theOperation)
395 ModuleBase_Operation* aCurrentOperation = currentOperation();
396 if (theOperation == aCurrentOperation)
397 theOperation->abort();
399 // it is possible to trigger upper operation(e.g. sketch, current is sketch line)
400 // all operation from the current to triggered should also be aborted
401 // operations over the parameter one are not aborted(e.g. extrusion cut, sketch abort)
402 while(hasOperation()) {
403 ModuleBase_Operation* aCurrentOperation = currentOperation();
404 aCurrentOperation->abort();
405 if(theOperation == aCurrentOperation)
411 bool XGUI_OperationMgr::onCommitOperation()
413 bool isCommitted = false;
414 ModuleBase_Operation* anOperation = currentOperation();
415 if (anOperation && myWorkshop->module()->canCommitOperation())
416 isCommitted = anOperation->commit();
420 void XGUI_OperationMgr::onAbortOperation()
422 ModuleBase_Operation* aCurrentOperation = currentOperation();
423 if (aCurrentOperation && canStopOperation(aCurrentOperation)) {
424 abortOperation(aCurrentOperation);
428 void XGUI_OperationMgr::onBeforeOperationStarted()
430 ModuleBase_Operation* aCurrentOperation = dynamic_cast<ModuleBase_Operation*>(sender());
431 if (!aCurrentOperation)
434 /// Set current feature and remeber old current feature
435 ModuleBase_OperationFeature* aFOperation =
436 dynamic_cast<ModuleBase_OperationFeature*>(aCurrentOperation);
438 SessionPtr aMgr = ModelAPI_Session::get();
439 DocumentPtr aDoc = aMgr->activeDocument();
440 // the parameter of current feature should be false, we should use all feature, not only
441 // visible in order to correctly save the previous feature of the nested operation, where the
442 // features can be not visible in the tree. The problem case is Edit sketch entitity(line)
443 // in the Sketch, created in ExtrusionCut operation. The entity disappears by commit.
444 // When sketch entity operation started, the sketch should be cashed here as the current.
445 // Otherwise(the flag is true), the ExtrusionCut is cashed, when commit happens, the sketch
446 // is disabled, sketch entity is disabled as extrusion cut is created earliest then sketch.
447 // As a result the sketch disappears from the viewer.
448 // However after commit it is displayed back.
449 aFOperation->setPreviousCurrentFeature(aDoc->currentFeature(false));
451 #ifdef DEBUG_CURRENT_FEATURE
452 FeaturePtr aFeature = aFOperation->feature();
453 QString aKind = aFeature ? aFeature->getKind().c_str() : "";
455 qDebug(QString("onBeforeOperationStarted() isEditOperation = %1, feature = %2")
456 .arg(aFOperation->isEditOperation())
457 .arg(ModuleBase_Tools::objectName(aFeature)).toStdString().c_str());
458 qDebug(QString(" document->currentFeature(false) = %1 : DO: setPreviousCurrentFeature").arg(
459 ModuleBase_Tools::objectName(aDoc->currentFeature(false))).toStdString().c_str());
462 if (aFOperation->isEditOperation()) {// it should be performed by the feature edit only
463 // in create operation, the current feature is changed by addFeature()
464 aDoc->setCurrentFeature(aFOperation->feature(), false);
465 #ifdef DEBUG_CURRENT_FEATURE
466 qDebug(QString(" document->setCurrentFeature(false) = %1").arg(
467 ModuleBase_Tools::objectName(aDoc->currentFeature(false))).toStdString().c_str());
469 // this is the only place where flushes must be called after setCurrentFeature for the
470 // current moment: after this the opertion is not finished, so, the ObjectBrowser
471 // state may be corrupted (issue #1457)
472 static Events_Loop* aLoop = Events_Loop::loop();
473 static Events_ID aCreateEvent = aLoop->eventByName(EVENT_OBJECT_CREATED);
474 aLoop->flush(aCreateEvent);
475 static Events_ID aDeleteEvent = aLoop->eventByName(EVENT_OBJECT_DELETED);
476 aLoop->flush(aDeleteEvent);
481 void XGUI_OperationMgr::onOperationStarted()
483 ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
484 updateApplyOfOperations(aSenderOperation);
485 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
486 aWorkshop->operationStarted(aSenderOperation);
489 void XGUI_OperationMgr::onBeforeOperationAborted()
491 onBeforeOperationCommitted();
494 void XGUI_OperationMgr::onOperationAborted()
496 ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
497 emit operationAborted(aSenderOperation);
500 void XGUI_OperationMgr::onBeforeOperationCommitted()
502 ModuleBase_Operation* aCurrentOperation = dynamic_cast<ModuleBase_Operation*>(sender());
503 if (!aCurrentOperation)
506 /// Restore the previous current feature
507 ModuleBase_OperationFeature* aFOperation =
508 dynamic_cast<ModuleBase_OperationFeature*>(aCurrentOperation);
510 #ifdef DEBUG_CURRENT_FEATURE
511 QString aKind = aFOperation->feature()->getKind().c_str();
512 qDebug(QString("onBeforeOperationCommitted() isEditOperation = %1, feature = %2")
513 .arg(aFOperation->isEditOperation())
514 .arg(ModuleBase_Tools::objectName(aFOperation->feature())).toStdString().c_str());
515 qDebug(QString(" document->currentFeature(false) = %1").arg(
516 ModuleBase_Tools::objectName(
517 ModelAPI_Session::get()->activeDocument()->currentFeature(false)))
518 .toStdString().c_str());
521 if (aFOperation->isEditOperation()) {
522 /// Restore the previous current feature
523 setCurrentFeature(aFOperation->previousCurrentFeature());
525 else { // create operation
526 // the Top created feature should stays the current. In nested operations,
527 // like Line in the Sketch or
528 // Sketch in ExtrusionCut, a previous feature should be restored on commit.
529 // It is performed here
530 // in order to perform it in the current transaction without opening a new one.
531 if (myOperations.front() != aFOperation)
532 setCurrentFeature(aFOperation->previousCurrentFeature());
534 ModuleBase_IModule* aModule = myWorkshop->module();
536 aModule->beforeOperationStopped(aFOperation);
540 void XGUI_OperationMgr::onOperationCommitted()
542 // apply state for all features from the stack of operations should be updated
543 updateApplyOfOperations();
545 ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
546 emit operationCommitted(aSenderOperation);
549 void XGUI_OperationMgr::onOperationResumed()
551 ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
552 emit operationResumed(aSenderOperation);
555 void XGUI_OperationMgr::onOperationStopped()
557 ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
558 ModuleBase_Operation* aCurrentOperation = currentOperation();
559 if (!aSenderOperation || !aCurrentOperation || aSenderOperation != aCurrentOperation)
562 myOperations.removeAll(aCurrentOperation);
563 aCurrentOperation->deleteLater();
565 emit operationStopped(aCurrentOperation);
567 // get last operation which can be resumed
568 ModuleBase_Operation* aResultOp = 0;
569 QListIterator<ModuleBase_Operation*> anIt(myOperations);
571 while (anIt.hasPrevious()) {
572 ModuleBase_Operation* anOp = anIt.previous();
579 bool isModified = aCurrentOperation->isModified();
580 aResultOp->setIsModified(aResultOp->isModified() || isModified);
581 resumeOperation(aResultOp);
582 onValidateOperation();
586 bool XGUI_OperationMgr::onKeyReleased(QObject *theObject, QKeyEvent* theEvent)
588 // Let the manager decide what to do with the given key combination.
589 ModuleBase_Operation* anOperation = currentOperation();
590 bool isAccepted = false;
591 switch (theEvent->key()) {
592 case Qt::Key_Escape: {
593 ModuleBase_Operation* aOperation = currentOperation();
601 case Qt::Key_Backtab:
603 ModuleBase_Operation* aOperation = currentOperation();
605 ModuleBase_IPropertyPanel* aPanel = anOperation->propertyPanel();
607 QWidget* aFocusedWidget = qApp->focusWidget();
608 bool isPPChildObject = aFocusedWidget && isChildObject(aFocusedWidget, aPanel);
609 if (!isPPChildObject) {
610 // check for case when the operation is started but property panel is not filled
611 XGUI_PropertyPanel* aPP = dynamic_cast<XGUI_PropertyPanel*>(aPanel);
612 aPP->setFocusNextPrevChild(theEvent->key() == Qt::Key_Tab);
620 case Qt::Key_Enter: {
621 isAccepted = onProcessEnter(theObject);
626 bool noModifiers = (theEvent->modifiers() == Qt::NoModifier);
628 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
629 Handle(AIS_InteractiveContext) aContext = aViewer->AISContext();
630 if (!aContext.IsNull()) {
631 Handle(V3d_View) aView = aViewer->activeView();
632 if ((theEvent->key() == Qt::Key_N))
633 aContext->HilightNextDetected(aView);
634 else if ((theEvent->key() == Qt::Key_P))
635 aContext->HilightPreviousDetected(aView);
646 // anOperation->keyReleased(theEvent->key());
651 bool XGUI_OperationMgr::onProcessEnter(QObject* theObject)
653 bool isAccepted = false;
654 ModuleBase_Operation* aOperation = currentOperation();
655 // to avoid enter processing when operation has not been started yet
658 ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
659 // the next code is obsolete as we want to process Enter in property panel always
660 // only property panel enter is processed in order to do not process enter in application dialogs
661 //bool isPPChild = isChildObject(theObject, aPanel);
663 // return isAccepted;
665 ModuleBase_ModelWidget* anActiveWgt = aPanel->activeWidget();
666 bool isAborted = false;
668 QWidget* aFocusWidget = aPanel->focusWidget();
669 QToolButton* aCancelBtn =
670 dynamic_cast<XGUI_PropertyPanel*>(aPanel)->findButton(PROP_PANEL_CANCEL);
671 if (aFocusWidget && aCancelBtn && aFocusWidget == aCancelBtn) {
672 abortOperation(aOperation);
678 isAccepted = anActiveWgt && anActiveWgt->processEnter();
681 myWorkshop->module()->processEnter(anActiveWgt ? anActiveWgt->attributeID() : "");
683 /// functionality is similar to Apply click
684 ModuleBase_OperationFeature* aFOperation =
685 dynamic_cast<ModuleBase_OperationFeature*>(currentOperation());
687 myWorkshop->module()->getFeatureError(aFOperation->feature()).isEmpty()) {
688 // key released is emitted to apply the current value to the model
689 // if it was modified in PP
690 emit keyEnterReleased();
702 bool editorControl(QObject* theObject)
704 QLineEdit* aLineEdit = dynamic_cast<QLineEdit*>(theObject);
708 bool XGUI_OperationMgr::onProcessDelete(QObject* theObject)
710 bool isAccepted = false;
711 ModuleBase_Operation* aOperation = currentOperation();
712 ModuleBase_ModelWidget* anActiveWgt = 0;
713 // firstly the widget should process Delete action
714 ModuleBase_IPropertyPanel* aPanel;
715 bool isPPChildObject = false;
717 aPanel = aOperation->propertyPanel();
719 isPPChildObject = isChildObject(theObject, aPanel);
720 // process delete in active widget only if delete sender is child of property panel
721 // it is necessary for the case when OB is shown, user perform selection and click Delete
722 if (isPPChildObject) {
723 anActiveWgt = aPanel->activeWidget();
725 isAccepted = anActiveWgt->processDelete();
731 // after widget, object browser and viewer should process delete
732 /// other widgets such as line edit controls should not lead to
733 /// processing delete by workshop
734 XGUI_ObjectsBrowser* aBrowser = XGUI_Tools::workshop(myWorkshop)->objectBrowser();
735 QWidget* aViewPort = myWorkshop->viewer()->activeViewPort();
736 bool isToDeleteObject = false;
737 XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
738 XGUI_ContextMenuMgr* aContextMenuMgr = aWorkshop->contextMenuMgr();
739 if (theObject == aBrowser->treeView()) {
740 aContextMenuMgr->updateObjectBrowserMenu();
741 isToDeleteObject = aContextMenuMgr->action("DELETE_CMD")->isEnabled();
743 else if (isChildObject(theObject, aViewPort)) {
744 aContextMenuMgr->updateViewerMenu();
745 isToDeleteObject = aContextMenuMgr->action("DELETE_CMD")->isEnabled();
747 else if (isPPChildObject) {
748 // property panel child object is processed to process delete performed on Apply button of PP
749 isToDeleteObject = true;
751 else if (editorControl(theObject)) {
752 isToDeleteObject = false; /// Line Edit of Rename operation in ObjectBrowser
756 if (isToDeleteObject) {
757 aWorkshop->deleteObjects();
765 bool XGUI_OperationMgr::isChildObject(const QObject* theObject, const QObject* theParent)
767 bool isPPChild = false;
768 if (theParent && theObject) {
769 QObject* aParent = (QObject*)theObject;
771 isPPChild = aParent == theParent;
774 aParent = aParent->parent();