From 5f851a4bad92a1e2edfea912f5dfb9326c44c0e3 Mon Sep 17 00:00:00 2001 From: Jeff Young Date: Fri, 17 May 2019 16:44:58 +0100 Subject: [PATCH] Add AutoplaceFields to symbol tool context menu. --- eeschema/tools/ee_actions.h | 2 +- eeschema/tools/sch_edit_tool.cpp | 27 ++++++++++++++------------- eeschema/tools/sch_editor_control.cpp | 6 +++--- eeschema/tools/sch_editor_control.h | 2 +- 4 files changed, 19 insertions(+), 18 deletions(-) diff --git a/eeschema/tools/ee_actions.h b/eeschema/tools/ee_actions.h index 9e7bb72a69..6592657cce 100644 --- a/eeschema/tools/ee_actions.h +++ b/eeschema/tools/ee_actions.h @@ -150,7 +150,7 @@ public: static TOOL_ACTION showDatasheet; static TOOL_ACTION showMarkerInfo; static TOOL_ACTION showSymbolEditor; - static TOOL_ACTION editWithSymbolEditor; + static TOOL_ACTION editWithLibEdit; static TOOL_ACTION showLibraryBrowser; /// Clipboard diff --git a/eeschema/tools/sch_edit_tool.cpp b/eeschema/tools/sch_edit_tool.cpp index 8b0d57e24c..b472d8edf3 100644 --- a/eeschema/tools/sch_edit_tool.cpp +++ b/eeschema/tools/sch_edit_tool.cpp @@ -388,24 +388,25 @@ bool SCH_EDIT_TOOL::Init() // CONDITIONAL_MENU& drawMenu = drawingTools->GetToolMenu().GetMenu(); - drawMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::rotateCCW, orientCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::rotateCW, orientCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::mirrorX, orientCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::mirrorY, orientCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition, 200 ); - drawMenu.AddItem( EE_ACTIONS::convertDeMorgan, EE_CONDITIONS::SingleDeMorganSymbol, 200 ); + drawMenu.AddItem( EE_ACTIONS::properties, propertiesCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::editReference, singleComponentCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::editValue, singleComponentCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::editFootprint, singleComponentCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::autoplaceFields, singleComponentCondition, 200 ); + drawMenu.AddItem( EE_ACTIONS::convertDeMorgan, EE_CONDITIONS::SingleDeMorganSymbol, 200 ); std::shared_ptr symUnitMenu2 = std::make_shared(); symUnitMenu2->SetTool( drawingTools ); drawingTools->GetToolMenu().AddSubMenu( symUnitMenu2 ); drawMenu.AddMenu( symUnitMenu2.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 ); - drawMenu.AddItem( EE_ACTIONS::editWithSymbolEditor, - singleComponentCondition && EE_CONDITIONS::Idle, 200 ); + drawMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleComponentCondition + && EE_CONDITIONS::Idle, 200 ); drawMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 ); drawMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 ); @@ -439,8 +440,8 @@ bool SCH_EDIT_TOOL::Init() m_selectionTool->GetToolMenu().AddSubMenu( symUnitMenu3 ); selToolMenu.AddMenu( symUnitMenu3.get(), EE_CONDITIONS::SingleMultiUnitSymbol, 1 ); - selToolMenu.AddItem( EE_ACTIONS::editWithSymbolEditor, - singleComponentCondition && EE_CONDITIONS::Idle, 200 ); + selToolMenu.AddItem( EE_ACTIONS::editWithLibEdit, singleComponentCondition + && EE_CONDITIONS::Idle, 200 ); selToolMenu.AddItem( EE_ACTIONS::toShapeSlash, entryCondition, 200 ); selToolMenu.AddItem( EE_ACTIONS::toShapeBackslash, entryCondition, 200 ); diff --git a/eeschema/tools/sch_editor_control.cpp b/eeschema/tools/sch_editor_control.cpp index 780a3a00d8..d0029f418e 100644 --- a/eeschema/tools/sch_editor_control.cpp +++ b/eeschema/tools/sch_editor_control.cpp @@ -81,7 +81,7 @@ TOOL_ACTION EE_ACTIONS::showSymbolEditor( "eeschema.EditorControl.showSymbolEdit _( "Show Symbol Editor" ), _( "Create, delete and edit symbols" ), libedit_xpm ); -TOOL_ACTION EE_ACTIONS::editWithSymbolEditor( "eeschema.EditorControl.editWithSymbolEditor", +TOOL_ACTION EE_ACTIONS::editWithLibEdit( "eeschema.EditorControl.editWithSymbolEditor", AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_COMPONENT_WITH_LIBEDIT ), _( "Edit with Symbol Editor" ), _( "Open the symbol editor to edit the symbol" ), libedit_xpm ); @@ -705,7 +705,7 @@ int SCH_EDITOR_CONTROL::FindReplace( const TOOL_EVENT& aEvent ) } -int SCH_EDITOR_CONTROL::EditWithSymbolEditor( const TOOL_EVENT& aEvent ) +int SCH_EDITOR_CONTROL::EditWithLibEdit( const TOOL_EVENT& aEvent ) { EE_SELECTION_TOOL* selTool = m_toolMgr->GetTool(); SELECTION& selection = selTool->RequestSelection( EE_COLLECTOR::ComponentsOnly ); @@ -830,7 +830,7 @@ void SCH_EDITOR_CONTROL::setTransitions() Go( &SCH_EDITOR_CONTROL::FindReplace, ACTIONS::find.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::FindReplace, ACTIONS::replace.MakeEvent() ); - Go( &SCH_EDITOR_CONTROL::EditWithSymbolEditor, EE_ACTIONS::editWithSymbolEditor.MakeEvent() ); + Go( &SCH_EDITOR_CONTROL::EditWithLibEdit, EE_ACTIONS::editWithLibEdit.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::ShowSymbolEditor, EE_ACTIONS::showSymbolEditor.MakeEvent() ); Go( &SCH_EDITOR_CONTROL::ShowLibraryBrowser, EE_ACTIONS::showLibraryBrowser.MakeEvent() ); diff --git a/eeschema/tools/sch_editor_control.h b/eeschema/tools/sch_editor_control.h index 6945b7e81e..031507573b 100644 --- a/eeschema/tools/sch_editor_control.h +++ b/eeschema/tools/sch_editor_control.h @@ -83,7 +83,7 @@ public: int FindReplace( const TOOL_EVENT& aEvent ); - int EditWithSymbolEditor( const TOOL_EVENT& aEvent ); + int EditWithLibEdit( const TOOL_EVENT& aEvent ); int ShowSymbolEditor( const TOOL_EVENT& aEvent ); int ShowLibraryBrowser( const TOOL_EVENT& aEvent );