Nix a dialog in kicad_cli.cpp that shouldn't ever fire

This commit is contained in:
Marek Roszko 2023-04-16 20:09:57 -04:00
parent 02c5a31b99
commit 460b08c6ca
1 changed files with 0 additions and 27 deletions

View File

@ -26,7 +26,6 @@
#include <wx/filename.h>
#include <wx/log.h>
#include <wx/stdpaths.h>
#include <wx/msgdlg.h>
#include <wx/wxcrtvararg.h> //for wxPrintf
#include <kiway.h>
@ -514,32 +513,6 @@ struct APP_KICAD_CLI : public wxAppConsole
int FilterEvent( wxEvent& aEvent ) override
{
if( aEvent.GetEventType() == wxEVT_SHOW )
{
wxShowEvent& event = static_cast<wxShowEvent&>( aEvent );
wxDialog* dialog = dynamic_cast<wxDialog*>( event.GetEventObject() );
std::vector<void*>& dlgs = Pgm().m_ModalDialogs;
if( dialog )
{
if( event.IsShown() && dialog->IsModal() )
{
dlgs.push_back( dialog );
}
// Under GTK, sometimes the modal flag is cleared before hiding
else if( !event.IsShown() && !dlgs.empty() )
{
// If we close the expected dialog, remove it from our stack
if( dlgs.back() == dialog )
dlgs.pop_back();
// If an out-of-order, remove all dialogs added after the closed one
else if( auto it = std::find( dlgs.begin(), dlgs.end(), dialog ) ; it != dlgs.end() )
dlgs.erase( it, dlgs.end() );
}
}
}
return Event_Skip;
}