From 975127adf20d108d4f63a53000b61e7c89ceff0f Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 20 May 2014 13:17:32 +0400 Subject: [PATCH] refs #30 - Sketch base GUI: create, draw lines Fill the property panel by the sketch current operation on a suboperation finish. --- src/ModuleBase/ModuleBase_IOperation.cpp | 1 + src/ModuleBase/ModuleBase_IOperation.h | 1 + src/XGUI/XGUI_OperationMgr.cpp | 4 +--- src/XGUI/XGUI_OperationMgr.h | 2 ++ src/XGUI/XGUI_Workshop.cpp | 1 + 5 files changed, 6 insertions(+), 3 deletions(-) diff --git a/src/ModuleBase/ModuleBase_IOperation.cpp b/src/ModuleBase/ModuleBase_IOperation.cpp index 6853d0d70..4e339672b 100644 --- a/src/ModuleBase/ModuleBase_IOperation.cpp +++ b/src/ModuleBase/ModuleBase_IOperation.cpp @@ -51,6 +51,7 @@ void ModuleBase_IOperation::start() void ModuleBase_IOperation::resume() { + emit resumed(); } void ModuleBase_IOperation::abort() diff --git a/src/ModuleBase/ModuleBase_IOperation.h b/src/ModuleBase/ModuleBase_IOperation.h index 966d26681..b3373e4bf 100644 --- a/src/ModuleBase/ModuleBase_IOperation.h +++ b/src/ModuleBase/ModuleBase_IOperation.h @@ -69,6 +69,7 @@ signals: void aborted(); /// the operation is aborted void committed(); /// the operation is committed void stopped(); /// the operation is aborted or committed + void resumed(); /// the operation is resumed public slots: /// Starts operation diff --git a/src/XGUI/XGUI_OperationMgr.cpp b/src/XGUI/XGUI_OperationMgr.cpp index 00aa7ecc5..ad312dad5 100644 --- a/src/XGUI/XGUI_OperationMgr.cpp +++ b/src/XGUI/XGUI_OperationMgr.cpp @@ -41,6 +41,7 @@ bool XGUI_OperationMgr::startOperation(ModuleBase_Operation* theOperation) connect(theOperation, SIGNAL(stopped()), this, SLOT(onOperationStopped())); connect(theOperation, SIGNAL(started()), this, SIGNAL(operationStarted())); + connect(theOperation, SIGNAL(resumed()), this, SIGNAL(operationResumed())); theOperation->start(); return true; @@ -58,9 +59,6 @@ bool XGUI_OperationMgr::abortOperation() void XGUI_OperationMgr::resumeOperation(ModuleBase_Operation* theOperation) { - connect(theOperation, SIGNAL(stopped()), this, SLOT(onOperationStopped())); - connect(theOperation, SIGNAL(started()), this, SIGNAL(operationStarted())); - theOperation->resume(); } diff --git a/src/XGUI/XGUI_OperationMgr.h b/src/XGUI/XGUI_OperationMgr.h index d57ca5cca..169453b3a 100644 --- a/src/XGUI/XGUI_OperationMgr.h +++ b/src/XGUI/XGUI_OperationMgr.h @@ -53,6 +53,8 @@ signals: /// Signal about an operation is stopped. It is emitted after the stop() of operation is done. /// \param theOperation a stopped operation void operationStopped(ModuleBase_Operation* theOperation); + /// Signal about an operation is resumed. It is emitted after the resume() of operation is done. + void operationResumed(); protected: /// Sets the current operation or NULL diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 1a11dca83..19395870b 100644 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -92,6 +92,7 @@ XGUI_Workshop::XGUI_Workshop(XGUI_SalomeConnector* theConnector) myViewerProxy = new XGUI_ViewerProxy(this); connect(myOperationMgr, SIGNAL(operationStarted()), this, SLOT(onOperationStarted())); + connect(myOperationMgr, SIGNAL(operationResumed()), this, SLOT(onOperationStarted())); connect(myOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)), this, SLOT(onOperationStopped(ModuleBase_Operation*))); connect(this, SIGNAL(errorOccurred(const QString&)), myErrorDlg, SLOT(addError(const QString&))); -- 2.39.2