Browse Source

Push busyCursor out of scope after building dialog.

Fixes https://gitlab.com/kicad/code/kicad/-/issues/16653
newinvert
Jeff Young 2 years ago
parent
commit
7975ad495b
  1. 22
      common/eda_base_frame.cpp
  2. 3
      common/widgets/wx_busy_indicator.cpp

22
common/eda_base_frame.cpp

@ -1053,13 +1053,14 @@ void EDA_BASE_FRAME::OnPreferences( wxCommandEvent& event )
void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParentPage )
{
WX_BUSY_INDICATOR busy_cursor;
PAGED_DIALOG dlg( this, _( "Preferences" ), true, true, wxEmptyString,
wxWindow::FromDIP( wxSize( 980, 560 ), NULL ) );
dlg.SetEvtHandlerEnabled( false );
{
WX_BUSY_INDICATOR busy_cursor;
WX_TREEBOOK* book = dlg.GetTreebook();
PANEL_HOTKEYS_EDITOR* hotkeysPanel = new PANEL_HOTKEYS_EDITOR( this, book, false );
KIFACE* kiface = nullptr;
@ -1082,24 +1083,26 @@ void EDA_BASE_FRAME::ShowPreferences( wxString aStartPage, wxString aStartParent
book->AddPage( hotkeysPanel, _( "Hotkeys" ) );
// This currently allows pre-defined repositories that we
// don't use, so keep it disabled at the moment
if( ADVANCED_CFG::GetCfg().m_EnableGit && false )
// This currently allows pre-defined repositories that we
// don't use, so keep it disabled at the moment
if( ADVANCED_CFG::GetCfg().m_EnableGit && false )
{
book->AddLazyPage(
[]( wxWindow* aParent ) -> wxWindow*
{
return new PANEL_GIT_REPOS( aParent );
}, _( "Version Control" ) );
}
#ifdef KICAD_USE_SENTRY
#ifdef KICAD_USE_SENTRY
book->AddLazyPage(
[]( wxWindow* aParent ) -> wxWindow*
{
return new PANEL_DATA_COLLECTION( aParent );
}, _( "Data Collection" ) );
#endif
#endif
#define LAZY_CTOR( key ) \
#define LAZY_CTOR( key ) \
[=]( wxWindow* aParent ) \
{ \
return kiface->CreateKiWindow( aParent, key, &Kiway() ); \
@ -1245,6 +1248,8 @@ if( ADVANCED_CFG::GetCfg().m_EnableGit && false )
dlg.SetInitialPage( aStartPage, aStartParentPage );
dlg.SetEvtHandlerEnabled( true );
#undef LAZY_CTOR
}
if( dlg.ShowModal() == wxID_OK )
{
@ -1254,7 +1259,6 @@ if( ADVANCED_CFG::GetCfg().m_EnableGit && false )
dlg.Kiway().CommonSettingsChanged( false, false );
}
#undef LAZY_CTOR
}

3
common/widgets/wx_busy_indicator.cpp

@ -26,6 +26,7 @@
#include <wx/cursor.h>
WX_BUSY_INDICATOR::WX_BUSY_INDICATOR() : m_cursor( std::make_unique<wxBusyCursor>() )
WX_BUSY_INDICATOR::WX_BUSY_INDICATOR() :
m_cursor( std::make_unique<wxBusyCursor>() )
{
}
Loading…
Cancel
Save