Do not try to read from UI elements that haven't been initialized yet
Fixes https://gitlab.com/kicad/code/kicad/-/issues/13480
This commit is contained in:
parent
d07da51390
commit
595bf70d5d
|
@ -1315,6 +1315,10 @@ void PANEL_SETUP_BOARD_STACKUP::ImportSettingsFrom( BOARD* aBoard )
|
||||||
|
|
||||||
void PANEL_SETUP_BOARD_STACKUP::OnLayersOptionsChanged( LSET aNewLayerSet )
|
void PANEL_SETUP_BOARD_STACKUP::OnLayersOptionsChanged( LSET aNewLayerSet )
|
||||||
{
|
{
|
||||||
|
// Can be called spuriously from events before the layers page is even created
|
||||||
|
if( !m_panelLayers->IsInitialized() )
|
||||||
|
return;
|
||||||
|
|
||||||
// First, verify the list of layers currently in stackup:
|
// First, verify the list of layers currently in stackup:
|
||||||
// if it does not mach the list of layers set in PANEL_SETUP_LAYERS
|
// if it does not mach the list of layers set in PANEL_SETUP_LAYERS
|
||||||
// rebuild the panel
|
// rebuild the panel
|
||||||
|
|
|
@ -128,7 +128,8 @@ PANEL_SETUP_LAYERS::PANEL_SETUP_LAYERS( PAGED_DIALOG* aParent, PCB_EDIT_FRAME* a
|
||||||
PANEL_SETUP_LAYERS_BASE( aParent->GetTreebook() ),
|
PANEL_SETUP_LAYERS_BASE( aParent->GetTreebook() ),
|
||||||
m_parentDialog( aParent ),
|
m_parentDialog( aParent ),
|
||||||
m_frame( aFrame ),
|
m_frame( aFrame ),
|
||||||
m_physicalStackup( nullptr )
|
m_physicalStackup( nullptr ),
|
||||||
|
m_initialized( false )
|
||||||
{
|
{
|
||||||
m_pcb = aFrame->GetBoard();
|
m_pcb = aFrame->GetBoard();
|
||||||
}
|
}
|
||||||
|
@ -248,6 +249,8 @@ bool PANEL_SETUP_LAYERS::TransferDataToWindow()
|
||||||
setMandatoryLayerCheckBoxes();
|
setMandatoryLayerCheckBoxes();
|
||||||
setUserDefinedLayerCheckBoxes();
|
setUserDefinedLayerCheckBoxes();
|
||||||
|
|
||||||
|
m_initialized = true;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -91,6 +91,8 @@ public:
|
||||||
m_physicalStackup = aPanel;
|
m_physicalStackup = aPanel;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool IsInitialized() const { return m_initialized; }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|
||||||
void setLayerCheckBox( int layer, bool isChecked );
|
void setLayerCheckBox( int layer, bool isChecked );
|
||||||
|
@ -132,6 +134,7 @@ private:
|
||||||
PANEL_SETUP_BOARD_STACKUP* m_physicalStackup;
|
PANEL_SETUP_BOARD_STACKUP* m_physicalStackup;
|
||||||
BOARD* m_pcb;
|
BOARD* m_pcb;
|
||||||
LSET m_enabledLayers;
|
LSET m_enabledLayers;
|
||||||
|
bool m_initialized;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue