Salome HOME
Merge branch 'Pre_2.8.0_development'
[modules/shaper.git] / src / XGUI / XGUI_OperationMgr.h
index 56286cc1fece6026f805b72ea65f5eca9925decf..00d941981479e68337b4ac30d16b61a8d254c81e 100755 (executable)
@@ -48,7 +48,15 @@ class XGUI_ShortCutListener;
 class XGUI_EXPORT XGUI_OperationMgr : public QObject
 {
 Q_OBJECT
- public:
+public:
+  /// Enumeration of kind of message that is used when trying to stop the active operation
+  enum XGUI_MessageKind
+  {
+    XGUI_AbortOperationMessage, //< warns and give possibility to abort current operation
+    XGUI_InformationMessage //< ask to apply the current operation before performing something
+  };
+
+public:
   /// Constructor
   /// \param theParent the parent
   /// \param theWorkshop a reference to workshop
@@ -87,7 +95,9 @@ Q_OBJECT
   /// Returns true if the operation can be aborted. If the operation is modified,
   /// the warning message box is shown.
   /// \param theOperation an operation which is checked on stop
-  bool canStopOperation(ModuleBase_Operation* theOperation);
+  /// \param theMessageKind a kind of message in warning message box
+  bool canStopOperation(ModuleBase_Operation* theOperation,
+                        const XGUI_MessageKind& theMessageKind = XGUI_AbortOperationMessage);
 
   /// Find and return operation by its Id.
   ModuleBase_Operation* findOperation(const QString& theId) const;
@@ -124,8 +134,7 @@ Q_OBJECT
   /// \param theOperation an aborted operation
   void abortOperation(ModuleBase_Operation* theOperation);
 
-  /// Slot that commits the current operation.
-  bool onCommitOperation();
+  bool abortAllOperations(const XGUI_MessageKind& theMessageKind = XGUI_AbortOperationMessage);
 
 public slots:
   /// Slot that aborts the current operation.
@@ -135,7 +144,10 @@ public slots:
   /// Commit all operations
   bool commitAllOperations();
   /// Abort all operations
-  bool abortAllOperations();
+  void onAbortAllOperations();
+
+protected slots:
+
 
 signals:
   /// Signal about an operation is stopped. It is emitted after the stop() of operation is done.