From d027f97672e8e234da8f5c3881f7cb07eaf3652c Mon Sep 17 00:00:00 2001 From: jfa Date: Tue, 24 Nov 2020 15:01:49 +0300 Subject: [PATCH] bos #19960: [CEA 19958] Show/Hide SHAPERSTUDY objects --- src/LightApp/LightApp_Module.cxx | 4 ++-- src/LightApp/LightApp_Selection.cxx | 12 ++++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/src/LightApp/LightApp_Module.cxx b/src/LightApp/LightApp_Module.cxx index da1d8a70c..3a10b55fb 100644 --- a/src/LightApp/LightApp_Module.cxx +++ b/src/LightApp/LightApp_Module.cxx @@ -458,9 +458,9 @@ QtxPopupMgr* LightApp_Module::popupMgr() myPopupMgr->insert( eraseAll, -1, 0 ); myPopupMgr->insert( separator(), -1, 0 ); - QString oneAndNotActive = "( count( $component ) = 1 ) and ( not( activeModule in $component ) )"; + QString oneAndNotActive = "( count( $component ) = 1 ) and ( not( activeModule in $component ) ) and ( not($displayer={'%3'}) )"; QString uniform = "true in $canBeDisplayed and %1 and ( activeModule = '%2' )"; - uniform = uniform.arg( oneAndNotActive ).arg( name() ); + uniform = uniform.arg( oneAndNotActive ).arg( name() ).arg( LightApp_Application::moduleDisplayer( moduleName() ) ); myPopupMgr->setRule( disp, /*QString( "( not isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule ); myPopupMgr->setRule( erase, /*QString( "( isVisible ) and " ) + */ uniform, QtxPopupMgr::VisibleRule ); myPopupMgr->setRule( dispOnly, uniform, QtxPopupMgr::VisibleRule ); diff --git a/src/LightApp/LightApp_Selection.cxx b/src/LightApp/LightApp_Selection.cxx index b5b6ec743..493e311df 100644 --- a/src/LightApp/LightApp_Selection.cxx +++ b/src/LightApp/LightApp_Selection.cxx @@ -226,8 +226,16 @@ QVariant LightApp_Selection::parameter( const int idx, const QString& p ) const vis = LightApp_Displayer().IsDisplayed( e ); v = vis; } - else if ( p == "component" || p == "displayer" ) - v = myStudy->componentDataType( e ); + + //else if ( p == "component" || p == "displayer" ) + // v = myStudy->componentDataType( e ); + else if ( p == "component" ) + v = myStudy->componentDataType( e ); + else if ( p == "displayer" ) { + QString mod_name = app->moduleTitle( myStudy->componentDataType( e ) ); + v = LightApp_Application::moduleDisplayer( mod_name ); + } + else if ( p == "isComponent" ) v = myStudy->isComponent( e ); else if ( p == "isReference" ) -- 2.39.2