Extend the correction to commit/abort/stop signals. The call of the module functionailty should be direct and from the workshop
ModuleBase_IModule::ModuleBase_IModule(ModuleBase_IWorkshop* theParent)
: QObject(theParent), myWorkshop(theParent)
{
- connect(myWorkshop, SIGNAL(operationStopped(ModuleBase_Operation*)),
- SLOT(onOperationStopped(ModuleBase_Operation*)));
-
- connect(myWorkshop, SIGNAL(operationComitted(ModuleBase_Operation*)),
- SLOT(onOperationComitted(ModuleBase_Operation*)));
-
- connect(myWorkshop, SIGNAL(operationAborted(ModuleBase_Operation*)),
- SLOT(onOperationAborted(ModuleBase_Operation*)));
-
connect(myWorkshop, SIGNAL(selectionChanged()), this, SLOT(onSelectionChanged()));
/// \param theOperation a resumed operation\r
virtual void operationResumed(ModuleBase_Operation* theOperation) {}\r
\r
+ /// Realizes some functionality by an operation stop\r
+ virtual void operationStopped(ModuleBase_Operation* theOperation) {}\r
+\r
+ /// Realizes some functionality by an operation commit\r
+ virtual void operationCommitted(ModuleBase_Operation* theOperation) {}\r
+\r
+ /// Realizes some functionality by an operation abort\r
+ virtual void operationAborted(ModuleBase_Operation* theOperation) {}\r
+\r
/// Called when it is necessary to update a command state (enable or disable it)\r
//virtual bool isFeatureEnabled(const QString& theCmdId) const = 0;\r
\r
void onFeatureTriggered();\r
\r
protected slots:\r
- /// SLOT, that is called after the operation is stopped. Switched off the modfications performed\r
- /// by the operation start\r
- virtual void onOperationStopped(ModuleBase_Operation* theOperation) {}\r
-\r
-\r
- virtual void onOperationComitted(ModuleBase_Operation* theOperation) {}\r
-\r
- virtual void onOperationAborted(ModuleBase_Operation* theOperation) {}\r
-\r
-\r
/// Called on selection changed event\r
virtual void onSelectionChanged() {}\r
\r
signals:
void selectionChanged();
- /// Signal about an operation is started. It is emitted after the start() of operation is done.
- void operationStarted(ModuleBase_Operation* theOperation);
-
- /// 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(ModuleBase_Operation* theOperation);
-
- /// Emitted when current operation is comitted
- void operationComitted(ModuleBase_Operation* theOperation);
-
- /// Emitted when current operation is aborted
- void operationAborted(ModuleBase_Operation* theOperation);
-
/// Signal which is emited after activation of property panel
void propertyPanelActivated();
aFactory->registerFilter("LinearEdgeFilter", new ModuleBase_FilterLinearEdge);
}
-void PartSet_Module::onOperationComitted(ModuleBase_Operation* theOperation)
+void PartSet_Module::operationCommitted(ModuleBase_Operation* theOperation)
{
if (theOperation->isEditOperation())
return;
myRestartingMode = RM_None;
}
-void PartSet_Module::onOperationAborted(ModuleBase_Operation* theOperation)
+void PartSet_Module::operationAborted(ModuleBase_Operation* theOperation)
{
breakOperationSequence();
}
myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter);
}
-void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
+void PartSet_Module::operationStopped(ModuleBase_Operation* theOperation)
{
if (theOperation->id().toStdString() == SketchPlugin_Sketch::ID()) {
DataPtr aData = myCurrentSketch->data();
QStringList sketchOperationIdList() const;
/// Realizes some functionality by an operation start
+ /// Displays all sketcher sub-Objects, hides sketcher result, appends selection filters
/// \param theOperation a started operation
virtual void operationStarted(ModuleBase_Operation* theOperation);
+ /// Realizes some functionality by an operation commit
+ /// Restarts sketcher operation automatically of it is necessary
+ /// \param theOperation a committed operation
+ virtual void operationCommitted(ModuleBase_Operation* theOperation);
+
+ /// Realizes some functionality by an operation abort
+ /// Hides all sketcher sub-Objects, displays sketcher result and removes selection filters
+ /// \param theOperation an aborted operation
+ virtual void operationAborted(ModuleBase_Operation* theOperation);
+
+ /// Realizes some functionality by an operation stop
+ /// Hides all sketcher sub-Objects, displays sketcher result and removes selection filters
+ /// \param theOperation a stopped operation
+ virtual void operationStopped(ModuleBase_Operation* theOperation);
+
public slots:
/// SLOT, that is called by no more widget signal emitted by property panel
/// Set a specific flag to restart the sketcher operation
void onNoMoreWidgets();
protected slots:
- /// Called when previous operation is finished
- virtual void onOperationComitted(ModuleBase_Operation* theOperation);
-
- virtual void onOperationAborted(ModuleBase_Operation* theOperation);
-
- virtual void onOperationStopped(ModuleBase_Operation* theOperation);
-
/// Called when previous operation is finished
virtual void onSelectionChanged();
XGUI_OperationMgr* anOperationMgr = myWorkshop->operationMgr();
- connect(anOperationMgr, SIGNAL(operationStarted(ModuleBase_Operation*)),
- SIGNAL(operationStarted(ModuleBase_Operation*)));
- connect(anOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)),
- SIGNAL(operationStopped(ModuleBase_Operation*)));
- connect(anOperationMgr, SIGNAL(operationResumed(ModuleBase_Operation*)),
- SIGNAL(operationResumed(ModuleBase_Operation*)));
- connect(anOperationMgr, SIGNAL(operationComitted(ModuleBase_Operation*)),
- SIGNAL(operationComitted(ModuleBase_Operation*)));
- connect(anOperationMgr, SIGNAL(operationAborted(ModuleBase_Operation*)),
- SIGNAL(operationAborted(ModuleBase_Operation*)));
-
//myDocumentShapeFilter = new ModuleBase_ShapeDocumentFilter(this);
}
connect(theOperation, SIGNAL(started()), SLOT(onOperationStarted()));
connect(theOperation, SIGNAL(aborted()), SLOT(onOperationAborted()));
- connect(theOperation, SIGNAL(committed()), SLOT(onOperationComitted()));
+ connect(theOperation, SIGNAL(committed()), SLOT(onOperationCommitted()));
connect(theOperation, SIGNAL(stopped()), SLOT(onOperationStopped()));
connect(theOperation, SIGNAL(resumed()), SLOT(onOperationResumed()));
connect(theOperation, SIGNAL(activatedByPreselection()),
emit operationAborted(aSenderOperation);
}
-void XGUI_OperationMgr::onOperationComitted()
+void XGUI_OperationMgr::onOperationCommitted()
{
ModuleBase_Operation* aSenderOperation = dynamic_cast<ModuleBase_Operation*>(sender());
- emit operationComitted(aSenderOperation);
+ emit operationCommitted(aSenderOperation);
}
void XGUI_OperationMgr::onOperationResumed()
/// Signal about an operation is resumed. It is emitted after the resume() of operation is done.
void operationResumed(ModuleBase_Operation* theOperation);
- /// Emitted when current operation is comitted
- void operationComitted(ModuleBase_Operation* theOperation);
+ /// Emitted when current operation is Committed
+ void operationCommitted(ModuleBase_Operation* theOperation);
/// Emitted when current operation is aborted
void operationAborted(ModuleBase_Operation* theOperation);
void onOperationStopped();
void onOperationStarted();
void onOperationAborted();
- void onOperationComitted();
+ void onOperationCommitted();
void onOperationResumed();
private:
SLOT(onOperationResumed(ModuleBase_Operation*)));
connect(myOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)),
SLOT(onOperationStopped(ModuleBase_Operation*)));
+ connect(myOperationMgr, SIGNAL(operationCommitted(ModuleBase_Operation*)),
+ SLOT(onOperationCommitted(ModuleBase_Operation*)));
+ connect(myOperationMgr, SIGNAL(operationAborted(ModuleBase_Operation*)),
+ SLOT(onOperationAborted(ModuleBase_Operation*)));
connect(myMainWindow, SIGNAL(exitKeySequence()), SLOT(onExit()));
// TODO(sbh): It seems that application works properly without update on operationStarted
connect(myOperationMgr, SIGNAL(operationStarted(ModuleBase_Operation*)),
for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
myDisplayer->activate(*aIt);
}
+ myModule->operationStopped(theOperation);
+}
+
+
+void XGUI_Workshop::onOperationCommitted(ModuleBase_Operation* theOperation)
+{
+ myModule->operationCommitted(theOperation);
+}
+
+void XGUI_Workshop::onOperationAborted(ModuleBase_Operation* theOperation)
+{
+ myModule->operationAborted(theOperation);
}
void XGUI_Workshop::setNestedFeatures(ModuleBase_Operation* theOperation)
/// SLOT, that is called after the operation is stopped. Update workshop state, e.g.
/// hides the property panel and udpate the command status.
/// \param theOpertion a stopped operation
- void onOperationStopped(ModuleBase_Operation* theOperation);
+ virtual void onOperationStopped(ModuleBase_Operation* theOperation);
+
+ /// SLOT, that is called after the operation is committed.
+ /// \param theOpertion a commmitted operation
+ virtual void onOperationCommitted(ModuleBase_Operation* theOperation);
+
+ /// SLOT, that is called after the operation is aborted.
+ /// \param theOpertion an aborted operation
+ void onOperationAborted(ModuleBase_Operation* theOperation);
void onContextMenuCommand(const QString& theId, bool isChecked);