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:
@@ -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:
|
||||
|
||||
Reference in New Issue
Block a user