From 48aad3331402344a8e28a7b575e548cccea4e5fd Mon Sep 17 00:00:00 2001 From: Seth Hillbrand Date: Mon, 10 Dec 2018 05:43:44 -0700 Subject: [PATCH] Activate the footprint wizard correctly Starting the footprint wizard should cause the actual wizard to activate --- pcbnew/footprint_wizard_frame.cpp | 9 +++++++-- pcbnew/footprint_wizard_frame.h | 2 ++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/pcbnew/footprint_wizard_frame.cpp b/pcbnew/footprint_wizard_frame.cpp index 8039e93ffd..4307a93009 100644 --- a/pcbnew/footprint_wizard_frame.cpp +++ b/pcbnew/footprint_wizard_frame.cpp @@ -122,7 +122,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, wxDefaultPosition, wxDefaultSize, aParent ? KICAD_DEFAULT_DRAWFRAME_STYLE | MODAL_MODE_EXTRASTYLE : KICAD_DEFAULT_DRAWFRAME_STYLE | wxSTAY_ON_TOP, - FOOTPRINT_WIZARD_FRAME_NAME ) + FOOTPRINT_WIZARD_FRAME_NAME ), m_wizardListShown( false ) { wxASSERT( aFrameType == FRAME_PCB_FOOTPRINT_WIZARD ); @@ -271,7 +271,7 @@ FOOTPRINT_WIZARD_FRAME::FOOTPRINT_WIZARD_FRAME( KIWAY* aKiway, // It means the call to FOOTPRINT_WIZARD_FRAME::ShowModal will change the // Event Loop Manager, and stop the one created by the dialog. // It does not happen on all W.M., perhaps due to the way the order events are called -// SelectFootprintWizard(); + // See the call in onActivate instead } @@ -597,6 +597,11 @@ void FOOTPRINT_WIZARD_FRAME::OnActivate( wxActivateEvent& event ) if( !event.GetActive() ) return; + if( !m_wizardListShown ) + { + m_wizardListShown = true; + SelectFootprintWizard(); + } #if 0 // Currently, we do not have a way to see if a Python wizard has changed, // therefore the lists of parameters and option has to be rebuilt diff --git a/pcbnew/footprint_wizard_frame.h b/pcbnew/footprint_wizard_frame.h index dab8cc4927..2d00cdb649 100644 --- a/pcbnew/footprint_wizard_frame.h +++ b/pcbnew/footprint_wizard_frame.h @@ -63,6 +63,8 @@ private: wxString m_auiPerspective; ///< Encoded string describing the AUI layout + bool m_wizardListShown; ///< A show-once flag for the wizard list + protected: wxString m_wizardName; ///< name of the current wizard wxString m_wizardDescription; ///< description of the wizard