From 994a9c5ff8df897f8509c6bf178fb79cbdd1f46f Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Tue, 24 Jul 2018 18:43:17 +0100 Subject: [PATCH] Only show all layers when the stackup changes. Fixes: lp:1783231 * https://bugs.launchpad.net/kicad/+bug/1783231 --- pcbnew/dialogs/panel_setup_layers.cpp | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/pcbnew/dialogs/panel_setup_layers.cpp b/pcbnew/dialogs/panel_setup_layers.cpp index 0180173bbd..6b7d3a52c4 100644 --- a/pcbnew/dialogs/panel_setup_layers.cpp +++ b/pcbnew/dialogs/panel_setup_layers.cpp @@ -559,16 +559,18 @@ bool PANEL_SETUP_LAYERS::TransferDataFromWindow() } } - wxString name; - m_enabledLayers = getUILayerMask(); - m_pcb->SetEnabledLayers( m_enabledLayers ); - /* Ensure enabled layers are also visible - * This is mainly to avoid mistakes if some enabled - * layers are not visible when exiting this dialog - */ - m_pcb->SetVisibleLayers( m_enabledLayers ); + if( m_enabledLayers != m_pcb->GetEnabledLayers() ) + { + m_pcb->SetEnabledLayers( m_enabledLayers ); + + /* Ensure enabled layers are also visible + * This is mainly to avoid mistakes if some enabled + * layers are not visible when exiting this dialog + */ + m_pcb->SetVisibleLayers( m_enabledLayers ); + } for( LSEQ seq = LSET::AllCuMask().Seq(); seq; ++seq ) { @@ -576,8 +578,7 @@ bool PANEL_SETUP_LAYERS::TransferDataFromWindow() if( m_enabledLayers[layer] ) { - name = getLayerName( layer ); - m_pcb->SetLayerName( layer, name ); + m_pcb->SetLayerName( layer, getLayerName( layer ) ); LAYER_T t = (LAYER_T) getLayerTypeIndex( layer ); m_pcb->SetLayerType( layer, t ); }