ModuleBase_PagedContainer::ModuleBase_PagedContainer(QWidget* theParent,
const Config_WidgetAPI* theData)
: ModuleBase_ModelWidget(theParent, theData),
- myIsFocusOnCurrentPage(false), myIsFirst(true)
+ myIsFocusOnCurrentPage(false), myIsFirst(true), myRemeberChoice(true)
{
// 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.
// A rare case when plugin was not loaded.
if(!myFeature)
return false;
+
+ std::string aDefVal = myRemeberChoice? myDefValue : "";
+
DataPtr aData = myFeature->data();
AttributeStringPtr aStringAttr = aData->string(attributeID());
- QString aCaseId = QString::fromStdString(myDefValue.empty()?
- aStringAttr->value() : myDefValue);
+ QString aCaseId = QString::fromStdString(aDefVal.empty()?
+ aStringAttr->value() : aDefVal);
myIsFirst = false;
int idx = myCaseIds.indexOf(aCaseId);
if (idx == -1)
void ModuleBase_PagedContainer::onFeatureAccepted()
{
- defaultValues[myFeatureId + attributeID()] = myDefValue;
+ if (myRemeberChoice)
+ defaultValues[myFeatureId + attributeID()] = myDefValue;
}
/// Redefinition of virtual function
virtual bool restoreValueCustom();
+ // A flag which let to remeber last user choice and restore it on next launch
+ bool myRemeberChoice;
+
protected slots:
/// A slot called on page change
void onPageChanged();
const Config_WidgetAPI* theData)
: ModuleBase_PagedContainer(theParent, theData)
{
+ myRemeberChoice = false;
QVBoxLayout* aMainLay = new QVBoxLayout(this);
//aMainLay->setContentsMargins(2, 4, 2, 2);
ModuleBase_Tools::adjustMargins(aMainLay);