From 12adb25a7142cf9d83cff903e7947d27d7dec1b0 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 16 Jun 2015 15:27:59 +0200 Subject: [PATCH] Fixed 'Edit in footprint editor' hotkey (GAL). --- pcbnew/tools/common_actions.cpp | 10 +++++----- pcbnew/tools/edit_tool.cpp | 9 +++++++++ 2 files changed, 14 insertions(+), 5 deletions(-) diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index d46d592bad..a26cc908ed 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -75,23 +75,23 @@ TOOL_ACTION COMMON_ACTIONS::findMove( "pcbnew.InteractiveSelection.FindMove", // Edit tool actions TOOL_ACTION COMMON_ACTIONS::editFootprintInFpEditor( "pcbnew.InteractiveEdit.editFootprintInFpEditor", - AS_CONTEXT, TOOL_ACTION::LegacyHotKey( HK_EDIT_MODULE_WITH_MODEDIT ), + AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_EDIT_MODULE_WITH_MODEDIT ), _( "Open in Footprint Editor" ), _( "Opens the selected footprint in the Footprint Editor" ), module_editor_xpm ); TOOL_ACTION COMMON_ACTIONS::copyPadToSettings( "pcbnew.InteractiveEdit.copyPadToSettings", - AS_CONTEXT, 0, + AS_GLOBAL, 0, _( "Copy pad settings to Current Settings" ), _( "Copies the properties of selected pad to the current template pad settings." ) ); TOOL_ACTION COMMON_ACTIONS::copySettingsToPads( "pcbnew.InteractiveEdit.copySettingsToPads", - AS_CONTEXT, 0, + AS_GLOBAL, 0, _( "Copy Current Settings to pads" ), _( "Copies the current template pad settings to the selected pad(s)." ) ); -TOOL_ACTION COMMON_ACTIONS::globalEditPads ( "pcbnew.InteractiveEdit.globalPadEdit", - AS_CONTEXT, 0, +TOOL_ACTION COMMON_ACTIONS::globalEditPads( "pcbnew.InteractiveEdit.globalPadEdit", + AS_GLOBAL, 0, _( "Global Pad Edition" ), _( "Changes pad properties globally." ), global_options_pad_xpm ); diff --git a/pcbnew/tools/edit_tool.cpp b/pcbnew/tools/edit_tool.cpp index 1f20f2f52c..46419f989d 100644 --- a/pcbnew/tools/edit_tool.cpp +++ b/pcbnew/tools/edit_tool.cpp @@ -1052,6 +1052,12 @@ void EDIT_TOOL::processChanges( const PICKED_ITEMS_LIST* aList ) int EDIT_TOOL::editFootprintInFpEditor( const TOOL_EVENT& aEvent ) { + const SELECTION& selection = m_selectionTool->GetSelection(); + bool unselect = selection.Empty(); + + if( !hoverSelection( selection ) ) + return 0; + MODULE* mod = uniqueSelected(); if( !mod ) @@ -1075,5 +1081,8 @@ int EDIT_TOOL::editFootprintInFpEditor( const TOOL_EVENT& aEvent ) editor->Show( true ); editor->Raise(); // Iconize( false ); + if( unselect ) + m_toolMgr->RunAction( COMMON_ACTIONS::selectionClear, true ); + return 0; }