Salome HOME
Incorrect name of Remove Elements dialog box
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_SymmetryDlg.cxx
index 0485ab5165dcdda062e38e425f4e16fe4e0e62de..214cca5e09dbf3146808b3a8aab1f8212945989e 100644 (file)
@@ -43,6 +43,7 @@
 #include <SUIT_ResourceMgr.h>
 #include <SUIT_Session.h>
 #include <SUIT_MessageBox.h>
+#include <SUIT_OverrideCursor.h>
 
 #include <LightApp_Application.h>
 #include <LightApp_SelectionMgr.h>
@@ -132,12 +133,14 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
   GroupArgumentsLayout->setSpacing(SPACING);
   GroupArgumentsLayout->setMargin(MARGIN);
 
+  myIdValidator = new SMESHGUI_IdValidator(this);
+
   // Controls for elements selection
   TextLabelElements = new QLabel(tr("SMESH_ID_ELEMENTS"), GroupArguments);
   SelectElementsButton  = new QPushButton(GroupArguments);
   SelectElementsButton->setIcon(image3);
   LineEditElements = new QLineEdit(GroupArguments);
-  LineEditElements->setValidator(new SMESHGUI_IdValidator(this));
+  LineEditElements->setValidator(myIdValidator);
 
   // Control for the whole mesh selection
   CheckBoxMesh = new QCheckBox(tr("SMESH_SELECT_WHOLE_MESH"), GroupArguments);
@@ -228,7 +231,7 @@ SMESHGUI_SymmetryDlg::SMESHGUI_SymmetryDlg( SMESHGUI* theModule )
   GroupButtonsLayout->setSpacing(SPACING);
   GroupButtonsLayout->setMargin(MARGIN);
 
-  buttonOk = new QPushButton(tr("SMESH_BUT_OK"), GroupButtons);
+  buttonOk = new QPushButton(tr("SMESH_BUT_APPLY_AND_CLOSE"), GroupButtons);
   buttonOk->setAutoDefault(true);
   buttonOk->setDefault(true);
   buttonApply = new QPushButton(tr("SMESH_BUT_APPLY"), GroupButtons);
@@ -466,8 +469,9 @@ void SMESHGUI_SymmetryDlg::ClickOnApply()
     bool makeGroups = ( MakeGroupsCheck->isEnabled() && MakeGroupsCheck->isChecked() );
 
     try {
+      SUIT_OverrideCursor aWaitCursor;
       SMESH::SMESH_MeshEditor_var aMeshEditor = myMesh->GetMeshEditor();
-      QApplication::setOverrideCursor(Qt::WaitCursor);
+
       switch ( actionButton ) {
       case MOVE_ELEMS_BUTTON:
         aMeshEditor->Mirror(anElementsId, aMirror, aMirrorType, false );
@@ -484,7 +488,6 @@ void SMESHGUI_SymmetryDlg::ClickOnApply()
           aMeshEditor->MirrorMakeMesh(anElementsId, aMirror, aMirrorType, makeGroups,
                                       LineEditNewMesh->text().toLatin1().data());
       }
-      QApplication::restoreOverrideCursor();
     } catch (...) {
     }
 
@@ -880,10 +883,12 @@ void SMESHGUI_SymmetryDlg::onSelectMesh (bool toSelectMesh)
       aViewWindow->SetSelectionMode(ActorSelection);
     mySelectionMgr->installFilter(myMeshOrSubMeshOrGroupFilter);
     LineEditElements->setReadOnly(true);
+    LineEditElements->setValidator(0);
   } else {
     if ( SVTK_ViewWindow* aViewWindow = SMESH::GetViewWindow( mySMESHGUI ))
       aViewWindow->SetSelectionMode(CellSelection);
     LineEditElements->setReadOnly(false);
+    LineEditElements->setValidator(myIdValidator);
     onTextChange(LineEditElements->text());
   }