]> SALOME platform Git repositories - modules/shaper.git/commitdiff
Salome HOME
Issue #2024 - Redesign of circle and arc of circle: fill Reference Attribute
authornds <nds@opencascade.com>
Mon, 20 Mar 2017 10:23:50 +0000 (13:23 +0300)
committernds <nds@opencascade.com>
Mon, 20 Mar 2017 10:23:50 +0000 (13:23 +0300)
See preview button visibility in Property Panel should be read from XML definition of the feature

src/Config/Config_FeatureReader.cpp
src/XGUI/XGUI_Workshop.cpp

index f22337d073cf35d76be6a6f8649176b85f38bfa9..6a27228a3d5846190b5ee7238784f0d2808750df 100644 (file)
@@ -145,6 +145,8 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode,
   outFeatureMessage->setActionsWhenNested(getNormalizedProperty(theFeatureNode,
                                           FEATURE_WHEN_NESTED));
   outFeatureMessage->setModal(getBooleanAttribute(theFeatureNode, FEATURE_MODAL, false));
+  bool isAutoPreview = getBooleanAttribute(theFeatureNode, FEATURE_AUTO_PREVIEW, true);
+  outFeatureMessage->setAutoPreview(isAutoPreview);
 
   bool isInternal = getBooleanAttribute(theFeatureNode, ATTR_INTERNAL, false);
   outFeatureMessage->setInternal(isInternal);
@@ -168,6 +170,4 @@ void Config_FeatureReader::fillFeature(xmlNodePtr theFeatureNode,
     aDocKind = restoreAttribute(NODE_WORKBENCH, WORKBENCH_DOC);
   }
   outFeatureMessage->setDocumentKind(aDocKind);
-  bool isAutoPreview = getBooleanAttribute(theFeatureNode, FEATURE_AUTO_PREVIEW, true);
-  outFeatureMessage->setAutoPreview(isAutoPreview);
 }
index fa48ac096d22facd30d443615e2233274e4ae810..5ce072b92abc6627a0052d14f7d85977050326f3 100755 (executable)
@@ -81,6 +81,8 @@
 #include <Config_PropManager.h>
 #include <Config_DataModelReader.h>
 #include <Config_Translator.h>
+#include <Config_WidgetAPI.h>
+#include <Config_Keywords.h>
 
 #include <SUIT_ResourceMgr.h>
 
@@ -587,7 +589,15 @@ void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation)
 #else
   AppElements_MainMenu* aMenuBar = mainWindow()->menuObject();
   AppElements_Command* aCommand = aMenuBar->feature(aFeatureKind.c_str());
-  bool anIsAutoPreview = aCommand && aCommand->featureMessage()->isAutoPreview();
+  bool anIsAutoPreview = true;
+  if (aCommand)
+    anIsAutoPreview = aCommand->featureMessage()->isAutoPreview();
+  else {
+    std::string aXmlCfg, aDescription;
+    module()->getXMLRepresentation(aFeatureKind, aXmlCfg, aDescription);
+    ModuleBase_WidgetFactory aFactory(aXmlCfg, moduleConnector());
+    anIsAutoPreview = aFactory.widgetAPI()->getBooleanAttribute(FEATURE_AUTO_PREVIEW, true);
+  }
 #endif
   if (!anIsAutoPreview) {
     myPropertyPanel->findButton(PROP_PANEL_PREVIEW)->setVisible(true);