X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FXGUI%2FXGUI_OperationMgr.cpp;h=aeb0ed3c06533a771a44873994117795ae04193f;hb=d86c77d1c6210bbe04fbc3e5b00f9e212e1ec930;hp=ae5aeb04732b065d042ee57b34a82ad61e128894;hpb=11fca61445a4c008b1b703bfd4bb512fcac65135;p=modules%2Fshaper.git diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index ae5aeb047..aeb0ed3c0 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -1,49 +1,38 @@ +// File: XGUI_OperationMgr.h +// Created: 20 Apr 2014 +// Author: Natalia ERMOLAEVA + #include "XGUI_OperationMgr.h" #include "ModuleBase_Operation.h" #include -/*! - \brief Constructor - */ XGUI_OperationMgr::XGUI_OperationMgr(QObject* theParent) : QObject(theParent) { } -/*! - \brief Destructor - */ XGUI_OperationMgr::~XGUI_OperationMgr() { } -/*! - \brief Returns the current operation or NULL - * \return the current operation - */ ModuleBase_Operation* XGUI_OperationMgr::currentOperation() const { return myOperations.count() > 0 ? myOperations.last() : 0; } -/*! - \brief Sets the current operation or NULL - * \return the current operation - */ bool XGUI_OperationMgr::startOperation(ModuleBase_Operation* theOperation) { if (!canStartOperation(theOperation)) return false; myOperations.append(theOperation); - emit beforeOperationStart(); connect(theOperation, SIGNAL(stopped()), this, SLOT(onOperationStopped())); - theOperation->start(); + connect(theOperation, SIGNAL(started()), this, SIGNAL(operationStarted())); - emit afterOperationStart(); + theOperation->start(); return true; } @@ -64,15 +53,6 @@ bool XGUI_OperationMgr::canStartOperation(ModuleBase_Operation* theOperation) return aCanStart; } -void XGUI_OperationMgr::commitCurrentOperation() -{ - ModuleBase_Operation* anOperation = currentOperation(); - if (!anOperation) - return; - - anOperation->commit(); -} - void XGUI_OperationMgr::onOperationStopped() { ModuleBase_Operation* aSenderOperation = dynamic_cast(sender()); @@ -80,7 +60,10 @@ void XGUI_OperationMgr::onOperationStopped() if (!aSenderOperation || !anOperation || aSenderOperation != anOperation ) return; + emit operationStopped(anOperation); + myOperations.removeAll(anOperation); + anOperation->deleteLater(); // get last operation which can be resumed ModuleBase_Operation* aResultOp = 0;