]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #739: Activation of parts on Parts operations
authorvsv <vitaly.smetannikov@opencascade.com>
Thu, 9 Jul 2015 10:02:09 +0000 (13:02 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Thu, 9 Jul 2015 10:02:09 +0000 (13:02 +0300)
src/PartSet/PartSet_Module.cpp

index 664dc7d58e72fe670ff0432495428ee2c4ad7ba3..0ea84ee283cb821bf2bb941df7413fb57c6a4c6f 100644 (file)
@@ -22,6 +22,7 @@
 
 #include <PartSetPlugin_Remove.h>
 #include <PartSetPlugin_Part.h>
+#include <PartSetPlugin_Duplicate.h>
 
 #include <ModuleBase_Operation.h>
 #include <ModuleBase_IViewer.h>
@@ -832,7 +833,14 @@ void PartSet_Module::processEvent(const std::shared_ptr<Events_Message>& theMess
 {
   if (theMessage->eventID() == Events_Loop::loop()->eventByName(EVENT_DOCUMENT_CHANGED)) {
     // Do not change activation of parts if an operation active
-    if (myWorkshop->currentOperation() && myWorkshop->currentOperation()->id().toStdString() != PartSetPlugin_Part::ID())
+    static QStringList aAllowActivationList;
+    if (aAllowActivationList.isEmpty())
+      aAllowActivationList << 
+      QString(PartSetPlugin_Part::ID().c_str()) << 
+      QString(PartSetPlugin_Duplicate::ID().c_str()) <<
+      QString(PartSetPlugin_Remove::ID().c_str());
+    if (myWorkshop->currentOperation() && 
+      (!aAllowActivationList.contains(myWorkshop->currentOperation()->id())))
       return;
     XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(myWorkshop);
     XGUI_Workshop* aWorkshop = aConnector->workshop();