diff --git a/eeschema/dialogs/dialog_sheet_properties.cpp b/eeschema/dialogs/dialog_sheet_properties.cpp index e3935c3a4c..1eff396706 100644 --- a/eeschema/dialogs/dialog_sheet_properties.cpp +++ b/eeschema/dialogs/dialog_sheet_properties.cpp @@ -249,8 +249,6 @@ bool DIALOG_SHEET_PROPERTIES::TransferDataFromWindow() // Ensure filepath is not empty. (In normal use will be caught by grid validators, // but unedited data from existing files can be bad.) - - // @todo What happens when there are invalid file name characters? if( newRelativeNativeFilename.IsEmpty() ) { wxMessageBox( _( "A sheet must have a valid file name." ) ); @@ -614,16 +612,6 @@ void DIALOG_SHEET_PROPERTIES::OnGridCellChanging( wxGridEvent& event ) wxMessageBox( _( "A sheet must have a file specified." ) ); success = false; } - else - { - wxFileName fn = textControl->GetValue(); - - if( fn.GetExt().CmpNoCase( KiCadSchematicFileExtension ) != 0 ) - { - wxMessageBox( _( "Sheet filename must have a '.kicad_sch' extension." ) ); - success = false; - } - } } if( success && control && control->GetValidator() ) diff --git a/eeschema/fields_grid_table.cpp b/eeschema/fields_grid_table.cpp index 8ea8a71229..c2ab4729c8 100644 --- a/eeschema/fields_grid_table.cpp +++ b/eeschema/fields_grid_table.cpp @@ -471,7 +471,24 @@ void FIELDS_GRID_TABLE::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: diff --git a/eeschema/sch_validators.cpp b/eeschema/sch_validators.cpp index 7f153086ea..a12815a567 100644 --- a/eeschema/sch_validators.cpp +++ b/eeschema/sch_validators.cpp @@ -87,7 +87,7 @@ SCH_FIELD_VALIDATOR::SCH_FIELD_VALIDATOR( const SCH_FIELD_VALIDATOR& aValidator bool SCH_FIELD_VALIDATOR::Validate( wxWindow *aParent ) { // If window is disabled, simply return - if( !m_validatorWindow->IsEnabled() || !m_validatorWindow->IsShown() ) + if( !m_validatorWindow->IsEnabled() ) return true; wxTextEntry * const text = GetTextEntry();