Salome HOME
updated copyright message
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetChoice.cpp
index ea04160b52f36ff0e1af50ffa770e24f68448f57..4f52685f379732730a6f8f46b69f03aa8260ec4f 100644 (file)
@@ -1,4 +1,4 @@
-// Copyright (C) 2014-2017  CEA/DEN, EDF R&D
+// Copyright (C) 2014-2023  CEA, EDF
 //
 // This library is free software; you can redistribute it and/or
 // modify it under the terms of the GNU Lesser General Public
 //
 // You should have received a copy of the GNU Lesser General Public
 // License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
+// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or
-// email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 
 #include "ModuleBase_WidgetChoice.h"
@@ -32,7 +31,6 @@
 #include <QWidget>
 #include <QLayout>
 #include <QLabel>
-#include <QComboBox>
 #include <QButtonGroup>
 #include <QGroupBox>
 #include <QRadioButton>
@@ -133,16 +131,23 @@ bool ModuleBase_WidgetChoice::restoreValueCustom()
         myChoiceCtrl->setChoiceList(aChoiceList);
       }
     }
-    if (aIntAttr->isInitialized())
+    if (aIntAttr->isInitialized()) {
       myChoiceCtrl->setValue(aIntAttr->value());
+
+      myChoiceCtrl->blockSignals(isBlocked);
+      emit itemSelected(this, aIntAttr->value());
+      myDefValue = aIntAttr->value();
+    }
     else {
       bool aHasDefaultValue;
       int aDefaultVal = QString::fromStdString(getDefaultValue()).toInt(&aHasDefaultValue);
-      myChoiceCtrl->setValue(aHasDefaultValue ? aDefaultVal : 0);
+      int aVal = aHasDefaultValue ? aDefaultVal : 0;
+      myChoiceCtrl->setValue(aVal);
+
+      myChoiceCtrl->blockSignals(isBlocked);
+      emit itemSelected(this, aVal);
+      myDefValue = aVal;
     }
-    myChoiceCtrl->blockSignals(isBlocked);
-    emit itemSelected(this, aIntAttr->value());
-    myDefValue = aIntAttr->value();
     myIsFirst = false;
   }
   return true;