diff options
author | Andrei Karas <akaras@inbox.ru> | 2014-08-27 16:32:44 +0300 |
---|---|---|
committer | Andrei Karas <akaras@inbox.ru> | 2014-08-27 16:32:44 +0300 |
commit | 60c983e043b9ec502b65785306887003f5bcb27b (patch) | |
tree | f563332745eea7bb17fa31046db74364e4183ad4 | |
parent | de2e84a86c3419a41de594951c452e25dde60d86 (diff) | |
download | mv-60c983e043b9ec502b65785306887003f5bcb27b.tar.gz mv-60c983e043b9ec502b65785306887003f5bcb27b.tar.bz2 mv-60c983e043b9ec502b65785306887003f5bcb27b.tar.xz mv-60c983e043b9ec502b65785306887003f5bcb27b.zip |
Move chat command /uploadlog into actions.
-rw-r--r-- | src/actions/actions.cpp | 9 | ||||
-rw-r--r-- | src/actions/actions.h | 1 | ||||
-rw-r--r-- | src/commands.cpp | 9 | ||||
-rw-r--r-- | src/commands.h | 5 | ||||
-rw-r--r-- | src/input/inputaction.h | 1 | ||||
-rw-r--r-- | src/input/inputactionmap.h | 9 | ||||
-rw-r--r-- | src/input/pages/other.cpp | 6 | ||||
-rw-r--r-- | src/listeners/uploadlistener.cpp | 6 |
8 files changed, 29 insertions, 17 deletions
diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 7eab1f928..8e2f3623b 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1155,4 +1155,13 @@ impHandler(uploadServerConfig) return true; } +impHandler(uploadLog) +{ + uploadFile(_("Uploaded log into:"), + settings.logFileName, + "?txt", + event.tab); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index 2997180c4..f241b321c 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -86,6 +86,7 @@ namespace Actions decHandler(createItems); decHandler(uploadConfig); decHandler(uploadServerConfig); + decHandler(uploadLog); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index 585d44cc5..1e859888f 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -171,15 +171,6 @@ static void uploadFile(const std::string &str, upload->start(); } -impHandler(uploadLog) -{ - uploadFile(_("Uploaded log into:"), - settings.logFileName, - "?txt", - event.tab); - return true; -} - impHandler0(debugSpawn) { int cnt = atoi(event.args.c_str()); diff --git a/src/commands.h b/src/commands.h index 4feffefbd..553b97ba4 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(hack); - decHandler(uploadLog); decHandler(gm); decHandler(debugSpawn); @@ -61,8 +60,7 @@ namespace Commands enum { - COMMAND_UPLOADLOG = 0, - COMMAND_GM, + COMMAND_GM = 0, COMMAND_HACK, COMMAND_DEBUGSPAWN, END_COMMANDS @@ -70,7 +68,6 @@ enum static const CommandInfo commands[] = { - {"uploadlog", &Commands::uploadLog, -1, false}, {"gm", &Commands::gm, -1, true}, {"hack", &Commands::hack, -1, true}, {"debugSpawn", &Commands::debugSpawn, -1, true} diff --git a/src/input/inputaction.h b/src/input/inputaction.h index cf7886bf5..93a3a48a7 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -420,6 +420,7 @@ namespace InputAction TALK_PET, UPLOAD_CONFIG, UPLOAD_SERVER_CONFIG, + UPLOAD_LOG, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 1af14ffc7..aa9432b06 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3557,6 +3557,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "uploadserverconfig", + false}, + {"keyUploadLog", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::uploadLog, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "uploadlog", false} }; diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 6369a509f..9d16f4b8a 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -360,6 +360,12 @@ SetupActionData setupActionDataOther[] = "", }, { + // TRANSLATORS: input action name + N_("Upload log file"), + InputAction::UPLOAD_LOG, + "", + }, + { "", InputAction::NO_VALUE, "" diff --git a/src/listeners/uploadlistener.cpp b/src/listeners/uploadlistener.cpp index 0403d9af0..7e9590f82 100644 --- a/src/listeners/uploadlistener.cpp +++ b/src/listeners/uploadlistener.cpp @@ -20,8 +20,7 @@ #include "listeners/uploadlistener.h" -#include "commandhandler.h" -#include "commands.h" +#include "input/inputmanager.h" #include "debug.h" @@ -29,6 +28,5 @@ UploadListener uploadListener; void UploadListener::action(const ActionEvent &event A_UNUSED) { - if (commandHandler) - commandHandler->invokeCommand(COMMAND_UPLOADLOG, ""); + inputManager.executeAction(InputAction::UPLOAD_LOG); } |