Put Repair Schematic behind Advanced Config.

This commit is contained in:
Jeff Young 2021-11-25 12:16:42 +00:00
parent f3b3d18319
commit 5863bc0937
4 changed files with 18 additions and 8 deletions

View File

@ -177,6 +177,8 @@ static const wxChar HideVersionFromTitle[] = wxT( "HideVersionFromTitle" );
static const wxChar TraceMasks[] = wxT( "TraceMasks" ); static const wxChar TraceMasks[] = wxT( "TraceMasks" );
static const wxChar ShowRepairSchematic[] = wxT( "ShowRepairSchematic" );
} // namespace KEYS } // namespace KEYS
@ -395,6 +397,9 @@ void ADVANCED_CFG::loadSettings( wxConfigBase& aCfg )
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HideVersionFromTitle, configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::HideVersionFromTitle,
&m_HideVersionFromTitle, false ) ); &m_HideVersionFromTitle, false ) );
configParams.push_back( new PARAM_CFG_BOOL( true, AC_KEYS::ShowRepairSchematic,
&m_ShowRepairSchematic, false ) );
// 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
// Because we even use wxLogTrace inside of advanced config // Because we even use wxLogTrace inside of advanced config
wxString traceMasks = ""; wxString traceMasks = "";

View File

@ -37,6 +37,7 @@
#include "eeschema_id.h" #include "eeschema_id.h"
#include "sch_edit_frame.h" #include "sch_edit_frame.h"
#include <widgets/wx_menubar.h> #include <widgets/wx_menubar.h>
#include <advanced_config.h>
void SCH_EDIT_FRAME::ReCreateMenuBar() void SCH_EDIT_FRAME::ReCreateMenuBar()
@ -252,7 +253,9 @@ void SCH_EDIT_FRAME::ReCreateMenuBar()
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
toolsMenu->Add( EE_ACTIONS::rescueSymbols ); toolsMenu->Add( EE_ACTIONS::rescueSymbols );
toolsMenu->Add( EE_ACTIONS::remapSymbols ); toolsMenu->Add( EE_ACTIONS::remapSymbols );
toolsMenu->Add( EE_ACTIONS::repairSchematic );
if( ADVANCED_CFG::GetCfg().m_ShowRepairSchematic )
toolsMenu->Add( EE_ACTIONS::repairSchematic );
toolsMenu->AppendSeparator(); toolsMenu->AppendSeparator();
toolsMenu->Add( EE_ACTIONS::editSymbolFields ); toolsMenu->Add( EE_ACTIONS::editSymbolFields );

View File

@ -2191,11 +2191,11 @@ int SCH_EDITOR_CONTROL::RepairSchematic( const TOOL_EVENT& aEvent )
{ {
SCH_SCREEN* screen = sheet.LastScreen(); SCH_SCREEN* screen = sheet.LastScreen();
for( SCH_ITEM* aItem : screen->Items().OfType( SCH_SYMBOL_T ) ) for( SCH_ITEM* item : screen->Items().OfType( SCH_SYMBOL_T ) )
{ {
processItem( aItem ); processItem( item );
for( SCH_PIN* pin : static_cast<SCH_SYMBOL*>( aItem )->GetPins( &sheet ) ) for( SCH_PIN* pin : static_cast<SCH_SYMBOL*>( item )->GetPins( &sheet ) )
processItem( pin ); processItem( pin );
} }
} }
@ -2204,14 +2204,14 @@ int SCH_EDITOR_CONTROL::RepairSchematic( const TOOL_EVENT& aEvent )
{ {
SCH_SCREEN* screen = sheet.LastScreen(); SCH_SCREEN* screen = sheet.LastScreen();
for( SCH_ITEM* aItem : screen->Items() ) for( SCH_ITEM* item : screen->Items() )
{ {
processItem( aItem ); processItem( item );
aItem->RunOnChildren( item->RunOnChildren(
[&]( SCH_ITEM* aChild ) [&]( SCH_ITEM* aChild )
{ {
processItem( aItem ); processItem( item );
} ); } );
} }
} }

View File

@ -195,6 +195,8 @@ public:
*/ */
bool m_HideVersionFromTitle; bool m_HideVersionFromTitle;
bool m_ShowRepairSchematic;
private: private:
ADVANCED_CFG(); ADVANCED_CFG();