Revert active layer behavior so gerber/drill load behavior matches

Fixes: lp:1755713
* https://bugs.launchpad.net/kicad/+bug/1755713
This commit is contained in:
Jon Evans 2018-03-14 21:51:58 -04:00
parent a75ead5efd
commit 213b600b54
1 changed files with 8 additions and 2 deletions

View File

@ -231,7 +231,6 @@ bool GERBVIEW_FRAME::loadListOfGerberFiles( const wxString& aPath,
// Read gerber files: each file is loaded on a new GerbView layer // Read gerber files: each file is loaded on a new GerbView layer
bool success = true; bool success = true;
int layer = GetActiveLayer(); int layer = GetActiveLayer();
int first_layer = layer;
int visibility = GetVisibleLayers(); int visibility = GetVisibleLayers();
// Manage errors when loading files // Manage errors when loading files
@ -315,7 +314,14 @@ bool GERBVIEW_FRAME::loadListOfGerberFiles( const wxString& aPath,
// Synchronize layers tools with actual active layer: // Synchronize layers tools with actual active layer:
ReFillLayerWidget(); ReFillLayerWidget();
SetActiveLayer( first_layer, true );
// TODO: it would be nice if we could set the active layer to one of the
// ones that was just loaded, but to maintain the previous user experience
// we need to set it to a blank layer in case they load another file.
// We can't start with the next available layer when loading files because
// some users expect the behavior of overwriting the active layer on load.
SetActiveLayer( getNextAvailableLayer( layer ), true );
m_LayersManager->UpdateLayerIcons(); m_LayersManager->UpdateLayerIcons();
syncLayerBox( true ); syncLayerBox( true );