From 3afef4e19d139a8c8630ee598388bd6a114be178 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 30 Jun 2017 22:59:56 +0200 Subject: [PATCH] Display an error when pcbnew.kiface is not available for FP selector DIALOG_COMPONENT_CHOOSE displays footprint preview when pcbnew kiface is available, but it crashed when it was not in the same directory as the executable. Now it displays an error message that allows the user to quickly identify the problem. Fixes: lp:1695005 * https://bugs.launchpad.net/kicad/+bug/1695005 --- common/widgets/footprint_select_widget.cpp | 22 +++++++++++++++------- 1 file changed, 15 insertions(+), 7 deletions(-) diff --git a/common/widgets/footprint_select_widget.cpp b/common/widgets/footprint_select_widget.cpp index 430c0849ce..d3b8375f64 100644 --- a/common/widgets/footprint_select_widget.cpp +++ b/common/widgets/footprint_select_widget.cpp @@ -97,16 +97,24 @@ FOOTPRINT_SELECT_WIDGET::FOOTPRINT_SELECT_WIDGET( wxWindow* aParent, void FOOTPRINT_SELECT_WIDGET::Load( KIWAY& aKiway, PROJECT& aProject ) { m_kiway = &aKiway; - auto fp_lib_table = aProject.PcbFootprintLibs( aKiway ); - if( m_fp_loader.GetProgress() == 0 || !m_fp_loader.IsSameTable( fp_lib_table ) ) + try { - m_fp_list = FOOTPRINT_LIST::GetInstance( aKiway ); - m_fp_loader.SetList( &*m_fp_list ); - m_fp_loader.Start( fp_lib_table ); - } + auto fp_lib_table = aProject.PcbFootprintLibs( aKiway ); - m_progress_timer->Start( 200 ); + if( m_fp_loader.GetProgress() == 0 || !m_fp_loader.IsSameTable( fp_lib_table ) ) + { + m_fp_list = FOOTPRINT_LIST::GetInstance( aKiway ); + m_fp_loader.SetList( &*m_fp_list ); + m_fp_loader.Start( fp_lib_table ); + } + + m_progress_timer->Start( 200 ); + } + catch( ... ) + { + // no footprint libraries available + } }