From e4b847b345d95355915b993b16c63692cbbc2105 Mon Sep 17 00:00:00 2001 From: Jon Evans Date: Thu, 8 Mar 2018 18:19:38 -0500 Subject: [PATCH] GerbView: fix a few issues with layer selection / info synchronization Fixes: lp:1754135 * https://bugs.launchpad.net/kicad/+bug/1754135 --- gerbview/gerbview_frame.cpp | 10 +++------- gerbview/job_file_reader.cpp | 4 ++-- 2 files changed, 5 insertions(+), 9 deletions(-) diff --git a/gerbview/gerbview_frame.cpp b/gerbview/gerbview_frame.cpp index 16131c59d8..75e1ec8e91 100644 --- a/gerbview/gerbview_frame.cpp +++ b/gerbview/gerbview_frame.cpp @@ -206,7 +206,6 @@ GERBVIEW_FRAME::GERBVIEW_FRAME( KIWAY* aKiway, wxWindow* aParent ): SetActiveLayer( 0, true ); Zoom_Automatique( false ); // Gives a default zoom value - UpdateTitleAndInfo(); EDA_DRAW_PANEL_GAL::GAL_TYPE canvasType = loadCanvasTypeSetting(); @@ -333,7 +332,7 @@ bool GERBVIEW_FRAME::OpenProjectFiles( const std::vector& aFileSet, in int layer = 0; - for( unsigned i=0; i& aFileSet, in Zoom_Automatique( true ); // Zoom fit in frame - UpdateTitleAndInfo(); - return true; } @@ -576,7 +573,6 @@ int GERBVIEW_FRAME::getNextAvailableLayer( int aLayer ) const void GERBVIEW_FRAME::syncLayerWidget() { m_LayersManager->SelectLayer( GetActiveLayer() ); - UpdateTitleAndInfo(); } @@ -599,8 +595,6 @@ void GERBVIEW_FRAME::syncLayerBox( bool aRebuildLayerBox ) m_DCodeSelector->SetDCodeSelection( dcodeSelected ); m_DCodeSelector->Enable( gerber != NULL ); } - - UpdateTitleAndInfo(); } @@ -978,6 +972,8 @@ void GERBVIEW_FRAME::SetActiveLayer( int aLayer, bool doLayerWidgetUpdate ) if( doLayerWidgetUpdate ) m_LayersManager->SelectLayer( GetActiveLayer() ); + UpdateTitleAndInfo(); + if( IsGalCanvasActive() ) { m_toolManager->RunAction( GERBVIEW_ACTIONS::layerChanged ); // notify other tools diff --git a/gerbview/job_file_reader.cpp b/gerbview/job_file_reader.cpp index 93a1eb2269..f0f381e245 100644 --- a/gerbview/job_file_reader.cpp +++ b/gerbview/job_file_reader.cpp @@ -195,10 +195,10 @@ bool GERBVIEW_FRAME::LoadGerberJobFile( const wxString& aFullFileName ) } } - Zoom_Automatique( false ); - SortLayersByX2Attributes(); + SetActiveLayer( 0 ); + if( !msg.IsEmpty() ) { wxSafeYield(); // Allows slice of time to redraw the screen