Allow board saves without modifying project files
Without the project files, certain settings will not be saved by this python call. This defaults to false (current behavior) but setting the `aSkipSettings` to true will revert to v5 behavior Fixes https://gitlab.com/kicad/code/kicad/issues/11323
This commit is contained in:
@@ -241,7 +241,7 @@ BOARD* CreateEmptyBoard()
|
||||
}
|
||||
|
||||
|
||||
bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat )
|
||||
bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat, bool aSkipSettings )
|
||||
{
|
||||
aBoard->BuildConnectivity();
|
||||
aBoard->SynchronizeNetsAndNetClasses();
|
||||
@@ -255,20 +255,23 @@ bool SaveBoard( wxString& aFileName, BOARD* aBoard, IO_MGR::PCB_FILE_T aFormat )
|
||||
return false;
|
||||
}
|
||||
|
||||
wxFileName pro = aFileName;
|
||||
pro.SetExt( ProjectFileExtension );
|
||||
pro.MakeAbsolute();
|
||||
wxString projectPath = pro.GetFullPath();
|
||||
if( !aSkipSettings )
|
||||
{
|
||||
wxFileName pro = aFileName;
|
||||
pro.SetExt( ProjectFileExtension );
|
||||
pro.MakeAbsolute();
|
||||
wxString projectPath = pro.GetFullPath();
|
||||
|
||||
GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() );
|
||||
GetSettingsManager()->SaveProjectAs( pro.GetFullPath(), aBoard->GetProject() );
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
|
||||
bool SaveBoard( wxString& aFileName, BOARD* aBoard )
|
||||
bool SaveBoard( wxString& aFileName, BOARD* aBoard, bool aSkipSettings )
|
||||
{
|
||||
return SaveBoard( aFileName, aBoard, IO_MGR::KICAD_SEXP );
|
||||
return SaveBoard( aFileName, aBoard, IO_MGR::KICAD_SEXP, aSkipSettings );
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user