Only title-caps "our" field names.

Fixes https://gitlab.com/kicad/code/kicad/issues/8803
This commit is contained in:
Jeff Young 2021-07-19 14:43:34 +01:00
parent f5aefb7ad9
commit 4317848cfe
2 changed files with 15 additions and 4 deletions

View File

@ -1073,9 +1073,18 @@ void SCH_EDIT_TOOL::editFieldText( SCH_FIELD* aField )
if( aField->GetEditFlags() == 0 ) // i.e. not edited, or moved
saveCopyInUndoList( aField, UNDO_REDO::CHANGED );
wxString title = wxString::Format( _( "Edit %s Field" ), TitleCaps( aField->GetName() ) );
KICAD_T parentType = aField->GetParent() ? aField->GetParent()->Type() : SCHEMATIC_T;
wxString caption;
DIALOG_SCH_EDIT_ONE_FIELD dlg( m_frame, title, aField );
// Use title caps for mandatory fields. "Edit Sheet name Field" looks dorky.
if( parentType == SCH_SYMBOL_T && aField->GetId() < MANDATORY_FIELDS )
caption.Printf( _( "Edit %s Field" ), TitleCaps( aField->GetName() ) );
else if( parentType == SCH_SHEET_T && aField->GetId() < SHEET_MANDATORY_FIELDS )
caption.Printf( _( "Edit %s Field" ), TitleCaps( aField->GetName() ) );
else
caption.Printf( _( "Edit '%s' Field" ), aField->GetName() );
DIALOG_SCH_EDIT_ONE_FIELD dlg( m_frame, caption, aField );
// The footprint field dialog can invoke a KIWAY_PLAYER so we must use a quasi-modal
if( dlg.ShowQuasiModal() != wxID_OK )
@ -1083,7 +1092,7 @@ void SCH_EDIT_TOOL::editFieldText( SCH_FIELD* aField )
dlg.UpdateField( aField, &m_frame->GetCurrentSheet() );
if( m_frame->eeconfig()->m_AutoplaceFields.enable || aField->GetParent()->Type() == SCH_SHEET_T )
if( m_frame->eeconfig()->m_AutoplaceFields.enable || parentType == SCH_SHEET_T )
static_cast<SCH_ITEM*>( aField->GetParent() )->AutoAutoplaceFields( m_frame->GetScreen() );
m_frame->UpdateItem( aField );

View File

@ -519,8 +519,10 @@ void SYMBOL_EDITOR_EDIT_TOOL::editFieldProperties( LIB_FIELD* aField )
// current symbol. Set the dialog message to inform the user.
if( aField->GetId() == VALUE_FIELD )
caption = _( "Edit Symbol Name" );
else
else if( aField->GetId() < MANDATORY_FIELDS )
caption.Printf( _( "Edit %s Field" ), TitleCaps( aField->GetName() ) );
else
caption.Printf( _( "Edit '%s' Field" ), aField->GetName() );
DIALOG_LIB_EDIT_ONE_FIELD dlg( m_frame, caption, aField );