Correctly set up projects for converted boards

Fixes https://gitlab.com/kicad/code/kicad/-/issues/6209
This commit is contained in:
Jon Evans 2020-11-28 22:45:56 -05:00
parent 5e117bfaa5
commit f78d909ffb
1 changed files with 18 additions and 19 deletions

View File

@ -584,8 +584,6 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
bool converted = pluginType != IO_MGR::LEGACY && pluginType != IO_MGR::KICAD_SEXP; bool converted = pluginType != IO_MGR::LEGACY && pluginType != IO_MGR::KICAD_SEXP;
if( !converted )
{
// Loading a project should only be done under carefully considered circumstances. // Loading a project should only be done under carefully considered circumstances.
// The calling code should know not to ask me here to change projects unless // The calling code should know not to ask me here to change projects unless
@ -604,10 +602,11 @@ bool PCB_EDIT_FRAME::OpenProjectFiles( const std::vector<wxString>& aFileSet, in
// Do not allow saving a project if one doesn't exist. This normally happens if we are // Do not allow saving a project if one doesn't exist. This normally happens if we are
// standalone and opening a board that has been moved from its project folder. // standalone and opening a board that has been moved from its project folder.
if( !pro.Exists() ) // For converted projects, we don't want to set the read-only flag because we want a project
// to be saved for the new file in case things like netclasses got migrated.
if( !pro.Exists() && !converted )
Prj().SetReadOnly(); Prj().SetReadOnly();
} }
}
if( is_new ) if( is_new )
{ {