Don't nag the user about file extensions. Just fix it.

Fixes https://gitlab.com/kicad/code/kicad/issues/8067
This commit is contained in:
Jeff Young
2021-03-29 22:11:35 +01:00
parent 7a4f5be37e
commit 2fc34de1be
3 changed files with 19 additions and 14 deletions
+18 -1
View File
@@ -471,7 +471,24 @@ void FIELDS_GRID_TABLE<T>::SetValue( int aRow, int aCol, const wxString &aValue
break;
case FDC_VALUE:
field.SetText( aValue );
{
wxString value( aValue );
if( m_parentType == SCH_SHEET_T && aRow == SHEETFILENAME )
{
wxFileName fn( value );
// It's annoying to throw up nag dialogs when the extension isn't right. Just
// fix it.
if( fn.GetExt().CmpNoCase( KiCadSchematicFileExtension ) != 0 )
{
fn.SetExt( KiCadSchematicFileExtension );
value = fn.GetFullPath();
}
}
field.SetText( value );
}
break;
case FDC_SHOWN: