]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Fix Field GUI bugs
authorvsv <vitaly.smetannikov@opencascade.com>
Fri, 25 Nov 2016 11:56:22 +0000 (14:56 +0300)
committervsv <vitaly.smetannikov@opencascade.com>
Fri, 25 Nov 2016 11:56:22 +0000 (14:56 +0300)
src/CollectionPlugin/CollectionPlugin_WidgetField.cpp
src/XGUI/XGUI_ContextMenuMgr.cpp

index 273683e26a911775bb18f9e8ac5a50d419c0a9ac..faf974a2fb4ae6d37ed6de47f0991d1d8f5b709c 100644 (file)
@@ -468,9 +468,9 @@ bool CollectionPlugin_WidgetField::restoreValueCustom()
   DataPtr aData = myFeature->data();
 
   AttributeSelectionListPtr aSelList = aData->selectionList(CollectionPlugin_Field::SELECTED_ID());
-  if (!aSelList->isInitialized())
-    return false;
   std::string aTypeStr = aSelList->selectionType();
+  if (aTypeStr == "")
+    return false; // The attribute is not initialized
   myShapeTypeCombo->setCurrentIndex(getSelectionType(aTypeStr));
 
   // Get number of components
index b99cfdd6b3aae3a3fd58c1336b82a6dc3ee8ff82..5ec4d3f083bcd5985f350c142a5247a17828c917 100644 (file)
@@ -28,6 +28,7 @@
 #include <ModelAPI_ResultConstruction.h>
 #include <ModelAPI_ResultBody.h>
 #include <ModelAPI_Tools.h>
+#include <ModelAPI_ResultField.h>
 
 #include <Config_DataModelReader.h>
 
@@ -471,6 +472,7 @@ void XGUI_ContextMenuMgr::buildObjBrowserMenu()
   myObjBrowserMenus[ModelAPI_ResultBody::group()] = aList;
   // Group menu
   myObjBrowserMenus[ModelAPI_ResultGroup::group()] = aList;
+  myObjBrowserMenus[ModelAPI_ResultField::group()] = aList;
   // Result part menu
   myObjBrowserMenus[ModelAPI_ResultPart::group()] = aList;
   //-------------------------------------
@@ -519,6 +521,7 @@ void XGUI_ContextMenuMgr::buildViewerMenu()
   myViewerMenu[ModelAPI_ResultBody::group()] = aList;
   // Group menu
   myViewerMenu[ModelAPI_ResultGroup::group()] = aList;
+  myViewerMenu[ModelAPI_ResultField::group()] = aList;
   //-------------------------------------
 }