]> SALOME platform Git repositories - modules/smesh.git/commitdiff
Salome HOME
Dump Python extension
authorouv <ouv@opencascade.com>
Mon, 10 Nov 2008 17:11:09 +0000 (17:11 +0000)
committerouv <ouv@opencascade.com>
Mon, 10 Nov 2008 17:11:09 +0000 (17:11 +0000)
src/SMESHGUI/SMESHGUI_Hypotheses.cxx
src/SMESHGUI/SMESHGUI_Hypotheses.h
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_NbSegmentsCreator.h
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.cxx
src/StdMeshersGUI/StdMeshersGUI_StdHypothesisCreator.h

index 1facdfa59bab93c5e00077947a76350b7d6bd155..f22331a4a6240d42c34868d72e2bdaa5d4610db2 100644 (file)
@@ -216,7 +216,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
         break;
       case QVariant::Double:
         {
-          QtxDoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
+          SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
          sb->setObjectName( (*anIt).myName );
           attuneStdWidget( sb, i );
           sb->setValue( (*anIt).myValue.toDouble() );
@@ -276,9 +276,9 @@ bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& par
       params.append( item );
     }
     
-    else if( (*anIt)->inherits( "QtxDoubleSpinBox" ) )
+    else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
     {
-      QtxDoubleSpinBox* sb = ( QtxDoubleSpinBox* )( *anIt );
+      SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
       item.myValue = sb->value();
       params.append( item );
     }
@@ -402,25 +402,24 @@ bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam&, QWi
   return false;
 }
 
-bool SMESHGUI_GenericHypothesisCreator::checkParams() const
+bool SMESHGUI_GenericHypothesisCreator::checkParams( QString& msg ) const
 {
+  bool ok = true;
   ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
   for( ; anIt!=aLast; anIt++ )
   {
     if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
     {
       SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
-      if( !sb->isValid() )
-       return false;
+      ok = sb->isValid( msg, true ) && ok;
     }
     else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
     {
       SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
-      if( !sb->isValid() )
-       return false;
+      ok = sb->isValid( msg, true ) && ok;
     }
   }
-  return true;
+  return ok;
 }
 
 void SMESHGUI_GenericHypothesisCreator::onReject()
@@ -503,9 +502,13 @@ void SMESHGUI_HypothesisDlg::setCustomFrame( QFrame* f )
 
 void SMESHGUI_HypothesisDlg::accept()
 {
-  if ( myCreator && !myCreator->checkParams() )
+  QString msg;
+  if ( myCreator && !myCreator->checkParams( msg ) )
   {
-    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), tr( "SMESH_INCORRECT_INPUT" ) );
+    QString str( tr( "SMESH_INCORRECT_INPUT" ) );
+    if ( !msg.isEmpty() )
+      str += "\n" + msg;
+    SUIT_MessageBox::critical( this, tr( "SMESH_ERROR" ), str );
     return;
   }
   QtxDialog::accept();
index 043f2602470b7ff5b8fe386b987b41dc73b763ef..8749450aab908469e39598f262269a72171c4850 100644 (file)
@@ -55,7 +55,7 @@ public:
   void                         edit( SMESH::SMESH_Hypothesis_ptr,
                                     const QString&, QWidget* );
 
-  virtual bool                 checkParams() const;
+  virtual bool                 checkParams( QString& ) const;
   virtual void                 onReject();
   virtual QString              helpPage() const;
 
index 397040d25cb110db0a0e9bc2ad4537f44534b47c..7342bf0b8c3dbf78108dfd9577939e82e82250b8 100644 (file)
@@ -77,9 +77,9 @@ StdMeshersGUI_NbSegmentsCreator::~StdMeshersGUI_NbSegmentsCreator()
 {
 }
 
-bool StdMeshersGUI_NbSegmentsCreator::checkParams() const
+bool StdMeshersGUI_NbSegmentsCreator::checkParams( QString& msg ) const
 {
-  if( !SMESHGUI_GenericHypothesisCreator::checkParams() )
+  if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg ) )
     return false;
 
   NbSegmentsHypothesisData data_old, data_new;
index fd50e55adf083a1418d78d8b770344647a5aa499..364679933de51ee7645e97c1c885a0961f159c42 100644 (file)
@@ -61,7 +61,7 @@ public:
   StdMeshersGUI_NbSegmentsCreator();
   virtual ~StdMeshersGUI_NbSegmentsCreator();
 
-  virtual bool checkParams() const;
+  virtual bool checkParams( QString& ) const;
 
 protected:
   virtual QFrame*  buildFrame();
index 203e5f739d59078e5eafa322a3b3411488ab4cb1..5efe23ee71c16dfdeb5ac4626c3571fb022c7ade 100644 (file)
@@ -338,9 +338,9 @@ namespace {
  */
 //================================================================================
 
-bool StdMeshersGUI_StdHypothesisCreator::checkParams() const
+bool StdMeshersGUI_StdHypothesisCreator::checkParams( QString& msg ) const
 {
-  if( !SMESHGUI_GenericHypothesisCreator::checkParams() )
+  if( !SMESHGUI_GenericHypothesisCreator::checkParams( msg ) )
     return false;
 
   // check if object reference parameter is set, as it has no default value
index 501e7aa9112201306765324facb5c20c4af729ab..f62c9590ecc8bde475d369463967fd859a41303f 100644 (file)
@@ -40,7 +40,7 @@ public:
   StdMeshersGUI_StdHypothesisCreator( const QString& );
   virtual ~StdMeshersGUI_StdHypothesisCreator();
 
-  virtual bool checkParams() const;
+  virtual bool checkParams( QString& ) const;
 
 protected:
   virtual QFrame*  buildFrame    ();