Make sure 3D file browser is treated as modal by quit.
(Otherwise we crash when freeing it during the quit.)
(cherry picked from commit c36b0fcda7
)
This commit is contained in:
parent
117c70ed7d
commit
0bd45f691e
|
@ -167,15 +167,28 @@ EDA_BASE_FRAME::EDA_BASE_FRAME( wxWindow* aParent, FRAME_T aFrameType, const wxS
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
wxWindow* findQuasiModalDialog( wxWindow* aParent )
|
||||||
|
{
|
||||||
|
for( wxWindow* child : aParent->GetChildren() )
|
||||||
|
{
|
||||||
|
if( DIALOG_SHIM* dlg = dynamic_cast<DIALOG_SHIM*>( child ) )
|
||||||
|
{
|
||||||
|
if( dlg->IsQuasiModal() )
|
||||||
|
return dlg;
|
||||||
|
|
||||||
|
if( wxWindow* nestedDlg = findQuasiModalDialog( child ) )
|
||||||
|
return nestedDlg;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return nullptr;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
wxWindow* EDA_BASE_FRAME::findQuasiModalDialog()
|
wxWindow* EDA_BASE_FRAME::findQuasiModalDialog()
|
||||||
{
|
{
|
||||||
for( wxWindow* iter : GetChildren() )
|
if( wxWindow* dlg = ::findQuasiModalDialog( this ) )
|
||||||
{
|
return dlg;
|
||||||
DIALOG_SHIM* dlg = dynamic_cast<DIALOG_SHIM*>( iter );
|
|
||||||
|
|
||||||
if( dlg && dlg->IsQuasiModal() )
|
|
||||||
return dlg;
|
|
||||||
}
|
|
||||||
|
|
||||||
// FIXME: CvPcb is currently implemented on top of KIWAY_PLAYER rather than DIALOG_SHIM,
|
// FIXME: CvPcb is currently implemented on top of KIWAY_PLAYER rather than DIALOG_SHIM,
|
||||||
// so we have to look for it separately.
|
// so we have to look for it separately.
|
||||||
|
|
|
@ -308,7 +308,7 @@ void PANEL_FP_PROPERTIES_3D_MODEL::OnAdd3DModel( wxCommandEvent& )
|
||||||
filter = (int) tmp;
|
filter = (int) tmp;
|
||||||
}
|
}
|
||||||
|
|
||||||
if( !S3D::Select3DModel( this, m_frame->Prj().Get3DCacheManager(), initialpath, filter, &model )
|
if( !S3D::Select3DModel( m_parentDialog, m_frame->Prj().Get3DCacheManager(), initialpath, filter, &model )
|
||||||
|| model.m_Filename.empty() )
|
|| model.m_Filename.empty() )
|
||||||
{
|
{
|
||||||
select3DModel( selected );
|
select3DModel( selected );
|
||||||
|
|
Loading…
Reference in New Issue