eeschema: Add component needs to be Modal

Adding a component in eeschema accesses the footprint table as well as
the symbol table.  There are no safe edits that can be taken while this
window is open, so we force it to be Modal instead of QuasiModal

The issue is addressed but reveals additional possible problems that
this commit fixes

Fixes https://gitlab.com/kicad/code/kicad/issues/5206
This commit is contained in:
Seth Hillbrand 2020-08-18 11:21:26 -07:00
parent 6ef20e34fc
commit a029feb029
2 changed files with 14 additions and 3 deletions

View File

@ -333,7 +333,13 @@ LIB_ID DIALOG_CHOOSE_COMPONENT::GetSelectedLibId( int* aUnit ) const
void DIALOG_CHOOSE_COMPONENT::OnUseBrowser( wxCommandEvent& aEvent )
{
m_external_browser_requested = true;
EndQuasiModal( wxID_OK );
if( IsQuasiModal() )
EndQuasiModal( wxID_OK );
else if( IsModal() )
EndModal( wxID_OK );
else
wxFAIL_MSG( "Dialog called with neither Modal nor QuasiModal" );
}
@ -353,7 +359,12 @@ void DIALOG_CHOOSE_COMPONENT::OnCloseTimer( wxTimerEvent& aEvent )
}
else
{
EndQuasiModal( wxID_OK );
if( IsQuasiModal() )
EndQuasiModal( wxID_OK );
else if( IsModal() )
EndModal( wxID_OK );
else
wxFAIL_MSG( "Dialog called with neither Modal nor QuasiModal" );
}
}

View File

@ -154,7 +154,7 @@ COMPONENT_SELECTION SCH_BASE_FRAME::SelectCompFromLibTree( const SCHLIB_FILTER*
DIALOG_CHOOSE_COMPONENT dlg( this, dialogTitle, adapterPtr, aConvert,
aAllowFields, aShowFootprints, aUseLibBrowser );
if( dlg.ShowQuasiModal() == wxID_CANCEL )
if( dlg.ShowModal() == wxID_CANCEL )
return COMPONENT_SELECTION();
COMPONENT_SELECTION sel;