Salome HOME
Update code documentation
[modules/shaper.git] / src / XGUI / XGUI_OperationMgr.cpp
index 6a3cc32be29d37c438487e4f59cd69d549979fdb..a8f68277b5aa2266d32b6cb4f4d6c4b33730a9d8 100644 (file)
@@ -1,3 +1,5 @@
+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
+
 // File:        XGUI_OperationMgr.h
 // Created:     20 Apr 2014
 // Author:      Natalia ERMOLAEVA
@@ -11,7 +13,7 @@
 #include <QKeyEvent>
 
 XGUI_OperationMgr::XGUI_OperationMgr(QObject* theParent)
-    : QObject(theParent)
+    : QObject(theParent), myIsValidationLock(false)
 {
 }
 
@@ -100,9 +102,11 @@ bool XGUI_OperationMgr::startOperation(ModuleBase_Operation* theOperation)
 
   connect(theOperation, SIGNAL(started()), SLOT(onOperationStarted()));
   connect(theOperation, SIGNAL(aborted()), SLOT(onOperationAborted()));
-  connect(theOperation, SIGNAL(committed()), SLOT(onOperationComitted()));
+  connect(theOperation, SIGNAL(committed()), SLOT(onOperationCommitted()));
   connect(theOperation, SIGNAL(stopped()), SLOT(onOperationStopped()));
   connect(theOperation, SIGNAL(resumed()), SLOT(onOperationResumed()));
+  connect(theOperation, SIGNAL(activatedByPreselection()),
+          SIGNAL(operationActivatedByPreselection()));
 
   theOperation->start();
   onValidateOperation();
@@ -135,7 +139,7 @@ void XGUI_OperationMgr::onValidateOperation()
   if (!hasOperation())
     return;
   ModuleBase_Operation* anOperation = currentOperation();
-  if(anOperation) {
+  if(anOperation && (!myIsValidationLock)) {
     bool isValid = anOperation->isValid();
     emit operationValidated(isValid);
   }
@@ -215,10 +219,10 @@ void XGUI_OperationMgr::onOperationAborted()
   emit operationAborted(aSenderOperation);
 }
 
-void XGUI_OperationMgr::onOperationComitted()
+void XGUI_OperationMgr::onOperationCommitted()
 {
   ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
-  emit operationComitted(aSenderOperation);
+  emit operationCommitted(aSenderOperation);
 }
 
 void XGUI_OperationMgr::onOperationResumed()
@@ -264,6 +268,7 @@ bool XGUI_OperationMgr::onKeyReleased(QKeyEvent* theEvent)
   switch (theEvent->key()) {
     case Qt::Key_Return:
     case Qt::Key_Enter: {
+      emit keyEnterReleased();
       commitOperation();
     }
       break;