]> SALOME platform Git repositories - modules/visu.git/commitdiff
Salome HOME
Fix for the bug TC 6.4.0: Rename popup item disappeared from pop-up for View Params...
authorrnv <rnv@opencascade.com>
Thu, 10 Nov 2011 07:49:34 +0000 (07:49 +0000)
committerrnv <rnv@opencascade.com>
Thu, 10 Nov 2011 07:49:34 +0000 (07:49 +0000)
src/VISUGUI/VisuGUI.cxx

index 03c463be8f23075c8fd191b2659a93d9e0b368bf..8cd34066962d6786a1ab90c05af5ceeaa1824bd7 100644 (file)
@@ -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));
+         }
+       }
       }
     }
   }