- // set operation description and list of widgets corresponding to the feature xml definition
- std::string aFeatureKind = theFeatureKind.empty() ? theCmdId : theFeatureKind;
-
- std::string aPluginFileName = featureFile(aFeatureKind);
- Config_WidgetReader aWdgReader = Config_WidgetReader(aPluginFileName);
- aWdgReader.readAll();
- std::string aXmlCfg = aWdgReader.featureWidgetCfg(aFeatureKind);
- std::string aDescription = aWdgReader.featureDescription(aFeatureKind);
-
- anOperation->getDescription()->setDescription(QString::fromStdString(aDescription));
- anOperation->getDescription()->setXmlRepresentation(QString::fromStdString(aXmlCfg));
-
- // connect the operation
- PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
- if (aPreviewOp) {
- connect(aPreviewOp, SIGNAL(featureConstructed(ObjectPtr, int)), this,
- SLOT(onFeatureConstructed(ObjectPtr, int)));
- connect(aPreviewOp, SIGNAL(restartRequired(std::string, ObjectPtr)), this,
- SLOT(onRestartOperation(std::string, ObjectPtr)));
- connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)), this,
- SLOT(onMultiSelectionEnabled(bool)));
-
- connect(aPreviewOp, SIGNAL(stopSelection(const QList<ObjectPtr>&, const bool)), this,
- SLOT(onStopSelection(const QList<ObjectPtr>&, const bool)));
- connect(aPreviewOp, SIGNAL(setSelection(const QList<ObjectPtr>&)), this,
- SLOT(onSetSelection(const QList<ObjectPtr>&)));
-
- connect(aPreviewOp, SIGNAL(closeLocalContext()), this, SLOT(onCloseLocalContext()));
-
- PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
- if (aSketchOp) {
- connect(aSketchOp, SIGNAL(planeSelected(double, double, double)), this,
- SLOT(onPlaneSelected(double, double, double)));
- connect(aSketchOp, SIGNAL(fitAllView()), this, SLOT(onFitAllView()));
+void PartSet_Module::onNoMoreWidgets()
+{
+ ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
+ if (aOperation) {
+ /// Restart sketcher operations automatically
+ FeaturePtr aFeature = aOperation->feature();
+ std::shared_ptr<SketchPlugin_Feature> aSPFeature =
+ std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
+ if (aSPFeature) {
+ if (myRestartingMode != RM_Forbided)
+ myRestartingMode = RM_LastFeatureUsed;
+ aOperation->commit();