From: nds Date: Tue, 28 Mar 2017 04:49:53 +0000 (+0300) Subject: Circle: correction for crash by edit circle in SALOME mode X-Git-Tag: V_2.7.0~172 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=3cb38f9cb1d9e857b2b8836b2712292ecfe97e8e;p=modules%2Fshaper.git Circle: correction for crash by edit circle in SALOME mode --- 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