From c7eaef2d13d48b0bbc784ca1c2c58a54797c4ed7 Mon Sep 17 00:00:00 2001 From: Marek Roszko Date: Sun, 7 May 2023 10:46:16 -0400 Subject: [PATCH] Add missing footprint load progress, usually in schematic editor --- common/widgets/footprint_select_widget.cpp | 13 ++++++++++--- include/widgets/footprint_select_widget.h | 1 + 2 files changed, 11 insertions(+), 3 deletions(-) diff --git a/common/widgets/footprint_select_widget.cpp b/common/widgets/footprint_select_widget.cpp index 1078e3a15d..46c637d68b 100644 --- a/common/widgets/footprint_select_widget.cpp +++ b/common/widgets/footprint_select_widget.cpp @@ -23,6 +23,7 @@ #include #include #include +#include #include #include #include @@ -38,7 +39,8 @@ FOOTPRINT_SELECT_WIDGET::FOOTPRINT_SELECT_WIDGET( EDA_DRAW_FRAME* aFrame, wxWind wxPanel( aParent ), m_update( aUpdate ), m_max_items( aMaxItems ), - m_fp_list( aFpList ) + m_fp_list( aFpList ), + m_frame( aFrame ) { m_zero_filter = true; m_sizer = new wxBoxSizer( wxVERTICAL ); @@ -63,8 +65,13 @@ void FOOTPRINT_SELECT_WIDGET::Load( KIWAY& aKiway, PROJECT& aProject ) { // If the fp-info-cache is empty (or, more likely, hasn't been created in a new // project yet), load footprints the hard way. - FP_LIB_TABLE* fpTable = aProject.PcbFootprintLibs( aKiway ); - static_cast( m_fp_list )->ReadFootprintFiles( fpTable ); + FP_LIB_TABLE* fpTable = aProject.PcbFootprintLibs( aKiway ); + WX_PROGRESS_REPORTER* progressReporter = + new WX_PROGRESS_REPORTER( m_frame, _( "Loading Footprint Libraries" ), 3 ); + static_cast( m_fp_list ) + ->ReadFootprintFiles( fpTable, nullptr, progressReporter ); + + delete progressReporter; } m_fp_filter.SetList( *m_fp_list ); diff --git a/include/widgets/footprint_select_widget.h b/include/widgets/footprint_select_widget.h index 2a9d838ed0..11d39fdc03 100644 --- a/include/widgets/footprint_select_widget.h +++ b/include/widgets/footprint_select_widget.h @@ -133,6 +133,7 @@ private: FOOTPRINT_LIST* m_fp_list; FOOTPRINT_FILTER m_fp_filter; bool m_zero_filter; + EDA_DRAW_FRAME* m_frame; void OnComboBox( wxCommandEvent& aEvent ); };