From: rnv Date: Thu, 10 Nov 2011 07:49:34 +0000 (+0000) Subject: Fix for the bug TC 6.4.0: Rename popup item disappeared from pop-up for View Params... X-Git-Tag: RELIQUAT_6x_15112011~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=d6112376d19342e920c886ca0ca422248dc63021;p=modules%2Fvisu.git Fix for the bug TC 6.4.0: Rename popup item disappeared from pop-up for View Params object. --- diff --git a/src/VISUGUI/VisuGUI.cxx b/src/VISUGUI/VisuGUI.cxx index 03c463be..8cd34066 100644 --- a/src/VISUGUI/VisuGUI.cxx +++ b/src/VISUGUI/VisuGUI.cxx @@ -4946,6 +4946,11 @@ bool VisuGUI::renameAllowed( const QString& entry) const { aType == VISU::TPOINTMAP3D || aType == VISU::TVIEW3D || aType == VISU::TPOINTMAP3D || aType == VISU::TGAUSSPOINTS) return true; + } else { + VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject); + bool anIsExist; + QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist); + return anIsExist && "VIEW3D" == aVal; } return false; } @@ -4966,6 +4971,7 @@ bool VisuGUI::renameObject( const QString& entry, const QString& name) { _PTR(SObject) aSObject = anObjectInfo.mySObject; if (aSObject) { VISU::Base_i* aBase = anObjectInfo.myBase; + VISU::Storable::TRestoringMap aMap = VISU::Storable::GetStorableMap(anObjectInfo.mySObject); if(aBase){ VISU::VISUType aType = aBase->GetType(); if( aType == VISU::TCOLOREDPRS3DHOLDER ) { @@ -5033,6 +5039,19 @@ bool VisuGUI::renameObject( const QString& entry, const QString& name) { return true; } } + //Rename visual params + } + } else { + bool anIsExist; + QString aVal = VISU::Storable::FindValue(aMap, "myComment", &anIsExist); + if(anIsExist && "VIEW3D" == aVal) { + _PTR(GenericAttribute) anAttr; + if (aSObject->FindAttribute(anAttr, "AttributeName")) { + _PTR(AttributeName) aName (anAttr); + if (!name.isEmpty()) { + aName->SetValue(qPrintable(name)); + } + } } } }