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
/// 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;
/// \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.
/// 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.