diff --git a/common/eda_base_frame.cpp b/common/eda_base_frame.cpp index 37ad0a1da1..9fa852edee 100644 --- a/common/eda_base_frame.cpp +++ b/common/eda_base_frame.cpp @@ -1042,7 +1042,7 @@ void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event ) } -bool EDA_BASE_FRAME::IsWritable( const wxFileName& aFileName ) +bool EDA_BASE_FRAME::IsWritable( const wxFileName& aFileName, bool aVerbose ) { wxString msg; wxFileName fn = aFileName; @@ -1078,7 +1078,9 @@ bool EDA_BASE_FRAME::IsWritable( const wxFileName& aFileName ) if( !msg.IsEmpty() ) { - wxMessageBox( msg ); + if( aVerbose ) + wxMessageBox( msg ); + return false; } diff --git a/eeschema/eeschema_config.cpp b/eeschema/eeschema_config.cpp index 33bb3e040b..f789dcb818 100644 --- a/eeschema/eeschema_config.cpp +++ b/eeschema/eeschema_config.cpp @@ -148,7 +148,7 @@ void SCH_EDIT_FRAME::SaveProjectSettings() fn.SetExt( ProjectFileExtension ); - if( !fn.HasName() || !IsWritable( fn ) ) + if( !fn.HasName() || !IsWritable( fn, false ) ) return; RecordERCExclusions(); diff --git a/include/eda_base_frame.h b/include/eda_base_frame.h index 1c0b539e01..9936afb0dc 100644 --- a/include/eda_base_frame.h +++ b/include/eda_base_frame.h @@ -462,9 +462,10 @@ public: * @note The file name path must be set or an assertion will be raised on debug builds and * return false on release builds. * @param aFileName The full path and/or file name of the file to test. + * @param aVerbose If true will show an error dialog if the file is not writable * @return False if \a aFileName cannot be written. */ - bool IsWritable( const wxFileName& aFileName ); + bool IsWritable( const wxFileName& aFileName, bool aVerbose = true ); /** * Check if an auto save file exists for \a aFileName and takes the appropriate action