Browse Source

Fix hotkey debug spew

Two issues:

* Unassigned hotkeys were being passed to WX in the menu strings as
  "<unassigned>". WX doesn't recognise this, and prints debug each time.
  Unassigned hotkeys are no longer rare or naughty, so we shouldn't provoke
  debug spew. Suppress by not appending hotkey strings for actions with 0
  (i.e. unassigned) hotkey IDs.
* The zone cutout tool uses GR_KB_SHIFT, not MD_SHIFT. This causes
  "unknown hotkey" spew from WX.
pull/15/head
John Beard 6 years ago
parent
commit
9625cea57f
  1. 13
      common/hotkeys_basic.cpp
  2. 2
      pcbnew/tools/drawing_tool.cpp

13
common/hotkeys_basic.cpp

@ -198,13 +198,22 @@ wxString AddHotkeyName( const wxString& aText, int aHotKey, HOTKEY_ACTION_TYPE a
switch( aStyle )
{
case IS_HOTKEY:
msg << wxT( "\t" ) << keyname;
{
// Don't add a suffix for unassigned hotkeys:
// WX spews debug from wxAcceleratorEntry::ParseAccel if it doesn't
// recognise the keyname, which is the case for <unassigned>.
if( aHotKey != 0 )
{
msg << wxT( "\t" ) << keyname;
}
break;
}
case IS_COMMENT:
{
msg << wxT( " (" ) << keyname << wxT( ")" );
break;
}
}
}
#ifdef USING_MAC_CMD

2
pcbnew/tools/drawing_tool.cpp

@ -125,7 +125,7 @@ TOOL_ACTION PCB_ACTIONS::drawZoneKeepout( "pcbnew.InteractiveDrawing.keepout",
TOOL_ACTION PCB_ACTIONS::drawZoneCutout( "pcbnew.InteractiveDrawing.zoneCutout",
AS_GLOBAL,
GR_KB_SHIFT + 'C', LEGACY_HK_NAME( "Add a Zone Cutout" ),
MD_SHIFT + 'C', LEGACY_HK_NAME( "Add a Zone Cutout" ),
_( "Add a Zone Cutout" ), _( "Add a cutout area of an existing zone" ),
add_zone_cutout_xpm, AF_ACTIVATE );

Loading…
Cancel
Save