Salome HOME
Update copyright information
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MultiEditDlg.cxx
index 20b35b8ba135bf23a254ad09cae29122dc6cfd8d..b1d62fb53bb14ca16fc7566fb8cc60a8fd177229 100755 (executable)
@@ -1,6 +1,6 @@
-//  SMESH SMESHGUI : GUI for SMESH component
+//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
+//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
 //  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
 //
 //  This library is free software; you can redistribute it and/or
 //  License along with this library; if not, write to the Free Software
 //  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
-//
-//
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+//  SMESH SMESHGUI : GUI for SMESH component
 //  File   : SMESHGUI_MultiEditDlg.cxx
 //  Author : Sergey LITONIN
 //  Module : SMESH
-
+//
 #include "SMESHGUI_MultiEditDlg.h"
 
 #include "SMESHGUI.h"
@@ -242,10 +241,10 @@ QFrame* SMESHGUI_MultiEditDlg::createButtonFrame (QWidget* theParent)
 
   QHBoxLayout* aLay = new QHBoxLayout (aFrame, MARGIN, SPACING);
 
-  aLay->addWidget(myApplyBtn);
-  aLay->addWidget(myCloseBtn);
   aLay->addWidget(myOkBtn);
+  aLay->addWidget(myApplyBtn);
   aLay->addItem(aSpacer);
+  aLay->addWidget(myCloseBtn);
   aLay->addWidget(myHelpBtn);
 
   return aFrame;
@@ -543,7 +542,7 @@ void SMESHGUI_MultiEditDlg::onSelectionDone()
     } else {
       aNameEdit->clear();
     }
-  } else if (nbSel == 1) {
+  } else if (nbSel > 0) {
     QString aListStr = "";
     Handle(SALOME_InteractiveObject) anIO = aList.First();
     int aNbItems = SMESH::GetNameOfSelectedElements(mySelector,anIO,aListStr);
@@ -559,7 +558,7 @@ void SMESHGUI_MultiEditDlg::onSelectionDone()
     myMesh = SMESH::GetMeshByIO(anIO);
   }
 
-  if (nbSel == 1) {
+  if (nbSel > 0) {
     myActor = SMESH::FindActorByEntry(aList.First()->getEntry());
     if (!myActor)
       myActor = SMESH::FindActorByObject(myMesh);
@@ -687,7 +686,7 @@ void SMESHGUI_MultiEditDlg::onAddBtn()
   TColStd_IndexedMapOfInteger toBeAdded;
 
   if (!mySubmeshChk->isChecked() && !myGroupChk->isChecked()) {
-    if (nbSelected == 1)
+    if (nbSelected > 0)
       mySelector->GetIndex(aList.First(),toBeAdded);
   } else if (mySubmeshChk->isChecked()) {
     SALOME_ListIteratorOfListIO anIter(aList);
@@ -764,7 +763,7 @@ void SMESHGUI_MultiEditDlg::updateButtons()
 
   if (isToAll ||
       myMesh->_is_nil() ||
-      aList.Extent() != 1 ||
+      aList.Extent() < 1 ||
       (SMESH::IObjectToInterface<SMESH::SMESH_subMesh>(aList.First())->_is_nil() &&
        SMESH::IObjectToInterface<SMESH::SMESH_GroupBase>(aList.First())->_is_nil() &&
        SMESH::IObjectToInterface<SMESH::SMESH_Mesh>(aList.First())->_is_nil()))