Silence IsWritable warning message

Fixes https://gitlab.com/kicad/code/kicad/-/issues/9656
This commit is contained in:
Jon Evans 2021-11-16 21:02:23 -05:00
parent 969bef9a36
commit 9238b27f63
3 changed files with 7 additions and 4 deletions

View File

@ -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;
}

View File

@ -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();

View File

@ -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