Make -f set standalone mode in kiway

This commit is contained in:
Marek Roszko 2022-10-04 23:02:51 -04:00
parent 67e12d4ff6
commit 2bac898298
2 changed files with 15 additions and 1 deletions

View File

@ -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.

View File

@ -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,