From: nds Date: Wed, 20 May 2015 13:28:21 +0000 (+0300) Subject: A fix for the "Abort" operation bug. If a control with a validator is active, abort... X-Git-Tag: V_1.2.0~133^2~2 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=9d5fd45a38bb038e90ece0fc599024420c8e909a;p=modules%2Fshaper.git A fix for the "Abort" operation bug. If a control with a validator is active, abort of the operation leads to the crash in the validator. Scenario: create a sketch, start creation of an extrusion, select a sketch, select an orthogonal plane, abort(selector is active). Crash --- diff --git a/src/ModuleBase/ModuleBase_IPropertyPanel.h b/src/ModuleBase/ModuleBase_IPropertyPanel.h index fe8a110e0..3a18c858b 100644 --- a/src/ModuleBase/ModuleBase_IPropertyPanel.h +++ b/src/ModuleBase/ModuleBase_IPropertyPanel.h @@ -35,6 +35,9 @@ public: /// Returns all property panel's widget created by WidgetFactory virtual const QList& modelWidgets() const = 0; + /// Removes all widgets in the widget area of the property panel + virtual void cleanContent() = 0; + /// Editing mode depends on mode of current operation. This value is defined by it. /// \param isEditing state of editing mode flag virtual void setEditingMode(bool isEditing) { myIsEditing = isEditing; } diff --git a/src/ModuleBase/ModuleBase_Operation.cpp b/src/ModuleBase/ModuleBase_Operation.cpp index d877fa3ab..ae623079c 100644 --- a/src/ModuleBase/ModuleBase_Operation.cpp +++ b/src/ModuleBase/ModuleBase_Operation.cpp @@ -189,6 +189,9 @@ void ModuleBase_Operation::abort() emit aborted(); stopOperation(); + // is is necessary to deactivate current widgets before the model operation is aborted + // because abort removes the feature and activated filters should not check it + propertyPanel()->cleanContent(); ModelAPI_Session::get()->abortOperation(); emit stopped(); diff --git a/src/XGUI/XGUI_PropertyPanel.h b/src/XGUI/XGUI_PropertyPanel.h index cc9ba8aeb..bc0934af5 100644 --- a/src/XGUI/XGUI_PropertyPanel.h +++ b/src/XGUI/XGUI_PropertyPanel.h @@ -62,7 +62,7 @@ Q_OBJECT virtual const QList& modelWidgets() const; /// Removes all widgets in the widget area of the property panel - void cleanContent(); + virtual void cleanContent(); /// Returns currently active widget virtual ModuleBase_ModelWidget* activeWidget() const { return myActiveWidget; }