Salome HOME
Merge from V6_main_20120808 08Aug12
[modules/smesh.git] / src / SMESHGUI / SMESHGUI_ConvToQuadDlg.cxx
index 5db422cddc058bef5bbf2fd7de800c2dbfbbbdbe..b42d728ae9cae0e872609710006ba17b2ef59f70 100644 (file)
@@ -1,24 +1,25 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2012  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-//  Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-//  CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+// 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
-//  modify it under the terms of the GNU Lesser General Public
-//  License as published by the Free Software Foundation; either
-//  version 2.1 of the License.
+// This library is free software; you can redistribute it and/or
+// modify it under the terms of the GNU Lesser General Public
+// License as published by the Free Software Foundation; either
+// version 2.1 of the License.
 //
-//  This library is distributed in the hope that it will be useful,
-//  but WITHOUT ANY WARRANTY; without even the implied warranty of
-//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-//  Lesser General Public License for more details.
+// This library is distributed in the hope that it will be useful,
+// but WITHOUT ANY WARRANTY; without even the implied warranty of
+// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+// Lesser General Public License for more details.
 //
-//  You should have received a copy of the GNU Lesser General Public
-//  License along with this library; if not, write to the Free Software
-//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+// You should have received a copy of the GNU Lesser General Public
+// 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_ConvToQuadDlg.cxx
 // Author : Open CASCADE S.A.S.
@@ -35,6 +36,7 @@
 #include <QFrame>
 #include <QHBoxLayout>
 #include <QGridLayout>
+#include <QLabel>
 
 #define SPACING 6
 #define MARGIN  11
@@ -69,6 +71,8 @@ SMESHGUI_ConvToQuadDlg::SMESHGUI_ConvToQuadDlg()
   myBG->addButton(myRB2, 1);
   myRB1->setChecked( true );
 
+  myWarning = new QLabel(QString("<b>%1</b>").arg(tr("NON_CONFORM_WARNING")), mainFrame());
+
   // Fill layout
   QGridLayout* aLay = new QGridLayout( mainFrame() );
   aLay->setMargin( 5 );
@@ -79,6 +83,7 @@ SMESHGUI_ConvToQuadDlg::SMESHGUI_ConvToQuadDlg()
   aLay->addWidget( objectWg( 0,  Control ), 0, 2 );
   aLay->addWidget( myMedNdsOnGeom,          1, 0, 1, 3 );
   aLay->addWidget( myBGBox,                 2, 0, 1, 3 );
+  aLay->addWidget( myWarning,               3, 0, 1, 3 );
   
   connect(myBG, SIGNAL( buttonClicked( int ) ), this, SIGNAL( onClicked( int ) ) );
 }
@@ -112,11 +117,26 @@ int SMESHGUI_ConvToQuadDlg::CurrentRB( )
   return myBG->checkedId();
 }
 
+void SMESHGUI_ConvToQuadDlg::ShowWarning(bool toShow)
+{
+  if ( toShow )
+    myWarning->show();
+  else
+    myWarning->hide();
+}
+
+bool SMESHGUI_ConvToQuadDlg::isWarningShown()
+{
+  return myWarning->isVisible();
+}
+
 void SMESHGUI_ConvToQuadDlg::SetEnabledControls( const bool theCheck )
 {
-  myBGBox->setEnabled( theCheck );
+  //myBGBox->setEnabled( theCheck );
+  myRB1->setEnabled( theCheck );
+  myRB2->setEnabled( theCheck );
   myMedNdsOnGeom->setEnabled( theCheck );
-  setButtonEnabled( theCheck, QtxDialog::OK | QtxDialog::Apply );
+  //setButtonEnabled( theCheck, QtxDialog::OK | QtxDialog::Apply );
 }
 
 void SMESHGUI_ConvToQuadDlg::SetEnabledRB( const int idx, const bool theCheck )