From de2e84a86c3419a41de594951c452e25dde60d86 Mon Sep 17 00:00:00 2001 From: Andrei Karas Date: Wed, 27 Aug 2014 16:26:22 +0300 Subject: Move chat command /uploadserverconfig into actions. --- src/actions/actions.cpp | 9 +++++++++ src/actions/actions.h | 1 + src/commands.cpp | 9 --------- src/commands.h | 5 +---- src/input/inputaction.h | 1 + src/input/inputactionmap.h | 9 +++++++++ src/input/pages/other.cpp | 6 ++++++ 7 files changed, 27 insertions(+), 13 deletions(-) (limited to 'src') diff --git a/src/actions/actions.cpp b/src/actions/actions.cpp index 8406f236e..7eab1f928 100644 --- a/src/actions/actions.cpp +++ b/src/actions/actions.cpp @@ -1146,4 +1146,13 @@ impHandler(uploadConfig) return true; } +impHandler(uploadServerConfig) +{ + uploadFile(_("Uploaded server config into:"), + serverConfig.getFileName(), + "?xml", + event.tab); + return true; +} + } // namespace Actions diff --git a/src/actions/actions.h b/src/actions/actions.h index dcaf043d9..2997180c4 100644 --- a/src/actions/actions.h +++ b/src/actions/actions.h @@ -85,6 +85,7 @@ namespace Actions #endif decHandler(createItems); decHandler(uploadConfig); + decHandler(uploadServerConfig); } // namespace Actions #undef decHandler diff --git a/src/commands.cpp b/src/commands.cpp index fae194ee1..585d44cc5 100644 --- a/src/commands.cpp +++ b/src/commands.cpp @@ -171,15 +171,6 @@ static void uploadFile(const std::string &str, upload->start(); } -impHandler(uploadServerConfig) -{ - uploadFile(_("Uploaded server config into:"), - serverConfig.getFileName(), - "?xml", - event.tab); - return true; -} - impHandler(uploadLog) { uploadFile(_("Uploaded log into:"), diff --git a/src/commands.h b/src/commands.h index 6ceb84d6c..4feffefbd 100644 --- a/src/commands.h +++ b/src/commands.h @@ -52,7 +52,6 @@ struct CommandInfo final namespace Commands { decHandler(hack); - decHandler(uploadServerConfig); decHandler(uploadLog); decHandler(gm); decHandler(debugSpawn); @@ -62,8 +61,7 @@ namespace Commands enum { - COMMAND_UPLOADSERVERCONFIG = 0, - COMMAND_UPLOADLOG, + COMMAND_UPLOADLOG = 0, COMMAND_GM, COMMAND_HACK, COMMAND_DEBUGSPAWN, @@ -72,7 +70,6 @@ enum static const CommandInfo commands[] = { - {"uploadserverconfig", &Commands::uploadServerConfig, -1, false}, {"uploadlog", &Commands::uploadLog, -1, false}, {"gm", &Commands::gm, -1, true}, {"hack", &Commands::hack, -1, true}, diff --git a/src/input/inputaction.h b/src/input/inputaction.h index 3dbd37d27..cf7886bf5 100644 --- a/src/input/inputaction.h +++ b/src/input/inputaction.h @@ -419,6 +419,7 @@ namespace InputAction TALK_RAW, TALK_PET, UPLOAD_CONFIG, + UPLOAD_SERVER_CONFIG, TOTAL }; } // namespace InputAction diff --git a/src/input/inputactionmap.h b/src/input/inputactionmap.h index 5739d8eac..1af14ffc7 100644 --- a/src/input/inputactionmap.h +++ b/src/input/inputactionmap.h @@ -3548,6 +3548,15 @@ static const InputActionData inputActionData[InputAction::TOTAL] = { InputAction::NO_VALUE, 50, InputCondition::INGAME, "uploadconfig", + false}, + {"keyUploadServerConfig", + InputType::UNKNOWN, InputAction::NO_VALUE, + InputType::UNKNOWN, InputAction::NO_VALUE, + Input::GRP_DEFAULT, + &Actions::uploadServerConfig, + InputAction::NO_VALUE, 50, + InputCondition::INGAME, + "uploadserverconfig", false} }; diff --git a/src/input/pages/other.cpp b/src/input/pages/other.cpp index 1f6eea0c8..6369a509f 100644 --- a/src/input/pages/other.cpp +++ b/src/input/pages/other.cpp @@ -353,6 +353,12 @@ SetupActionData setupActionDataOther[] = InputAction::UPLOAD_CONFIG, "", }, + { + // TRANSLATORS: input action name + N_("Upload server config"), + InputAction::UPLOAD_SERVER_CONFIG, + "", + }, { "", InputAction::NO_VALUE, -- cgit v1.2.3-60-g2f50