Nix a dialog in kicad_cli.cpp that shouldn't ever fire
This commit is contained in:
parent
02c5a31b99
commit
460b08c6ca
|
@ -26,7 +26,6 @@
|
||||||
#include <wx/filename.h>
|
#include <wx/filename.h>
|
||||||
#include <wx/log.h>
|
#include <wx/log.h>
|
||||||
#include <wx/stdpaths.h>
|
#include <wx/stdpaths.h>
|
||||||
#include <wx/msgdlg.h>
|
|
||||||
#include <wx/wxcrtvararg.h> //for wxPrintf
|
#include <wx/wxcrtvararg.h> //for wxPrintf
|
||||||
|
|
||||||
#include <kiway.h>
|
#include <kiway.h>
|
||||||
|
@ -514,32 +513,6 @@ struct APP_KICAD_CLI : public wxAppConsole
|
||||||
|
|
||||||
int FilterEvent( wxEvent& aEvent ) override
|
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;
|
return Event_Skip;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue