Salome HOME
Update method isValid() for bug IPAL11201.
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_MeshPatternDlg.cxx
index 0022b3f5ca89445412257cce6b4862d69dbb730a..9184f68b509f4b231cec2ca5ca8de29da323b372 100755 (executable)
@@ -17,7 +17,7 @@
 //  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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
+// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
 //
 //
@@ -383,6 +383,13 @@ bool SMESHGUI_MeshPatternDlg::isValid (const bool theMess)
     return false;
   }
 
+  if ( myName->text()=="" ) {
+    if (theMess)
+      QMessageBox::information(SMESHGUI::desktop(), tr("SMESH_INSUFFICIENT_DATA"),
+                               tr("SMESHGUI_INVALID_PARAMETERS"), QMessageBox::Ok);
+    return false;
+  }
+
   return true;
 }
 
@@ -1361,3 +1368,20 @@ int SMESHGUI_MeshPatternDlg::getNode (bool second) const
 {
   return second ? myNode2->value() - 1 : myNode1->value() - 1;
 }
+
+//=================================================================================
+// function : keyPressEvent()
+// purpose  :
+//=================================================================================
+void SMESHGUI_MeshPatternDlg::keyPressEvent( QKeyEvent* e )
+{
+  QDialog::keyPressEvent( e );
+  if ( e->isAccepted() )
+    return;
+
+  if ( e->key() == Key_F1 )
+    {
+      e->accept();
+      onHelp();
+    }
+}