Salome HOME
23599: EDF 17907 - Gnome freezes when suppressing horde of groups
[modules/smesh.git] / src / SMESHGUI / SMESHGUI.cxx
index 1225963f69b6af8558c3af9f92c514c5bc047428..1bf93ec85426cdc3d00c208c1c7250d331930b53 100644 (file)
@@ -1855,6 +1855,7 @@ void SMESHGUI::OnEditDelete()
   _PTR(GenericAttribute) anAttr;
   _PTR(AttributeIOR) anIOR;
 
+  const int objectCountLimit = 30; // PAL23599
   int objectCount = 0;
   QString aNameList;
   QString aParentComponent = QString::null;
@@ -1864,29 +1865,33 @@ void SMESHGUI::OnEditDelete()
     Handle(SALOME_InteractiveObject) anIO = anIt.Value();
     if ( anIO.IsNull() ) continue;
     
-    QString father = "unknown";
+    QString father = "unknown", name;
 
     _PTR(SObject) aSO = aStudy->FindObjectID( anIO->getEntry() );
     if (aSO) {
       father = QString::fromStdString( aSO->GetFatherComponent()->ComponentDataType() );
       // check if object is reference
       _PTR(SObject) aRefSObj;
-      aNameList.append("\n    - ");
       if ( aSO->ReferencedObject( aRefSObj ) ) {
-        QString aRefName = QString::fromStdString ( aRefSObj->GetName() );
-        aNameList.append( aRefName );
+        name = QString::fromStdString ( aRefSObj->GetName() );
         father = QString::fromStdString ( aRefSObj->GetFatherComponent()->ComponentDataType() );
       }
       else
-        aNameList.append(anIO->getName());
+        name = anIO->getName();
       objectCount++;
     }
+    if ( objectCount < objectCountLimit ) { // avoid occupying the whole screen
+      aNameList.append("\n    - ");
+      aNameList.append( name );
+    }
 
     if( aParentComponent.isNull() )
       aParentComponent = father;
     else if( !aParentComponent.isEmpty() && aParentComponent!=father )
       aParentComponent = "";
   }
+  if ( objectCount >= objectCountLimit )
+    aNameList.append("\n    - ...");
 
   if ( objectCount == 0 )
     return; // No Valid Objects Selected
@@ -5442,7 +5447,7 @@ void SMESHGUI::preferencesChanged( const QString& sect, const QString& name )
          name=="selection_precision_node"    ||
          name=="selection_precision_element" ||
          name=="selection_precision_object"   ||
-        name=="selection_increment")
+         name=="selection_increment")
     {
       SMESH::UpdateSelectionProp( this );
     }