From 805bfb048b96077e879e001245f0ab7d53decf66 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Fri, 30 Jun 2017 14:59:16 +0200 Subject: [PATCH] pcbnew: Configurable hotkeys for PNS - routing options - custom track/via size - differential pair dimensions - increase/decrease via size --- pcbnew/hotkeys.cpp | 12 ++++++++++++ pcbnew/hotkeys.h | 7 ++++++- pcbnew/router/pns_tool_base.cpp | 3 ++- pcbnew/router/router_tool.cpp | 4 ++-- pcbnew/tools/pcb_editor_control.cpp | 4 ++-- 5 files changed, 24 insertions(+), 6 deletions(-) diff --git a/pcbnew/hotkeys.cpp b/pcbnew/hotkeys.cpp index 9ba0b415eb..1a8b740fdc 100644 --- a/pcbnew/hotkeys.cpp +++ b/pcbnew/hotkeys.cpp @@ -241,6 +241,16 @@ static EDA_HOTKEY HkSelectConnection( _HKI( "Select Trivial Connection" ), HK_SE static EDA_HOTKEY HkSelectCopper( _HKI( "Select Copper Connection" ), HK_SEL_COPPER_CONNECTION, 'I' ); +static EDA_HOTKEY HkRoutingOptions( _HKI( "Routing Options" ), HK_ROUTING_OPTIONS, 'E' ); + +static EDA_HOTKEY HkCustomTrackWidth( _HKI( "Custom Track/Via Size" ), HK_CUSTOM_TRACK_WIDTH, 'Q' ); + +static EDA_HOTKEY HkDpDimension( _HKI( "Differential Pair Dimensions" ), HK_DP_DIMENSIONS, 'P' ); + +static EDA_HOTKEY HkViaSizeInc( _HKI( "Increase Via Size" ), HK_VIA_SIZE_INC, '\'' ); + +static EDA_HOTKEY HkViaSizeDec( _HKI( "Decrease Via Size" ), HK_VIA_SIZE_DEC, '\\' ); + // List of common hotkey descriptors EDA_HOTKEY* common_Hotkey_List[] = { @@ -294,6 +304,8 @@ EDA_HOTKEY* board_edit_Hotkey_List[] = &HkCanvasDefault, &HkCanvasCairo, &HkCanvasOpenGL, &HkZoneFillOrRefill, &HkZoneRemoveFilled, &HkSelectConnection, &HkSelectCopper, + &HkRoutingOptions, &HkCustomTrackWidth, &HkDpDimension, + &HkViaSizeInc, &HkViaSizeDec, NULL }; diff --git a/pcbnew/hotkeys.h b/pcbnew/hotkeys.h index 6ddd6c7645..271a1093e9 100644 --- a/pcbnew/hotkeys.h +++ b/pcbnew/hotkeys.h @@ -105,7 +105,12 @@ enum hotkey_id_commnand { HK_INC_LAYER_ALHPA, HK_DEC_LAYER_ALHPA, HK_SEL_TRIVIAL_CONNECTION, - HK_SEL_COPPER_CONNECTION + HK_SEL_COPPER_CONNECTION, + HK_ROUTING_OPTIONS, + HK_CUSTOM_TRACK_WIDTH, + HK_DP_DIMENSIONS, + HK_VIA_SIZE_INC, + HK_VIA_SIZE_DEC }; // Full list of hotkey descriptors for board editor and footprint editor diff --git a/pcbnew/router/pns_tool_base.cpp b/pcbnew/router/pns_tool_base.cpp index f8b4849919..18cc53c776 100644 --- a/pcbnew/router/pns_tool_base.cpp +++ b/pcbnew/router/pns_tool_base.cpp @@ -39,6 +39,7 @@ using namespace std::placeholders; #include #include #include +#include #include #include @@ -61,7 +62,7 @@ using namespace KIGFX; namespace PNS { TOOL_ACTION TOOL_BASE::ACT_RouterOptions( "pcbnew.InteractiveRouter.RouterOptions", - AS_CONTEXT, 'E', + AS_CONTEXT, TOOL_ACTION::LegacyHotKey( HK_ROUTING_OPTIONS ), _( "Routing Options..." ), _( "Shows a dialog containing router options." ), tools_xpm ); diff --git a/pcbnew/router/router_tool.cpp b/pcbnew/router/router_tool.cpp index 61f34d361e..318f503413 100644 --- a/pcbnew/router/router_tool.cpp +++ b/pcbnew/router/router_tool.cpp @@ -163,7 +163,7 @@ static const TOOL_ACTION ACT_SelLayerAndPlaceBlindVia( (void*) ( VIA_ACTION_FLAGS::BLIND_VIA | VIA_ACTION_FLAGS::SELECT_LAYER ) ); static const TOOL_ACTION ACT_CustomTrackWidth( "pcbnew.InteractiveRouter.CustomTrackViaSize", - AS_CONTEXT, 'Q', + AS_CONTEXT, TOOL_ACTION::LegacyHotKey( HK_CUSTOM_TRACK_WIDTH ), _( "Custom Track/Via Size" ), _( "Shows a dialog for changing the track width and via size." ), width_track_xpm ); @@ -175,7 +175,7 @@ static const TOOL_ACTION ACT_SwitchPosture( "pcbnew.InteractiveRouter.SwitchPost change_entry_orient_xpm ); static const TOOL_ACTION ACT_SetDpDimensions( "pcbnew.InteractiveRouter.SetDpDimensions", - AS_CONTEXT, 'P', + AS_CONTEXT, TOOL_ACTION::LegacyHotKey( HK_DP_DIMENSIONS ), _( "Differential Pair Dimensions..." ), _( "Sets the width and gap of the currently routed differential pair." ), ps_diff_pair_tune_length_xpm ); diff --git a/pcbnew/tools/pcb_editor_control.cpp b/pcbnew/tools/pcb_editor_control.cpp index 02df6c8865..da5af6566f 100644 --- a/pcbnew/tools/pcb_editor_control.cpp +++ b/pcbnew/tools/pcb_editor_control.cpp @@ -70,11 +70,11 @@ TOOL_ACTION PCB_ACTIONS::trackWidthDec( "pcbnew.EditorControl.trackWidthDec", "", "" ); TOOL_ACTION PCB_ACTIONS::viaSizeInc( "pcbnew.EditorControl.viaSizeInc", - AS_GLOBAL, '\'', + AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_VIA_SIZE_INC ), "", "" ); TOOL_ACTION PCB_ACTIONS::viaSizeDec( "pcbnew.EditorControl.viaSizeDec", - AS_GLOBAL, '\\', + AS_GLOBAL, TOOL_ACTION::LegacyHotKey( HK_VIA_SIZE_DEC ), "", "" ); TOOL_ACTION PCB_ACTIONS::trackViaSizeChanged( "pcbnew.EditorControl.trackViaSizeChanged",