bool ModuleBase_OperationFeature::commit()
{
if (canBeCommitted()) {
+ emit beforeCommitted();
// the widgets of property panel should not process any events come from data mode
// after commit clicked. Some signal such as redisplay/create influence on content
// of the object browser and viewer context. Therefore it influence to the current
SessionPtr aMgr = ModelAPI_Session::get();
/// Set current feature and remeber old current feature
- emit beforeCommitted();
commitOperation();
aMgr->finishOperation();
myRestartingMode = RM_EmptyFeatureUsed;
}
+void PartSet_SketcherReetntrantMgr::onBeforeStopped()
+{
+ ModuleBase_OperationFeature* aFOperation = dynamic_cast<ModuleBase_OperationFeature*>
+ (myWorkshop->currentOperation());
+ if (aFOperation) {
+ disconnect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
+ disconnect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
+ }
+ if (!isActiveMgr())
+ return;
+
+ if (!myIsInternalEditOperation)
+ return;
+
+ PartSet_Module* aModule = module();
+ ModuleBase_ModelWidget* aFirstWidget = aModule->activeWidget();
+ ModuleBase_IPropertyPanel* aPanel = aModule->currentOperation()->propertyPanel();
+ if (aFirstWidget != aPanel->activeWidget()) {
+ ModuleBase_WidgetSelector* aWSelector = dynamic_cast<ModuleBase_WidgetSelector*>(aFirstWidget);
+ if (aWSelector)
+ aWSelector->activateSelectionAndFilters(false);
+ }
+}
+
bool PartSet_SketcherReetntrantMgr::canBeCommittedByPreselection()
{
return !isActiveMgr() || myRestartingMode == RM_None;
if (anOperationFeature.get() != NULL) {
myIsInternalEditOperation = true;
+ connect(aFOperation, SIGNAL(beforeCommitted()), this, SLOT(onBeforeStopped()));
+ connect(aFOperation, SIGNAL(beforeAborted()), this, SLOT(onBeforeStopped()));
+
// activate selection filters of the first widget in the viewer
onWidgetActivated();
/// for initialization of a new started operation.
void onEnterReleased();
+ /// Deactivates selection and filters of the first operation widget if it is an internal
+ /// 'edit' operation
+ void onBeforeStopped();
+
private:
/// Returns true if the current operation is a sketch or a nested sketch operation
bool isActiveMgr() const;