From 21cd0c4f7aa8094cbe90fbe5f52d96dc33ed98c7 Mon Sep 17 00:00:00 2001 From: apo Date: Thu, 1 Sep 2005 13:30:47 +0000 Subject: [PATCH] Fix a regression with popup menu --- src/VISUGUI/VisuGUI_PopupTools.cxx | 63 +++++++++++++++++++----------- 1 file changed, 40 insertions(+), 23 deletions(-) diff --git a/src/VISUGUI/VisuGUI_PopupTools.cxx b/src/VISUGUI/VisuGUI_PopupTools.cxx index 74175dff..1fd75e5f 100644 --- a/src/VISUGUI/VisuGUI_PopupTools.cxx +++ b/src/VISUGUI/VisuGUI_PopupTools.cxx @@ -65,34 +65,51 @@ QString VisuGUI_Selection::type( const int ind ) const QString aResStr; VISU::Storable::TRestoringMap aMap; CORBA::Object_var anObject = GetSelectedObj( study(), entry( ind ), &aMap ); - bool isExist; - const QString& aVal = VISU::Storable::FindValue(aMap,"myComment",&isExist); - if ( isExist ) - aResStr = "VISU::T" + aVal; - else{ - VISU::Base_var aVisuObj = VISU::Base::_narrow( anObject ); - if ( !CORBA::is_nil( aVisuObj ) ){ - VISU::VISUType aType = aVisuObj->GetType(); + + VISU::Base_var aVisuObj = VISU::Base::_narrow( anObject ); + if ( !CORBA::is_nil( aVisuObj ) ){ + VISU::VISUType aType = aVisuObj->GetType(); + switch (aType) { + ENUM2STRING( aResStr, VISU::TVISUGEN ); + ENUM2STRING( aResStr, VISU::TRESULT ); + ENUM2STRING( aResStr, VISU::TTABLE ); + ENUM2STRING( aResStr, VISU::TCURVE ); + ENUM2STRING( aResStr, VISU::TCONTAINER ); + ENUM2STRING( aResStr, VISU::TMESH ); + ENUM2STRING( aResStr, VISU::TSCALARMAP ); + ENUM2STRING( aResStr, VISU::TISOSURFACE ); + ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE ); + ENUM2STRING( aResStr, VISU::TCUTPLANES ); + ENUM2STRING( aResStr, VISU::TCUTLINES ); + ENUM2STRING( aResStr, VISU::TVECTORS ); + ENUM2STRING( aResStr, VISU::TSTREAMLINES ); + ENUM2STRING( aResStr, VISU::TPLOT3D ); + ENUM2STRING( aResStr, VISU::TANIMATION ); + } + } + + if(aResStr.isNull()){ + bool isExist; + VISU::VISUType aType = (VISU::VISUType)VISU::Storable::FindValue( aMap, "myType", &isExist).toInt(); + if( isExist ){ switch (aType) { - ENUM2STRING( aResStr, VISU::TVISUGEN ); - ENUM2STRING( aResStr, VISU::TRESULT ); - ENUM2STRING( aResStr, VISU::TTABLE ); - ENUM2STRING( aResStr, VISU::TCURVE ); - ENUM2STRING( aResStr, VISU::TCONTAINER ); - ENUM2STRING( aResStr, VISU::TMESH ); - ENUM2STRING( aResStr, VISU::TSCALARMAP ); - ENUM2STRING( aResStr, VISU::TISOSURFACE ); - ENUM2STRING( aResStr, VISU::TDEFORMEDSHAPE ); - ENUM2STRING( aResStr, VISU::TCUTPLANES ); - ENUM2STRING( aResStr, VISU::TCUTLINES ); - ENUM2STRING( aResStr, VISU::TVECTORS ); - ENUM2STRING( aResStr, VISU::TSTREAMLINES ); - ENUM2STRING( aResStr, VISU::TPLOT3D ); - ENUM2STRING( aResStr, VISU::TANIMATION ); + ENUM2STRING( aResStr, VISU::TENTITY ); + ENUM2STRING( aResStr, VISU::TFAMILY ); + ENUM2STRING( aResStr, VISU::TGROUP ); + ENUM2STRING( aResStr, VISU::TVIEW3D ); + ENUM2STRING( aResStr, VISU::TFIELD ); + ENUM2STRING( aResStr, VISU::TTIMESTAMP ); } } } + if(aResStr.isNull()){ + bool isExist; + const QString& aVal = VISU::Storable::FindValue(aMap,"myComment",&isExist); + if ( isExist ) + aResStr = "VISU::T" + aVal; + } + return aResStr; } -- 2.39.2