Import layer settings before swapping boards

The rebuildLayerStackPanel() reads from the current board to setup the
panel.  We maintain the board swap until after the setup is completed

Fixes https://gitlab.com/kicad/code/kicad/issues/9370
This commit is contained in:
Seth Hillbrand 2021-10-11 11:46:02 -07:00
parent 58f553a9ca
commit 1b7358f93a
2 changed files with 9 additions and 15 deletions

View File

@ -1215,11 +1215,11 @@ void PANEL_SETUP_BOARD_STACKUP::ImportSettingsFrom( BOARD* aBoard )
m_enabledLayers = m_panelLayers->GetUILayerMask() & BOARD_STACKUP::StackupAllowedBrdLayers();
synchronizeWithBoard( true );
m_brdSettings = savedSettings;
m_board = savedBrd;
rebuildLayerStackPanel();
computeBoardThickness();
m_brdSettings = savedSettings;
m_board = savedBrd;
}

View File

@ -238,8 +238,14 @@ void DIALOG_BOARD_SETUP::OnAuxiliaryAction( wxCommandEvent& event )
{
otherBoard->SetProject( otherPrj );
// If layers options are imported, import also the stackup
// layers options and stackup are linked, so they cannot be imported
// separately, and stackup can be imported only after layers options
if( importDlg.m_LayersOpt->GetValue() )
{
m_layers->ImportSettingsFrom( otherBoard );
m_physicalStackup->ImportSettingsFrom( otherBoard );
}
if( importDlg.m_TextAndGraphicsOpt->GetValue() )
m_textAndGraphics->ImportSettingsFrom( otherBoard );
@ -256,18 +262,6 @@ void DIALOG_BOARD_SETUP::OnAuxiliaryAction( wxCommandEvent& event )
if( importDlg.m_MaskAndPasteOpt->GetValue() )
m_maskAndPaste->ImportSettingsFrom( otherBoard );
// If layers options are imported, import also the stackup
// layers options and stackup are linked, so they cannot be imported
// separately, and stackup can be imported only after layers options
//
// Note also currently only the list of enabled layers can be imported, because
// we import settings from a .pro project file, not the settings inside
// a board, and info only living in the board is not imported.
// TODO: Add import of physical settings now that we are actually loading the board here
if( importDlg.m_LayersOpt->GetValue() )
m_physicalStackup->ImportSettingsFrom( otherBoard );
if( importDlg.m_SeveritiesOpt->GetValue() )
m_severities->ImportSettingsFrom( otherBoard->GetDesignSettings().m_DRCSeverities );