Dump Python extension

This commit is contained in:
ouv 2008-11-10 17:11:09 +00:00
parent eddb6b8f48
commit 7730fea77b
6 changed files with 21 additions and 18 deletions

View File

@ -216,7 +216,7 @@ QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
break; break;
case QVariant::Double: case QVariant::Double:
{ {
QtxDoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 ); SalomeApp_DoubleSpinBox* sb = new SMESHGUI_SpinBox( GroupC1 );
sb->setObjectName( (*anIt).myName ); sb->setObjectName( (*anIt).myName );
attuneStdWidget( sb, i ); attuneStdWidget( sb, i );
sb->setValue( (*anIt).myValue.toDouble() ); sb->setValue( (*anIt).myValue.toDouble() );
@ -276,9 +276,9 @@ bool SMESHGUI_GenericHypothesisCreator::getStdParamFromDlg( ListOfStdParams& par
params.append( item ); 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(); item.myValue = sb->value();
params.append( item ); params.append( item );
} }
@ -402,25 +402,24 @@ bool SMESHGUI_GenericHypothesisCreator::getParamFromCustomWidget( StdParam&, QWi
return false; 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(); ListOfWidgets::const_iterator anIt = widgets().begin(), aLast = widgets().end();
for( ; anIt!=aLast; anIt++ ) for( ; anIt!=aLast; anIt++ )
{ {
if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) ) if( (*anIt)->inherits( "SalomeApp_IntSpinBox" ) )
{ {
SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt ); SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
if( !sb->isValid() ) ok = sb->isValid( msg, true ) && ok;
return false;
} }
else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) ) else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
{ {
SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt ); SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
if( !sb->isValid() ) ok = sb->isValid( msg, true ) && ok;
return false;
} }
} }
return true; return ok;
} }
void SMESHGUI_GenericHypothesisCreator::onReject() void SMESHGUI_GenericHypothesisCreator::onReject()
@ -503,9 +502,13 @@ void SMESHGUI_HypothesisDlg::setCustomFrame( QFrame* f )
void SMESHGUI_HypothesisDlg::accept() 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; return;
} }
QtxDialog::accept(); QtxDialog::accept();

View File

@ -55,7 +55,7 @@ public:
void edit( SMESH::SMESH_Hypothesis_ptr, void edit( SMESH::SMESH_Hypothesis_ptr,
const QString&, QWidget* ); const QString&, QWidget* );
virtual bool checkParams() const; virtual bool checkParams( QString& ) const;
virtual void onReject(); virtual void onReject();
virtual QString helpPage() const; virtual QString helpPage() const;

View 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; return false;
NbSegmentsHypothesisData data_old, data_new; NbSegmentsHypothesisData data_old, data_new;

View File

@ -61,7 +61,7 @@ public:
StdMeshersGUI_NbSegmentsCreator(); StdMeshersGUI_NbSegmentsCreator();
virtual ~StdMeshersGUI_NbSegmentsCreator(); virtual ~StdMeshersGUI_NbSegmentsCreator();
virtual bool checkParams() const; virtual bool checkParams( QString& ) const;
protected: protected:
virtual QFrame* buildFrame(); virtual QFrame* buildFrame();

View 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; return false;
// check if object reference parameter is set, as it has no default value // check if object reference parameter is set, as it has no default value

View File

@ -40,7 +40,7 @@ public:
StdMeshersGUI_StdHypothesisCreator( const QString& ); StdMeshersGUI_StdHypothesisCreator( const QString& );
virtual ~StdMeshersGUI_StdHypothesisCreator(); virtual ~StdMeshersGUI_StdHypothesisCreator();
virtual bool checkParams() const; virtual bool checkParams( QString& ) const;
protected: protected:
virtual QFrame* buildFrame (); virtual QFrame* buildFrame ();