Fix sheet filename if it's missing extension.
Fixes https://gitlab.com/kicad/code/kicad/issues/8619
This commit is contained in:
parent
78d2e88f4b
commit
201c34345f
|
@ -39,6 +39,8 @@
|
|||
#include <dialog_edit_one_field.h>
|
||||
#include <sch_text.h>
|
||||
#include <scintilla_tricks.h>
|
||||
#include <wildcards_and_files_ext.h>
|
||||
|
||||
|
||||
DIALOG_EDIT_ONE_FIELD::DIALOG_EDIT_ONE_FIELD( SCH_BASE_FRAME* aParent, const wxString& aTitle,
|
||||
const EDA_TEXT* aTextItem ) :
|
||||
|
@ -248,6 +250,18 @@ bool DIALOG_EDIT_ONE_FIELD::TransferDataFromWindow()
|
|||
return false;
|
||||
}
|
||||
}
|
||||
else if( m_fieldId == SHEETFILENAME_V )
|
||||
{
|
||||
wxFileName fn( m_text );
|
||||
|
||||
// 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 );
|
||||
m_text = fn.GetFullPath();
|
||||
}
|
||||
}
|
||||
|
||||
m_isVertical = m_orientChoice->GetSelection() == 1;
|
||||
m_position = wxPoint( m_posX.GetValue(), m_posY.GetValue() );
|
||||
|
|
Loading…
Reference in New Issue