From: vsv Date: Mon, 15 Jan 2018 12:21:01 +0000 (+0300) Subject: Issue #2388: Take into account attribute ID for remembering of a user choice X-Git-Tag: V_3.0.0RC1~38 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=7e31cffbf3048c4bacad202563bead5732dc66aa;p=modules%2Fshaper.git Issue #2388: Take into account attribute ID for remembering of a user choice --- diff --git a/src/ModuleBase/ModuleBase_PagedContainer.cpp b/src/ModuleBase/ModuleBase_PagedContainer.cpp index 27c685f8b..8ba5a314e 100644 --- a/src/ModuleBase/ModuleBase_PagedContainer.cpp +++ b/src/ModuleBase/ModuleBase_PagedContainer.cpp @@ -40,8 +40,8 @@ ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent, // it is not obligatory to be ignored when property panel tries to activate next active widget // but if focus is moved to this control, it can accept it. myIsObligatory = false; - if (defaultValues.contains(myFeatureId)) - myDefValue = defaultValues[myFeatureId]; + if (defaultValues.contains(myFeatureId + attributeID())) + myDefValue = defaultValues[myFeatureId + attributeID()]; } ModuleBase_PagedContainer::~ModuleBase_PagedContainer() @@ -150,6 +150,6 @@ void ModuleBase_PagedContainer::onPageChanged() void ModuleBase_PagedContainer::onFeatureAccepted() { - defaultValues[myFeatureId] = myDefValue; + defaultValues[myFeatureId + attributeID()] = myDefValue; } diff --git a/src/ModuleBase/ModuleBase_WidgetChoice.cpp b/src/ModuleBase/ModuleBase_WidgetChoice.cpp index 9d48799b6..ea04160b5 100644 --- a/src/ModuleBase/ModuleBase_WidgetChoice.cpp +++ b/src/ModuleBase/ModuleBase_WidgetChoice.cpp @@ -44,9 +44,9 @@ ModuleBase_WidgetChoice::ModuleBase_WidgetChoice(QWidget* theParent, const Config_WidgetAPI* theData) : ModuleBase_ModelWidget(theParent, theData), myIsFirst(true) { - myHasValue = defaultValues.contains(myFeatureId); + myHasValue = defaultValues.contains(myFeatureId + attributeID()); if (myHasValue) - myDefValue = defaultValues[myFeatureId]; + myDefValue = defaultValues[myFeatureId + attributeID()]; else myDefValue = 0; @@ -177,5 +177,5 @@ void ModuleBase_WidgetChoice::onCurrentIndexChanged(int theIndex) void ModuleBase_WidgetChoice::onFeatureAccepted() { - defaultValues[myFeatureId] = myDefValue; + defaultValues[myFeatureId + attributeID()] = myDefValue; } diff --git a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp index a13bdf1d0..17c9f5b6c 100755 --- a/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp +++ b/src/ModuleBase/ModuleBase_WidgetMultiSelector.cpp @@ -160,8 +160,8 @@ ModuleBase_WidgetMultiSelector::ModuleBase_WidgetMultiSelector(QWidget* theParen myIsNeutralPointClear = theData->getBooleanAttribute("clear_in_neutral_point", true); if (myShapeTypes.size() > 1 || myIsUseChoice) { - if (defaultValues.contains(myFeatureId)) { - myDefMode = defaultValues[myFeatureId]; + if (defaultValues.contains(myFeatureId + attributeID())) { + myDefMode = defaultValues[myFeatureId + attributeID()]; myTypeCtrl->setValue(myDefMode.c_str()); } } @@ -990,5 +990,5 @@ QList void ModuleBase_WidgetMultiSelector::onFeatureAccepted() { - defaultValues[myFeatureId] = myDefMode; + defaultValues[myFeatureId + attributeID()] = myDefMode; }