mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-13 10:10:33 +05:00
Fix for "0023302: [EDF 12800] Ergonomics of mesh group export operation" issue
This commit is contained in:
parent
7646a7f54e
commit
ec98b49f0e
@ -85,6 +85,7 @@
|
|||||||
<parameter name="display_entity" value="true" />
|
<parameter name="display_entity" value="true" />
|
||||||
<parameter name="display_mode" value="1" />
|
<parameter name="display_mode" value="1" />
|
||||||
<parameter name="auto_groups" value="false"/>
|
<parameter name="auto_groups" value="false"/>
|
||||||
|
<parameter name="show_warning" value="true"/>
|
||||||
<parameter name="show_result_notification" value="2"/>
|
<parameter name="show_result_notification" value="2"/>
|
||||||
<parameter name="mesh_elem_info" value="1"/>
|
<parameter name="mesh_elem_info" value="1"/>
|
||||||
<parameter name="elem_info_grp_details" value="false"/>
|
<parameter name="elem_info_grp_details" value="false"/>
|
||||||
|
@ -151,6 +151,9 @@
|
|||||||
#include <QTextStream>
|
#include <QTextStream>
|
||||||
#include <QListView>
|
#include <QListView>
|
||||||
#include <QTreeView>
|
#include <QTreeView>
|
||||||
|
#include <QCheckBox>
|
||||||
|
#include <QLayout>
|
||||||
|
#include <QDialogButtonBox>
|
||||||
|
|
||||||
// BOOST includes
|
// BOOST includes
|
||||||
#include <boost/shared_ptr.hpp>
|
#include <boost/shared_ptr.hpp>
|
||||||
@ -444,7 +447,10 @@ namespace
|
|||||||
const bool multiMeshSupported = ( isMED || isCGNS ); // file can hold several meshes
|
const bool multiMeshSupported = ( isMED || isCGNS ); // file can hold several meshes
|
||||||
if ( selected.Extent() == 0 || ( selected.Extent() > 1 && !multiMeshSupported ))
|
if ( selected.Extent() == 0 || ( selected.Extent() > 1 && !multiMeshSupported ))
|
||||||
return;
|
return;
|
||||||
|
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
||||||
|
bool aCheckWarn = true;
|
||||||
|
if ( resMgr )
|
||||||
|
aCheckWarn = resMgr->booleanValue( "SMESH", "show_warning", false );
|
||||||
// get mesh object from selection and check duplication of their names
|
// get mesh object from selection and check duplication of their names
|
||||||
bool hasDuplicatedMeshNames = false;
|
bool hasDuplicatedMeshNames = false;
|
||||||
QList< QPair< SMESH::SMESH_IDSource_var, QString > > aMeshList;
|
QList< QPair< SMESH::SMESH_IDSource_var, QString > > aMeshList;
|
||||||
@ -461,6 +467,30 @@ namespace
|
|||||||
QObject::tr( "SMESH_BAD_MESH_SELECTION" ));
|
QObject::tr( "SMESH_BAD_MESH_SELECTION" ));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
SMESH::SMESH_GroupBase_var aGroup = SMESH::SMESH_GroupBase::_narrow( aMeshItem );
|
||||||
|
if ( aCheckWarn && !aGroup->_is_nil() ) {
|
||||||
|
QMessageBox msgBox(SUIT_MessageBox::Warning,QObject::tr("SMESH_WRN_WARNING"),
|
||||||
|
QObject::tr("SMESH_EXPORT_ONLY_GPOUP"),QMessageBox::StandardButton::NoButton, SMESHGUI::desktop());
|
||||||
|
QCheckBox dontShowCheckBox(QObject::tr("SMESH_WRN_SHOW_DLG_CHECKBOX"));
|
||||||
|
msgBox.addButton(QMessageBox::Ok);
|
||||||
|
msgBox.addButton(QMessageBox::Cancel);
|
||||||
|
msgBox.setDefaultButton(QMessageBox::Cancel);
|
||||||
|
QGridLayout* lt = qobject_cast<QGridLayout*>(msgBox.layout());
|
||||||
|
QDialogButtonBox* btnbox = msgBox.findChild<QDialogButtonBox*>();
|
||||||
|
lt->addWidget(&dontShowCheckBox, lt->rowCount(), lt->columnCount()-1, lt->rowCount(), lt->columnCount());
|
||||||
|
lt->addWidget(btnbox, lt->rowCount(), 0, lt->rowCount(), lt->columnCount());
|
||||||
|
if(msgBox.exec() == QMessageBox::Ok)
|
||||||
|
{
|
||||||
|
if(dontShowCheckBox.checkState() == Qt::Checked)
|
||||||
|
{
|
||||||
|
if ( resMgr )
|
||||||
|
resMgr->setValue( "SMESH", "show_warning", false);
|
||||||
|
}
|
||||||
|
aCheckWarn = false;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
QString aMeshName = anIObject->getName();
|
QString aMeshName = anIObject->getName();
|
||||||
|
|
||||||
@ -615,7 +645,6 @@ namespace
|
|||||||
// Init the parameters with the default values
|
// Init the parameters with the default values
|
||||||
bool aIsASCII_STL = true;
|
bool aIsASCII_STL = true;
|
||||||
bool toCreateGroups = false;
|
bool toCreateGroups = false;
|
||||||
SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
|
|
||||||
if ( resMgr )
|
if ( resMgr )
|
||||||
toCreateGroups = resMgr->booleanValue( "SMESH", "auto_groups", false );
|
toCreateGroups = resMgr->booleanValue( "SMESH", "auto_groups", false );
|
||||||
bool toOverwrite = true;
|
bool toOverwrite = true;
|
||||||
@ -5008,6 +5037,7 @@ void SMESHGUI::createPreferences()
|
|||||||
int exportgroup = addPreference( tr( "PREF_GROUP_EXPORT" ), genTab );
|
int exportgroup = addPreference( tr( "PREF_GROUP_EXPORT" ), genTab );
|
||||||
setPreferenceProperty( exportgroup, "columns", 2 );
|
setPreferenceProperty( exportgroup, "columns", 2 );
|
||||||
addPreference( tr( "PREF_AUTO_GROUPS" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "auto_groups" );
|
addPreference( tr( "PREF_AUTO_GROUPS" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "auto_groups" );
|
||||||
|
addPreference( tr( "PREF_SHOW_WARN" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "show_warning" );
|
||||||
//addPreference( tr( "PREF_RENUMBER" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "renumbering" );
|
//addPreference( tr( "PREF_RENUMBER" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "renumbering" );
|
||||||
|
|
||||||
int computeGroup = addPreference( tr( "PREF_GROUP_COMPUTE" ), genTab );
|
int computeGroup = addPreference( tr( "PREF_GROUP_COMPUTE" ), genTab );
|
||||||
|
@ -1726,6 +1726,11 @@ Do you want to continue ?</translation>
|
|||||||
<source>SMESH_EXPORT_MED_DUPLICATED_MESH_NAMES</source>
|
<source>SMESH_EXPORT_MED_DUPLICATED_MESH_NAMES</source>
|
||||||
<translation>There are some mesh objects with the same names in the selection.
|
<translation>There are some mesh objects with the same names in the selection.
|
||||||
The result file may be incorrect.
|
The result file may be incorrect.
|
||||||
|
Do you want to continue ?</translation>
|
||||||
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_EXPORT_ONLY_GPOUP</source>
|
||||||
|
<translation>You are going export the group without it's mesh.
|
||||||
Do you want to continue ?</translation>
|
Do you want to continue ?</translation>
|
||||||
</message>
|
</message>
|
||||||
<message>
|
<message>
|
||||||
@ -2881,6 +2886,10 @@ Use Display Entity menu command to show them.
|
|||||||
<source>SMESH_WRN_WARNING</source>
|
<source>SMESH_WRN_WARNING</source>
|
||||||
<translation>Warning</translation>
|
<translation>Warning</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>SMESH_WRN_SHOW_DLG_CHECKBOX</source>
|
||||||
|
<translation>Don't show this warning anymore.</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>SMESH_X</source>
|
<source>SMESH_X</source>
|
||||||
<translation>X</translation>
|
<translation>X</translation>
|
||||||
@ -4394,6 +4403,10 @@ Please, create VTK viewer and try again</translation>
|
|||||||
<source>PREF_AUTO_GROUPS</source>
|
<source>PREF_AUTO_GROUPS</source>
|
||||||
<translation>Automatically create groups for MED export</translation>
|
<translation>Automatically create groups for MED export</translation>
|
||||||
</message>
|
</message>
|
||||||
|
<message>
|
||||||
|
<source>PREF_SHOW_WARN</source>
|
||||||
|
<translation>Show warning when exporting group</translation>
|
||||||
|
</message>
|
||||||
<message>
|
<message>
|
||||||
<source>PREF_GROUP_SEGMENT_LENGTH</source>
|
<source>PREF_GROUP_SEGMENT_LENGTH</source>
|
||||||
<translation>Automatic parameters</translation>
|
<translation>Automatic parameters</translation>
|
||||||
|
Loading…
Reference in New Issue
Block a user