diff --git a/include/kiway.h b/include/kiway.h index 55773a18a6..75f377f428 100644 --- a/include/kiway.h +++ b/include/kiway.h @@ -394,6 +394,12 @@ public: KIWAY( PGM_BASE* aProgram, int aCtlBits, wxFrame* aTop = nullptr ); + /** + * Overwrites previously set ctl bits, only for use in kicad.cpp to flip between + * standalone and manager mode before we actually load anything + */ + void SetCtlBits( int aCtlBits ) { m_ctl = aCtlBits; } + /** * Tell this KIWAY about the top most frame in the program and optionally allows it to * play the role of one of the KIWAY_PLAYERs if launched from single_top.cpp. diff --git a/kicad/kicad.cpp b/kicad/kicad.cpp index 5a5dbf974e..31739ee058 100644 --- a/kicad/kicad.cpp +++ b/kicad/kicad.cpp @@ -152,6 +152,15 @@ bool PGM_KICAD::OnPgmInit() } } + if( appType == KICAD_MAIN_FRAME_T ) + { + Kiway.SetCtlBits( KFCTL_CPP_PROJECT_SUITE ); + } + else + { + Kiway.SetCtlBits( KFCTL_STANDALONE ); + } + bool skipPythonInit = false; if( appType == FRAME_BM2CMP || appType == FRAME_PL_EDITOR || appType == FRAME_GERBER @@ -163,7 +172,6 @@ bool PGM_KICAD::OnPgmInit() m_bm.InitSettings( new KICAD_SETTINGS ); GetSettingsManager().RegisterSettings( PgmSettings() ); - GetSettingsManager().SetKiway( &Kiway ); m_bm.Init(); // Add search paths to feed the PGM_KICAD::SysSearch() function,