Salome HOME
Add virtual function to allow the module to abort active operations on document loadi...
[modules/gui.git] / src / CAM / CAM_Application.cxx
index e45d4a8cdf24950d56b0d38690062d21b45dd272..ed7260417bc28d8b2a32ca98edd2caf7828c4d61 100755 (executable)
@@ -863,3 +863,20 @@ CAM_Application::ModuleShortInfoList CAM_Application::getVersionInfo()
   }  
   return info;
 }
+
+/*!
+  \brief Abort active operations if there are any
+  Iterates through all modules and asks each of them if there are pending operations that cannot be aborted.
+  \return \c false if some operation cannot be aborted
+*/
+bool CAM_Application::abortAllOperations()
+{
+  bool aborted = true;
+  for ( QList<CAM_Module*>::const_iterator it = myModules.begin(); it != myModules.end() && aborted; ++it )
+  {
+    aborted = (*it)->abortAllOperations();
+  }
+  return aborted;
+}