-// Copyright (C) 2007-2010 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_Hypotheses.cxx
// Author : Julia DOROVSKIKH, Open CASCADE S.A.S.
// SMESH includes
Dlg->show();
Dlg->resize( Dlg->minimumSizeHint() );
}
- else
+ else {
emit finished( QDialog::Accepted );
+ delete myDlg;
+ }
}
QFrame* SMESHGUI_GenericHypothesisCreator::buildStdFrame()
{
SalomeApp_IntSpinBox* sb = ( SalomeApp_IntSpinBox* )( *anIt );
item.myValue = sb->value();
+ item.myText = sb->text();
params.append( item );
}
else if( (*anIt)->inherits( "SalomeApp_DoubleSpinBox" ) )
{
SalomeApp_DoubleSpinBox* sb = ( SalomeApp_DoubleSpinBox* )( *anIt );
item.myValue = sb->value();
+ item.myText = sb->text();
params.append( item );
}
else if( (*anIt)->inherits( "QLineEdit" ) )
{
QLineEdit* line = ( QLineEdit* )( *anIt );
- item.myValue = line->text();
+ item.myValue = item.myText = line->text();
params.append( item );
}
else if ( getParamFromCustomWidget( item, *anIt ))
return res;
}
+QString SMESHGUI_GenericHypothesisCreator::getVariableName(const char* methodName) const
+{
+ SMESH::SMESH_Hypothesis_var h = hypothesis();
+ if ( !h->_is_nil() )
+ {
+ CORBA::String_var aVaribaleName = h->GetVarParameter( methodName );
+ return QString( aVaribaleName.in() );
+ }
+ return QString();
+}
QStringList SMESHGUI_GenericHypothesisCreator::getVariablesFromDlg() const
{
{
LightApp_Application* app = (LightApp_Application*)(SUIT_Session::session()->activeApplication());
if (app) {
- SMESHGUI* aSMESHGUI = dynamic_cast<SMESHGUI*>( app->activeModule() );
- app->onHelpContextModule(aSMESHGUI ? app->moduleName(aSMESHGUI->moduleName()) : QString(""), myHelpFileName);
+ QString name = "SMESH";
+ if(myCreator) {
+ QVariant pluginName = myCreator->property( PLUGIN_NAME );
+ if( pluginName.isValid() ) {
+ QString rootDir = pluginName.toString() + "PLUGIN_ROOT_DIR";
+ QString varValue = QString( getenv(rootDir.toLatin1().constData()));
+ if(!varValue.isEmpty())
+ name = pluginName.toString() + "PLUGIN";
+ }
+ }
+ app->onHelpContextModule(name, myHelpFileName);
}
else {
QString platform;