From 3cb38f9cb1d9e857b2b8836b2712292ecfe97e8e Mon Sep 17 00:00:00 2001 From: nds Date: Tue, 28 Mar 2017 07:49:53 +0300 Subject: [PATCH] Circle: correction for crash by edit circle in SALOME mode --- src/XGUI/XGUI_Workshop.cpp | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/XGUI/XGUI_Workshop.cpp b/src/XGUI/XGUI_Workshop.cpp index 7188c561e..499c14b48 100755 --- a/src/XGUI/XGUI_Workshop.cpp +++ b/src/XGUI/XGUI_Workshop.cpp @@ -586,22 +586,25 @@ void XGUI_Workshop::fillPropertyPanel(ModuleBase_Operation* theOperation) ModuleBase_Tools::flushUpdated(aFeature); // update visible state of Preview button + std::shared_ptr aFeatureInfo; #ifdef HAVE_SALOME - bool anIsAutoPreview = - mySalomeConnector->featureInfo(aFeatureKind.c_str())->isAutoPreview(); + aFeatureInfo = mySalomeConnector->featureInfo(aFeatureKind.c_str()); #else AppElements_MainMenu* aMenuBar = mainWindow()->menuObject(); AppElements_Command* aCommand = aMenuBar->feature(aFeatureKind.c_str()); - bool anIsAutoPreview = true; if (aCommand) - anIsAutoPreview = aCommand->featureMessage()->isAutoPreview(); + aFeatureInfo = aCommand->featureMessage(); +#endif + bool anIsAutoPreview = true; + if (aFeatureInfo.get()) + aFeatureInfo->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); // send signal about preview should not be computed automatically, click on preview -- 2.39.2