#include "SalomeApp_Tools.h"
#include "SalomeApp_Study.h"
-#include "LightApp_NameDlg.h"
-#include "LightApp_DataOwner.h"
#include "SalomeApp_Application.h"
+#include "SalomeApp_CheckFileDlg.h"
+#include "LightApp_DataOwner.h"
#include "LightApp_Preferences.h"
#include "LightApp_VTKSelector.h"
#include "LightApp_Operation.h"
#include <qstring.h>
#include <qwidget.h>
#include <qaction.h>
+#include <qinputdialog.h>
// BOOST Includes
#include <boost/shared_ptr.hpp>
QString aFilename;
SMESH::MED_VERSION aFormat;
-
+ // Init the parameter with the default value
+ bool toCreateGroups = false;
+ SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
+ if ( resMgr )
+ toCreateGroups = resMgr->booleanValue( "SMESH", "auto_groups", false );
+
if ( theCommandID != 122 && theCommandID != 125 )
aFilename = SUIT_FileDlg::getFileName(SMESHGUI::desktop(), "", aFilter, aTitle, false);
else
for ( QMap<QString, SMESH::MED_VERSION>::const_iterator it = aFilterMap.begin(); it != aFilterMap.end(); ++it )
filters.push_back( it.key() );
- SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
+ //SUIT_FileDlg* fd = new SUIT_FileDlg( SMESHGUI::desktop(), false, true, true );
+ SalomeApp_CheckFileDlg* fd = new SalomeApp_CheckFileDlg( SMESHGUI::desktop(), false, QObject::tr("SMESH_AUTO_GROUPS") ,true, true );
fd->setCaption( aTitle );
fd->setFilters( filters );
fd->setSelectedFilter( QObject::tr("MED 2.2 (*.med)") );
+ fd->SetChecked(toCreateGroups);
bool is_ok = false;
while(!is_ok){
fd->exec();
}
}
}
+ toCreateGroups = fd->IsChecked();
delete fd;
}
if ( !aFilename.isEmpty() ) {
switch ( theCommandID ) {
case 125:
case 122:
- aMesh->ExportToMED( aFilename.latin1(), false, aFormat ); // currently, automatic groups are never created
+ aMesh->ExportToMED( aFilename.latin1(), toCreateGroups, aFormat );
break;
case 124:
case 121:
SALOME_ListIO l;
LightApp_SelectionMgr *aSel = SMESHGUI::selectionMgr();
+ aSel->selectedObjects( l );
aSel->setSelectedObjects( l );
break;
}
if( theCommandID==302 )
startOperation( myEraseAll );
- SALOME_ListIteratorOfListIO anIt( sel_objects );
- for( ; anIt.More(); anIt.Next() )
- {
- Handle( SALOME_InteractiveObject ) obj = anIt.Value();
- if( obj->hasEntry() )
- {
- _PTR(SObject) SO = activeStudy()->studyDS()->FindObjectID( obj->getEntry() );
- if( SO && QString( SO->GetID().c_str() ) == SO->GetFatherComponent()->GetID().c_str() )
- { //component is selected
- _PTR(SComponent) SC( SO->GetFatherComponent() );
- _PTR(ChildIterator) anIter ( activeStudy()->studyDS()->NewChildIterator( SC ) );
- anIter->InitEx( true );
- while( anIter->More() )
- {
- _PTR(SObject) valSO ( anIter->Value() );
- _PTR(SObject) refSO;
- if( !valSO->ReferencedObject( refSO ) )
- {
- QString id = valSO->GetID().c_str(),
- comp = SC->ComponentDataType().c_str(),
- val = valSO->GetName().c_str();
-
- Handle( SALOME_InteractiveObject ) new_obj =
- new SALOME_InteractiveObject( id.latin1(), comp.latin1(), val.latin1() );
- to_process.Append( new_obj );
- }
- anIter->Next();
- }
- continue;
- }
- }
- to_process.Append( obj );
- }
+ extractContainers( sel_objects, to_process );
if (vtkwnd) {
SALOME_ListIteratorOfListIO It( to_process );
{
aName = anAttr;
QString newName = QString(aName->Value().c_str());
- newName = LightApp_NameDlg::getName( desktop(), newName );
- if ( !newName.isEmpty() )
+ bool ok;
+ newName = QInputDialog::getText( tr( "Rename" ), tr( "Enter new name:" ), QLineEdit::Normal,
+ newName, &ok, desktop() );
+ if ( ok && !newName.isEmpty() )
{
//old source: aStudy->renameIObject( IObject, newName );
aName->SetValue( newName.latin1() );
setPreferenceProperty( dispmode, "strings", modes );
setPreferenceProperty( dispmode, "indexes", indices );
+ int exportgroup = addPreference( tr( "PREF_GROUP_EXPORT" ), genTab );
+ addPreference( tr( "PREF_AUTO_GROUPS" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "auto_groups" );
+
int meshTab = addPreference( tr( "PREF_TAB_MESH" ) );
int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab );