From 893618bf3f07eb539f76a2a0dc677da4b870ef9b Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Thu, 24 Jul 2014 13:09:16 +0200 Subject: [PATCH] Fixed a hot key conflict. --- common/tool/action_manager.cpp | 9 +++++++++ pcbnew/tools/common_actions.cpp | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/common/tool/action_manager.cpp b/common/tool/action_manager.cpp index a64ab9e1d5..91d5c4d7df 100644 --- a/common/tool/action_manager.cpp +++ b/common/tool/action_manager.cpp @@ -58,6 +58,15 @@ void ACTION_MANAGER::RegisterAction( TOOL_ACTION* aAction ) m_actionNameIndex[aAction->m_name] = aAction; m_actionIdIndex[aAction->m_id] = aAction; +#ifndef NDEBUG + // Check if there are two global actions assigned to the same hotkey + if( aAction->GetScope() == AS_GLOBAL ) + { + BOOST_FOREACH( const TOOL_ACTION* action, m_actionHotKeys[aAction->m_currentHotKey] ) + assert( action->GetScope() != AS_GLOBAL ); + } +#endif /* not NDEBUG */ + if( aAction->HasHotKey() ) m_actionHotKeys[aAction->m_currentHotKey].push_back( aAction ); } diff --git a/pcbnew/tools/common_actions.cpp b/pcbnew/tools/common_actions.cpp index 5bb01cfdf5..a239d27aa2 100644 --- a/pcbnew/tools/common_actions.cpp +++ b/pcbnew/tools/common_actions.cpp @@ -314,7 +314,7 @@ TOOL_ACTION COMMON_ACTIONS::moduleTextOutlines( "pcbnew.ModuleEditor.textOutline // Miscellaneous TOOL_ACTION COMMON_ACTIONS::selectionTool( "pcbnew.Control.selectionTool", - AS_GLOBAL, ' ', + AS_GLOBAL, 0, "", "", AF_ACTIVATE ); TOOL_ACTION COMMON_ACTIONS::resetCoords( "pcbnew.Control.resetCoords",