From 5b0b92710a1b749728f5d29b34271ac8bf5b46d5 Mon Sep 17 00:00:00 2001 From: Nimetu Date: Sat, 21 Jan 2017 13:29:24 +0200 Subject: [PATCH] Added: copy_to_clipboard action handler --HG-- branch : develop --- code/nel/src/gui/action_handler.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/code/nel/src/gui/action_handler.cpp b/code/nel/src/gui/action_handler.cpp index b43d37ded..2d2246937 100644 --- a/code/nel/src/gui/action_handler.cpp +++ b/code/nel/src/gui/action_handler.cpp @@ -23,6 +23,7 @@ #include "nel/gui/db_manager.h" #include "nel/gui/interface_link.h" #include "nel/gui/widget_manager.h" +#include "nel/gui/view_renderer.h" using namespace std; using namespace NLMISC; @@ -742,4 +743,14 @@ namespace NLGUI }; REGISTER_ACTION_HANDLER (CAHUnlockAllContainer, "unlock_all_container"); -} \ No newline at end of file + // ------------------------------------------------------------------------------------------------ + class CAHCopyToClipboard : public IActionHandler + { + virtual void execute (CCtrlBase *pCaller, const std::string ¶ms) + { + if (!CViewRenderer::getInstance()->getDriver()->copyTextToClipboard(params)) + nlwarning("Copy to clipboard failed: '%s'", params.c_str()); + } + }; + REGISTER_ACTION_HANDLER(CAHCopyToClipboard, "copy_to_clipboard"); +}