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
This commit is contained in:
Maciej Suminski 2017-06-30 22:59:56 +02:00
parent 5d252639fa
commit 3afef4e19d
1 changed files with 15 additions and 7 deletions

View File

@ -97,6 +97,9 @@ FOOTPRINT_SELECT_WIDGET::FOOTPRINT_SELECT_WIDGET( wxWindow* aParent,
void FOOTPRINT_SELECT_WIDGET::Load( KIWAY& aKiway, PROJECT& aProject ) void FOOTPRINT_SELECT_WIDGET::Load( KIWAY& aKiway, PROJECT& aProject )
{ {
m_kiway = &aKiway; m_kiway = &aKiway;
try
{
auto fp_lib_table = aProject.PcbFootprintLibs( aKiway ); auto fp_lib_table = aProject.PcbFootprintLibs( aKiway );
if( m_fp_loader.GetProgress() == 0 || !m_fp_loader.IsSameTable( fp_lib_table ) ) if( m_fp_loader.GetProgress() == 0 || !m_fp_loader.IsSameTable( fp_lib_table ) )
@ -108,6 +111,11 @@ void FOOTPRINT_SELECT_WIDGET::Load( KIWAY& aKiway, PROJECT& aProject )
m_progress_timer->Start( 200 ); m_progress_timer->Start( 200 );
} }
catch( ... )
{
// no footprint libraries available
}
}
void FOOTPRINT_SELECT_WIDGET::OnProgressTimer( wxTimerEvent& aEvent ) void FOOTPRINT_SELECT_WIDGET::OnProgressTimer( wxTimerEvent& aEvent )