Kicad manager: Avoid crash when calling configure libraries from main menu,

when _eeschema.kiface or _pcbnew.kiface is not found.
Happen mainly when running Kicad from build tree.

From master branch.
This commit is contained in:
jean-pierre charras 2020-02-11 16:15:19 +01:00
parent be0f6a6af2
commit d3f9332372
1 changed files with 20 additions and 4 deletions

View File

@ -574,15 +574,31 @@ void KICAD_MANAGER_FRAME::OnConfigurePaths( wxCommandEvent& aEvent )
void KICAD_MANAGER_FRAME::OnEditSymLibTable( wxCommandEvent& aEvent )
{
KIFACE* kiface = Kiway().KiFACE( KIWAY::FACE_SCH );
kiface->CreateWindow( this, DIALOG_SCH_LIBRARY_TABLE, &Kiway() );
try // _eeschema.kiface must be available: it contains the configure dialog.
{
KIFACE* kiface = Kiway().KiFACE( KIWAY::FACE_SCH );
kiface->CreateWindow( this, DIALOG_SCH_LIBRARY_TABLE, &Kiway() );
}
catch( ... )
{
// Do nothing here.
// A error message is displayed after trying to load _pcbnew.kiface.
}
}
void KICAD_MANAGER_FRAME::OnEditFpLibTable( wxCommandEvent& aEvent )
{
KIFACE* kiface = Kiway().KiFACE( KIWAY::FACE_PCB );
kiface->CreateWindow( this, DIALOG_PCB_LIBRARY_TABLE, &Kiway() );
try // _pcbnew.kiface must be available: it contains the configure dialog.
{
KIFACE* kiface = Kiway().KiFACE( KIWAY::FACE_PCB );
kiface->CreateWindow( this, DIALOG_PCB_LIBRARY_TABLE, &Kiway() );
}
catch( ... )
{
// Do nothing here.
// A error message is displayed after trying to load _pcbnew.kiface.
}
}