From 4a4c0914bcb835981f2eec84766dfc806aa9c868 Mon Sep 17 00:00:00 2001 From: Maciej Suminski Date: Tue, 3 Dec 2013 15:41:41 +0100 Subject: [PATCH] Added TOOL_MANAGER::RunAction() function. --- common/tool/tool_manager.cpp | 6 ++++++ include/tool/tool_manager.h | 9 +++++++++ 2 files changed, 15 insertions(+) diff --git a/common/tool/tool_manager.cpp b/common/tool/tool_manager.cpp index 9fe8715604..9e56e61545 100644 --- a/common/tool/tool_manager.cpp +++ b/common/tool/tool_manager.cpp @@ -194,6 +194,12 @@ void TOOL_MANAGER::UnregisterAction( TOOL_ACTION* aAction ) } +bool TOOL_MANAGER::RunAction( const std::string& aActionName ) +{ + return m_actionMgr->RunAction( aActionName ); +} + + bool TOOL_MANAGER::invokeTool( TOOL_BASE* aTool ) { wxASSERT( aTool != NULL ); diff --git a/include/tool/tool_manager.h b/include/tool/tool_manager.h index 38a2879ccd..57026c2712 100644 --- a/include/tool/tool_manager.h +++ b/include/tool/tool_manager.h @@ -99,6 +99,15 @@ public: */ void UnregisterAction( TOOL_ACTION* aAction ); + /** + * Function RunAction() + * Runs the specified action. The common format is "application.ToolName.Action". + * + * @param aActionName is the name of action to be invoked. + * @return True if the action finished successfully, false otherwise. + */ + bool RunAction( const std::string& aActionName ); + /** * Function FindTool() * Searches for a tool with given ID.