Add missing footprint load progress, usually in schematic editor

This commit is contained in:
Marek Roszko 2023-05-07 10:46:16 -04:00
parent 5bf450a89f
commit c7eaef2d13
2 changed files with 11 additions and 3 deletions

View File

@ -23,6 +23,7 @@
#include <project.h>
#include <widgets/footprint_choice.h>
#include <widgets/footprint_select_widget.h>
#include <widgets/wx_progress_reporters.h>
#include <progress_reporter.h>
#include <footprint_info_impl.h>
#include <wx/wupdlock.h>
@ -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 );
@ -64,7 +66,12 @@ 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<FOOTPRINT_LIST_IMPL*>( m_fp_list )->ReadFootprintFiles( fpTable );
WX_PROGRESS_REPORTER* progressReporter =
new WX_PROGRESS_REPORTER( m_frame, _( "Loading Footprint Libraries" ), 3 );
static_cast<FOOTPRINT_LIST_IMPL*>( m_fp_list )
->ReadFootprintFiles( fpTable, nullptr, progressReporter );
delete progressReporter;
}
m_fp_filter.SetList( *m_fp_list );

View File

@ -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 );
};