/// \return the boolean result
std::string getDefaultValue() const { return myDefaultValue; }
+ /// Returns true, if the obligatory value of the widget is not defined in the XML or has true value
+ /// \return the boolean result
+ bool isObligatory() const { return myIsObligatory; }
+
/// Defines if it is supposed that the widget should interact with the viewer.
virtual bool isViewerSelector() { return false; }
if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
/// If last line finished on vertex the lines creation sequence has to be break
ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
+ ModuleBase_ModelWidget* anActiveWidget = aPanel->activeWidget();
const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
- if (aWidgets.last() == aPanel->activeWidget()) {
- myRestartingMode = RM_Forbided;
+ QList<ModuleBase_ModelWidget*>::const_iterator anIt = aWidgets.begin(), aLast = aWidgets.end();
+ bool aFoundWidget = false;
+ bool aFoundNonObligatory = false;
+ for (; anIt != aLast && !aFoundNonObligatory; anIt++) {
+ aFoundWidget = aFoundWidget || *anIt == anActiveWidget;
+ if (!aFoundWidget)
+ continue;
+ aFoundNonObligatory = !(*anIt)->isObligatory();
}
+ if (!aFoundNonObligatory)
+ myRestartingMode = RM_Forbided;
}
}