Use advanced_config key EnableGenerators to enable menu entries for generators.

This commit is contained in:
Alex Shvartzkop 2023-10-07 19:18:21 +03:00 committed by dsa-t
parent f11339f1f5
commit b77df1eea4
3 changed files with 24 additions and 7 deletions

View File

@ -213,6 +213,8 @@ static const wxChar V3DRT_BevelExtentFactor[] = wxT( "V3DRT_BevelExtentFactor" )
static const wxChar UseClipper2[] = wxT( "UseClipper2" ); static const wxChar UseClipper2[] = wxT( "UseClipper2" );
static const wxChar EnableGenerators[] = wxT( "EnableGenerators" );
/** /**
* The time in milliseconds to wait before displaying a disambiguation menu. * The time in milliseconds to wait before displaying a disambiguation menu.
*/ */
@ -342,6 +344,7 @@ ADVANCED_CFG::ADVANCED_CFG()
m_UpdateUIEventInterval = 0; m_UpdateUIEventInterval = 0;
m_ShowRepairSchematic = false; m_ShowRepairSchematic = false;
m_ShowPropertiesPanel = false; m_ShowPropertiesPanel = false;
m_EnableGenerators = false;
m_3DRT_BevelHeight_um = 30; m_3DRT_BevelHeight_um = 30;
m_3DRT_BevelExtentFactor = 1.0 / 16.0; m_3DRT_BevelExtentFactor = 1.0 / 16.0;
@ -512,6 +515,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
&m_DisambiguationMenuDelay, m_DisambiguationMenuDelay, &m_DisambiguationMenuDelay, m_DisambiguationMenuDelay,
50, 10000 ) ); 50, 10000 ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::EnableGenerators,
&m_EnableGenerators, m_EnableGenerators ) );
// Special case for trace mask setting...we just grab them and set them immediately // Special case for trace mask setting...we just grab them and set them immediately

View File

@ -274,6 +274,11 @@ public:
*/ */
int m_DisambiguationMenuDelay; int m_DisambiguationMenuDelay;
/**
* When true, enable support for generators
*/
bool m_EnableGenerators;
///@} ///@}

View File

@ -312,8 +312,11 @@ void PCB_EDIT_FRAME::doReCreateMenuBar()
placeMenu->Add( PCB_ACTIONS::placeText ); placeMenu->Add( PCB_ACTIONS::placeText );
placeMenu->Add( PCB_ACTIONS::drawTextBox ); placeMenu->Add( PCB_ACTIONS::drawTextBox );
placeMenu->AppendSeparator(); if( ADVANCED_CFG::GetCfg().m_EnableGenerators )
placeMenu->Add( PCB_ACTIONS::placeMeanders ); {
placeMenu->AppendSeparator();
placeMenu->Add( PCB_ACTIONS::placeMeanders );
}
placeMenu->AppendSeparator(); placeMenu->AppendSeparator();
placeMenu->Add( PCB_ACTIONS::drawAlignedDimension ); placeMenu->Add( PCB_ACTIONS::drawAlignedDimension );
@ -400,11 +403,14 @@ void PCB_EDIT_FRAME::doReCreateMenuBar()
toolsMenu->Add( ACTIONS::showFootprintEditor ); toolsMenu->Add( ACTIONS::showFootprintEditor );
toolsMenu->Add( PCB_ACTIONS::updateFootprints ); toolsMenu->Add( PCB_ACTIONS::updateFootprints );
toolsMenu->AppendSeparator(); if( ADVANCED_CFG::GetCfg().m_EnableGenerators )
toolsMenu->Add( PCB_ACTIONS::generatorsShowManager ); {
toolsMenu->Add( PCB_ACTIONS::regenerateAll ); toolsMenu->AppendSeparator();
toolsMenu->Add( PCB_ACTIONS::regenerateOutdated ); toolsMenu->Add( PCB_ACTIONS::generatorsShowManager );
toolsMenu->Add( PCB_ACTIONS::regenerateSelected ); toolsMenu->Add( PCB_ACTIONS::regenerateAll );
toolsMenu->Add( PCB_ACTIONS::regenerateOutdated );
toolsMenu->Add( PCB_ACTIONS::regenerateSelected );
}
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
toolsMenu->Add( PCB_ACTIONS::cleanupTracksAndVias ); toolsMenu->Add( PCB_ACTIONS::cleanupTracksAndVias );