eeschema: minor fixes in DIALOG_SCH_SHEET_PROPS:
- test for empty fileName - ensure the new filename has the right extension.
This commit is contained in:
parent
9a67dc56f9
commit
6730313ab7
|
@ -242,7 +242,18 @@ bool DIALOG_SCH_SHEET_PROPS::TransferDataFromWindow()
|
||||||
return false;
|
return false;
|
||||||
|
|
||||||
wxString newRelativeNativeFilename = m_fields->at( SHEETFILENAME ).GetText();
|
wxString newRelativeNativeFilename = m_fields->at( SHEETFILENAME ).GetText();
|
||||||
wxString newRelativeFilename = newRelativeNativeFilename;
|
|
||||||
|
if( newRelativeNativeFilename.IsEmpty() )
|
||||||
|
{
|
||||||
|
wxMessageBox( _( "A sheet cannot have an empty filename" ) );
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Ensure the filename extension is OK
|
||||||
|
wxFileName fn( newRelativeNativeFilename );
|
||||||
|
fn.SetExt( LegacySchematicFileExtension );
|
||||||
|
|
||||||
|
wxString newRelativeFilename = fn.GetFullPath();
|
||||||
|
|
||||||
// Inside Eeschema, filenames are stored using unix notation
|
// Inside Eeschema, filenames are stored using unix notation
|
||||||
newRelativeFilename.Replace( wxT( "\\" ), wxT( "/" ) );
|
newRelativeFilename.Replace( wxT( "\\" ), wxT( "/" ) );
|
||||||
|
|
Loading…
Reference in New Issue