new names of preferences

This commit is contained in:
asl 2005-07-22 03:26:27 +00:00
parent eec3c1a499
commit ea8f139297
2 changed files with 44 additions and 44 deletions

View File

@ -536,36 +536,36 @@ namespace{
SMESHGUI_Preferences_ColorDlg *aDlg = SMESHGUI_Preferences_ColorDlg *aDlg =
new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI(), "" ); new SMESHGUI_Preferences_ColorDlg( SMESHGUI::GetSMESHGUI(), "" );
QColor color = mgr->colorValue( "SMESH", "SettingsFillColor", QColor(0, 170, 255) ); QColor color = mgr->colorValue( "SMESH", "fill_color", QColor(0, 170, 255) );
aDlg->SetColor(1, color); aDlg->SetColor(1, color);
color = mgr->colorValue( "SMESH", "SettingsOutlineColor", QColor(0, 170, 255) ); color = mgr->colorValue( "SMESH", "outline_color", QColor(0, 170, 255) );
aDlg->SetColor(2, color); aDlg->SetColor(2, color);
color = mgr->colorValue( "SMESH", "SettingsNodeColor", Qt::red ); color = mgr->colorValue( "SMESH", "node_color", Qt::red );
aDlg->SetColor(3, color); aDlg->SetColor(3, color);
color = mgr->colorValue( "SMESH", "SettingsBackFaceColor", Qt::blue ); color = mgr->colorValue( "SMESH", "backface_color", Qt::blue );
aDlg->SetColor(4, color); aDlg->SetColor(4, color);
int iVal = mgr->integerValue( "SMESH", "SettingsWidth", 1 ); int iVal = mgr->integerValue( "SMESH", "element_width", 1 );
aDlg->SetIntValue(1, iVal); aDlg->SetIntValue(1, iVal);
iVal = mgr->integerValue( "SMESH", "SettingsNodesSize", 3 ); iVal = mgr->integerValue( "SMESH", "node_size", 3 );
aDlg->SetIntValue(2, iVal); aDlg->SetIntValue(2, iVal);
iVal = mgr->integerValue( "SMESH", "SettingsShrinkCoeff", 75 ); iVal = mgr->integerValue( "SMESH", "shrink_coeff", 75 );
aDlg->SetIntValue(3, iVal); aDlg->SetIntValue(3, iVal);
if (aDlg->exec()) { if (aDlg->exec()) {
mgr->setValue( "SMESH", "SettingsFillColor", aDlg->GetColor(1) ); mgr->setValue( "SMESH", "fill_color", aDlg->GetColor(1) );
mgr->setValue( "SMESH", "SettingsOutlineColor", aDlg->GetColor(2) ); mgr->setValue( "SMESH", "outline_color", aDlg->GetColor(2) );
mgr->setValue( "SMESH", "SettingsNodeColor", aDlg->GetColor(3) ); mgr->setValue( "SMESH", "node_color", aDlg->GetColor(3) );
mgr->setValue( "SMESH", "SettingsBackFaceColor", aDlg->GetColor(4) ); mgr->setValue( "SMESH", "backface_color", aDlg->GetColor(4) );
mgr->setValue( "SMESH", "SettingsWidth", aDlg->GetIntValue(1) ); mgr->setValue( "SMESH", "element_width", aDlg->GetIntValue(1) );
mgr->setValue( "SMESH", "SettingsNodesSize", aDlg->GetIntValue(2) ); mgr->setValue( "SMESH", "node_size", aDlg->GetIntValue(2) );
mgr->setValue( "SMESH", "SettingsShrinkCoeff", aDlg->GetIntValue(3) ); mgr->setValue( "SMESH", "shrink_coeff", aDlg->GetIntValue(3) );
} }
delete aDlg; delete aDlg;
@ -1810,10 +1810,10 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
case 10071: case 10071:
{ {
if (act->isOn()) { if (act->isOn()) {
mgr->setValue( "SMESH", "DispayEntity", true ); mgr->setValue( "SMESH", "display_entity", true );
} }
else { else {
mgr->setValue( "SMESH", "DispayEntity", false ); mgr->setValue( "SMESH", "display_entity", false );
} }
break; break;
} }
@ -1822,19 +1822,19 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
SMESHGUI_Preferences_SelectionDlg* aDlg = SMESHGUI_Preferences_SelectionDlg* aDlg =
new SMESHGUI_Preferences_SelectionDlg( this ); new SMESHGUI_Preferences_SelectionDlg( this );
QColor aColor = mgr->colorValue( "SMESH", "SettingsPreSelectColor", Qt::cyan ); QColor aColor = mgr->colorValue( "SMESH", "highlight_color", Qt::cyan );
aDlg->SetColor(1, aColor); aDlg->SetColor(1, aColor);
aColor = mgr->colorValue( "SMESH", "SettingsItemSelectColor", Qt::yellow ); aColor = mgr->colorValue( "SMESH", "selection_element_color", Qt::yellow );
aDlg->SetColor(2, aColor); aDlg->SetColor(2, aColor);
aColor = mgr->colorValue( "SMESH", "SettingsSelectColor", Qt::white ); aColor = mgr->colorValue( "SMESH", "selection_object_color", Qt::white );
aDlg->SetColor(3, aColor); aDlg->SetColor(3, aColor);
aDlg->SetWidth(1, mgr->integerValue( "SMESH", "SettingsPreSelectWidth", 5 ) ); aDlg->SetWidth(1, mgr->integerValue( "SMESH", "highlight_width", 5 ) );
aDlg->SetWidth(2, mgr->integerValue( "SMESH", "SettingsItemSelectWidth", 5 ) ); aDlg->SetWidth(2, mgr->integerValue( "SMESH", "selection_width", 5 ) );
aDlg->SetPrecision(1, mgr->doubleValue( "SMESH", "SettingsNodeSelectTol", 0.025 ) ); aDlg->SetPrecision(1, mgr->doubleValue( "SMESH", "selection_precision_node", 0.025 ) );
aDlg->SetPrecision(2, mgr->doubleValue( "SMESH", "SettingsElementsSelectTol", 0.001 ) ); aDlg->SetPrecision(2, mgr->doubleValue( "SMESH", "selection_precision_element", 0.001 ) );
if (aDlg->exec()) { if (aDlg->exec()) {
QColor aPreColor = aDlg->GetColor(1), QColor aPreColor = aDlg->GetColor(1),
@ -1845,14 +1845,14 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
double aTolNodes = aDlg->GetPrecision(1), double aTolNodes = aDlg->GetPrecision(1),
aTolItems = aDlg->GetPrecision(2); aTolItems = aDlg->GetPrecision(2);
mgr->setValue( "SMESH", "SettingsPreSelectColor", aPreColor ); mgr->setValue( "SMESH", "highlight_color", aPreColor );
mgr->setValue( "SMESH", "SettingsItemSelectColor", aSelColor ); mgr->setValue( "SMESH", "selection_element_color", aSelColor );
mgr->setValue( "SMESH", "SettingsSelectColor", aHiColor ); mgr->setValue( "SMESH", "selection_object_color", aHiColor );
mgr->setValue( "SMESH", "SettingsPreSelectWidth", aPreWidth ); mgr->setValue( "SMESH", "highlight_width", aPreWidth );
mgr->setValue( "SMESH", "SettingsItemSelectWidth", aSelWidth ); mgr->setValue( "SMESH", "selection_width", aSelWidth );
mgr->setValue( "SMESH", "SettingsNodeSelectTol", aTolNodes ); mgr->setValue( "SMESH", "selection_precision_node", aTolNodes );
mgr->setValue( "SMESH", "SettingsElementsSelectTol", aTolItems ); mgr->setValue( "SMESH", "selection_precision_element", aTolItems );
// update current study settings // update current study settings
SMESH::UpdateSelectionProp( this ); SMESH::UpdateSelectionProp( this );
@ -2278,7 +2278,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
action( 10002 )->setOn( false ); action( 10002 )->setOn( false );
action( 10004 )->setOn( false ); action( 10004 )->setOn( false );
action( 10003 )->setOn( true ); action( 10003 )->setOn( true );
mgr->setValue( "SMESH", "DisplayMode", "Wireframe"); mgr->setValue( "SMESH", "display_mode", "Wireframe");
break; break;
} }
case 10002: case 10002:
@ -2287,12 +2287,12 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
action( 10001 )->setOn( false ); action( 10001 )->setOn( false );
action( 10004 )->setOn( false ); action( 10004 )->setOn( false );
action( 10003 )->setOn( true ); action( 10003 )->setOn( true );
mgr->setValue( "SMESH", "DisplayMode", "Shading"); mgr->setValue( "SMESH", "display_mode", "Shading");
break; break;
} }
case 10003: case 10003:
{ {
mgr->setValue( "SMESH", "Shrink", act->isOn() ); mgr->setValue( "SMESH", "display_mode", "Shrink" );
break; break;
} }
case 10004: case 10004:
@ -2301,7 +2301,7 @@ bool SMESHGUI::OnGUIEvent( int theCommandID )
action( 10001 )->setOn( false ); action( 10001 )->setOn( false );
action( 10002 )->setOn( false ); action( 10002 )->setOn( false );
action( 10003 )->setOn( false ); action( 10003 )->setOn( false );
mgr->setValue( "SMESH", "DisplayMode", "Nodes" ); mgr->setValue( "SMESH", "display_mode", "Nodes" );
break; break;
} }
@ -2356,14 +2356,14 @@ bool SMESHGUI::SetSettings(SUIT_Desktop* parent)
// Display mode // Display mode
QString DisplayMode = "Shading"; QString DisplayMode = "Shading";
if ( mgr->hasValue("SMESH","DisplayMode") ) if ( mgr->hasValue("SMESH","display_mode") )
DisplayMode = mgr->stringValue("SMESH","DisplayMode"); DisplayMode = mgr->stringValue("SMESH","display_mode");
else else
mgr->setValue("SMESH","DisplayMode", "Shading"); mgr->setValue("SMESH","display_mode", "Shading");
bool Shrink = false; bool Shrink = false;
if ( mgr->hasValue("SMESH","Shrink") ) if ( mgr->hasValue("SMESH","display_mode") )
Shrink = mgr->stringValue("SMESH","Shrink") == "yes"; Shrink = mgr->stringValue("SMESH","display_mode") == "Shrink";
if (DisplayMode == "Wireframe") { if (DisplayMode == "Wireframe") {
// wireframe // wireframe
@ -2399,7 +2399,7 @@ bool SMESHGUI::SetSettings(SUIT_Desktop* parent)
// myAutomaticUpdate = false; // myAutomaticUpdate = false;
// } // }
if ( mgr->booleanValue( "SMESH","DispayEntity", false ) ) if ( mgr->booleanValue( "SMESH","display_entity", false ) )
action( 10071 )->setOn( true ); action( 10071 )->setOn( true );
else else
action( 10071 )->setOn( false ); action( 10071 )->setOn( false );

View File

@ -133,8 +133,8 @@ void SMESHGUI_PrecisionDlg::Init()
bool isOk = false; bool isOk = false;
int aVal = DEFAULT_VAL; int aVal = DEFAULT_VAL;
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
if (mgr && mgr->hasValue("SMESH", "ControlsPrecision")) { if (mgr && mgr->hasValue("SMESH", "controls_precision")) {
QString aStr = mgr->stringValue("SMESH", "ControlsPrecision"); QString aStr = mgr->stringValue("SMESH", "controls_precision");
aVal = aStr.toInt(&isOk); aVal = aStr.toInt(&isOk);
} }
@ -156,14 +156,14 @@ void SMESHGUI_PrecisionDlg::onOk()
SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI ); SUIT_ResourceMgr* mgr = SMESH::GetResourceMgr( mySMESHGUI );
if (myNotUseChk->isChecked()) { if (myNotUseChk->isChecked()) {
if (mgr) { if (mgr) {
mgr->remove("SMESH", "ControlsPrecision"); mgr->remove("SMESH", "controls_precision");
} }
SMESH::SetControlsPrecision(-1); SMESH::SetControlsPrecision(-1);
} else { } else {
mySpinBox->clearFocus(); mySpinBox->clearFocus();
int aVal = mySpinBox->value(); int aVal = mySpinBox->value();
if (mgr) { if (mgr) {
mgr->setValue("SMESH", "ControlsPrecision", QString("%1").arg(aVal)); mgr->setValue("SMESH", "controls_precision", QString("%1").arg(aVal));
} }
SMESH::SetControlsPrecision(aVal); SMESH::SetControlsPrecision(aVal);
} }