Remove higher-level write-protected check. It's now done lower down.
Fixes https://gitlab.com/kicad/code/kicad/issues/5937
This commit is contained in:
parent
e3560e6414
commit
1a36971583
|
@ -716,13 +716,6 @@ bool SCH_EDIT_FRAME::SaveProject()
|
||||||
wxString fileName = Prj().AbsolutePath( Schematic().Root().GetFileName() );
|
wxString fileName = Prj().AbsolutePath( Schematic().Root().GetFileName() );
|
||||||
wxFileName fn = fileName;
|
wxFileName fn = fileName;
|
||||||
|
|
||||||
if( fn.IsOk() && !fn.IsDirWritable() )
|
|
||||||
{
|
|
||||||
msg = wxString::Format( _( "Directory \"%s\" is not writable." ), fn.GetPath() );
|
|
||||||
DisplayError( this, msg );
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Warn user on potential file overwrite. This can happen on shared sheets.
|
// Warn user on potential file overwrite. This can happen on shared sheets.
|
||||||
wxArrayString overwrittenFiles;
|
wxArrayString overwrittenFiles;
|
||||||
|
|
||||||
|
@ -749,7 +742,7 @@ bool SCH_EDIT_FRAME::SaveProject()
|
||||||
|
|
||||||
if( !overwrittenFiles.IsEmpty() )
|
if( !overwrittenFiles.IsEmpty() )
|
||||||
{
|
{
|
||||||
for( auto overwrittenFile : overwrittenFiles )
|
for( const wxString& overwrittenFile : overwrittenFiles )
|
||||||
{
|
{
|
||||||
if( msg.IsEmpty() )
|
if( msg.IsEmpty() )
|
||||||
msg = overwrittenFile;
|
msg = overwrittenFile;
|
||||||
|
@ -757,13 +750,10 @@ bool SCH_EDIT_FRAME::SaveProject()
|
||||||
msg += "\n" + overwrittenFile;
|
msg += "\n" + overwrittenFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
wxRichMessageDialog dlg(
|
wxRichMessageDialog dlg( this, _( "Saving will overwrite existing files." ),
|
||||||
this,
|
_( "Save Warning" ),
|
||||||
_( "Saving the project to the new file format will overwrite existing files." ),
|
|
||||||
_( "Project Save Warning" ),
|
|
||||||
wxOK | wxCANCEL | wxCANCEL_DEFAULT | wxCENTER | wxICON_EXCLAMATION );
|
wxOK | wxCANCEL | wxCANCEL_DEFAULT | wxCENTER | wxICON_EXCLAMATION );
|
||||||
dlg.ShowDetailedText( wxString::Format(
|
dlg.ShowDetailedText( _( "The following files will be overwritten:\n\n" ) + msg );
|
||||||
_( "The following files will be overwritten:\n\n%s" ), msg ) );
|
|
||||||
dlg.SetOKCancelLabels( wxMessageDialog::ButtonLabel( _( "Overwrite Files" ) ),
|
dlg.SetOKCancelLabels( wxMessageDialog::ButtonLabel( _( "Overwrite Files" ) ),
|
||||||
wxMessageDialog::ButtonLabel( _( "Abort Project Save" ) ) );
|
wxMessageDialog::ButtonLabel( _( "Abort Project Save" ) ) );
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue