To implement issue 0016172: EDF 452 SMESH : Define in the preferences if we want or not the Mesh info Box (at end of computation).

This commit is contained in:
akl 2008-07-31 06:45:54 +00:00
parent 8ce2153da0
commit aadd73166e
4 changed files with 40 additions and 1 deletions

View File

@ -39,6 +39,7 @@
<parameter name="auto_update" value="true" />
<parameter name="display_mode" value="1" />
<parameter name="auto_groups" value="false"/>
<parameter name="show_result_notification" value="2"/>
</section>
<section name="resources">
<!-- Module resources -->

View File

@ -3311,6 +3311,20 @@ void SMESHGUI::createPreferences()
addPreference( tr( "PREF_AUTO_GROUPS" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "auto_groups" );
addPreference( tr( "PREF_RENUMBER" ), exportgroup, LightApp_Preferences::Bool, "SMESH", "renumbering" );
int computeGroup = addPreference( tr( "PREF_GROUP_COMPUTE" ), genTab );
setPreferenceProperty( computeGroup, "columns", 2 );
int notifyMode = addPreference( tr( "PREF_NOTIFY_MODE" ), computeGroup, LightApp_Preferences::Selector, "SMESH", "show_result_notification" );
modes.clear();
modes.append( "Never" );
modes.append( "Errors only" );
modes.append( "Always" );
indices.clear();
indices.append( 0 );
indices.append( 1 );
indices.append( 2 );
setPreferenceProperty( notifyMode, "strings", modes );
setPreferenceProperty( notifyMode, "indexes", indices );
int meshTab = addPreference( tr( "PREF_TAB_MESH" ) );
int nodeGroup = addPreference( tr( "PREF_GROUP_NODES" ), meshTab );
setPreferenceProperty( nodeGroup, "columns", 2 );

View File

@ -1157,7 +1157,23 @@ void SMESHGUI_ComputeOp::startOperation()
currentCellChanged(); // to update buttons
}
}
myDlg->show();
SUIT_ResourceMgr* resMgr = SMESH::GetResourceMgr( SMESHGUI::GetSMESHGUI() );
int aNotifyMode = resMgr->integerValue( "SMESH", "show_result_notification" );
switch( aNotifyMode ) {
case 0: // show the mesh computation result dialog NEVER
commit();
break;
case 1: // show the mesh computation result dialog if there are some errors
if ( memoryLack || !noCompError || !noHypoError )
myDlg->show();
else
commit();
break;
default: // show the result dialog after each mesh computation
myDlg->show();
}
}
//================================================================================

View File

@ -2816,6 +2816,10 @@ Please, create VTK viewer and try again</translation>
<source>PREF_FILL</source>
<translation>Fill</translation>
</message>
<message>
<source>PREF_NOTIFY_MODE</source>
<translation>Show a computation result notification</translation>
</message>
<message>
<source>PREF_GROUP_ELEMENTS</source>
<translation>Elements</translation>
@ -2824,6 +2828,10 @@ Please, create VTK viewer and try again</translation>
<source>PREF_GROUP_EXPORT</source>
<translation>Mesh export</translation>
</message>
<message>
<source>PREF_GROUP_COMPUTE</source>
<translation>Mesh computation</translation>
</message>
<message>
<source>PREF_GROUP_NODES</source>
<translation>Nodes</translation>