better fix than commit 6c083ebf4c
, because the issue was existing in other dialogs
Fix incorrect frame deletion, only noticeable when eeschema is run in stand alone mode. After selecting a footprint using the footprint viewer, the application cannot be closed. Reason: the footprint viewer ctor creates an instance (not shown) of a FRAME_PCB. Unfortunately, this pcb frame was not deleted by Eeschema, in stand alone mode, preventing the application to be closed because a frame was still active after closing the schematic editor frame. Now the footprint viewer ctor delete this instance after use, if it was not previously existing.
This commit is contained in:
parent
6c083ebf4c
commit
80371134d7
|
@ -202,11 +202,6 @@ wxString FOOTPRINT_SELECT_WIDGET::ShowPicker()
|
||||||
// event loop goes all silly.
|
// event loop goes all silly.
|
||||||
wxASSERT( !dsparent || dsparent->IsQuasiModal() );
|
wxASSERT( !dsparent || dsparent->IsQuasiModal() );
|
||||||
|
|
||||||
// Now open the footprint viewer.
|
|
||||||
// However, this viewer creates a not shown PCB_EDIT_FRAME_NAME, if
|
|
||||||
// it does not exist previously.
|
|
||||||
// We must delete it when exiting, if it is not existing
|
|
||||||
auto pcbframe = m_kiway->Player( FRAME_PCB, false ); // return nullptr if not yet existing.
|
|
||||||
auto frame = m_kiway->Player( FRAME_PCB_MODULE_VIEWER_MODAL, true );
|
auto frame = m_kiway->Player( FRAME_PCB_MODULE_VIEWER_MODAL, true );
|
||||||
|
|
||||||
if( !frame->ShowModal( &fpname, parent ) )
|
if( !frame->ShowModal( &fpname, parent ) )
|
||||||
|
@ -216,16 +211,6 @@ wxString FOOTPRINT_SELECT_WIDGET::ShowPicker()
|
||||||
|
|
||||||
frame->Destroy();
|
frame->Destroy();
|
||||||
|
|
||||||
// If the PCB_EDIT_FRAME was not previoulsy existing, delete the newly created one:
|
|
||||||
if( !pcbframe )
|
|
||||||
{
|
|
||||||
pcbframe = m_kiway->Player( FRAME_PCB, false );
|
|
||||||
|
|
||||||
if( pcbframe )
|
|
||||||
pcbframe->Destroy();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
return fpname;
|
return fpname;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -186,6 +186,10 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
||||||
ReCreateLibraryList();
|
ReCreateLibraryList();
|
||||||
UpdateTitle();
|
UpdateTitle();
|
||||||
|
|
||||||
|
// See for an existing board editor frame opened
|
||||||
|
// (we need it just to know some settings )
|
||||||
|
bool isBordEditorRunning = Kiway().Player( FRAME_PCB, false ) != nullptr;
|
||||||
|
|
||||||
PCB_BASE_FRAME* parentFrame = static_cast<PCB_BASE_FRAME*>( Kiway().Player( FRAME_PCB, true ) );
|
PCB_BASE_FRAME* parentFrame = static_cast<PCB_BASE_FRAME*>( Kiway().Player( FRAME_PCB, true ) );
|
||||||
|
|
||||||
// Create GAL canvas
|
// Create GAL canvas
|
||||||
|
@ -287,6 +291,9 @@ FOOTPRINT_VIEWER_FRAME::FOOTPRINT_VIEWER_FRAME( KIWAY* aKiway, wxWindow* aParent
|
||||||
|
|
||||||
UseGalCanvas( parentFrame->IsGalCanvasActive() );
|
UseGalCanvas( parentFrame->IsGalCanvasActive() );
|
||||||
|
|
||||||
|
if( !isBordEditorRunning && IsModal() )
|
||||||
|
parentFrame->Destroy();
|
||||||
|
|
||||||
if( !IsModal() ) // For modal mode, calling ShowModal() will show this frame
|
if( !IsModal() ) // For modal mode, calling ShowModal() will show this frame
|
||||||
{
|
{
|
||||||
Raise(); // On some window managers, this is needed
|
Raise(); // On some window managers, this is needed
|
||||||
|
|
Loading…
Reference in New Issue