summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2014-08-27 16:26:22 +0300
committerAndrei Karas <akaras@inbox.ru>2014-08-27 16:26:22 +0300
commitde2e84a86c3419a41de594951c452e25dde60d86 (patch)
treea791b7d043b1e1574d76cd7d64c34e1afa2b48ed
parentd69abc43187ded70dce586d793a4dc1dbcd1010d (diff)
downloadManaVerse-de2e84a86c3419a41de594951c452e25dde60d86.tar.gz
ManaVerse-de2e84a86c3419a41de594951c452e25dde60d86.tar.bz2
ManaVerse-de2e84a86c3419a41de594951c452e25dde60d86.tar.xz
ManaVerse-de2e84a86c3419a41de594951c452e25dde60d86.zip
Move chat command /uploadserverconfig into actions.
-rw-r--r--src/actions/actions.cpp9
-rw-r--r--src/actions/actions.h1
-rw-r--r--src/commands.cpp9
-rw-r--r--src/commands.h5
-rw-r--r--src/input/inputaction.h1
-rw-r--r--src/input/inputactionmap.h9
-rw-r--r--src/input/pages/other.cpp6
7 files changed, 27 insertions, 13 deletions
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
@@ -354,6 +354,12 @@ SetupActionData setupActionDataOther[] =
"",
},
{
+ // TRANSLATORS: input action name
+ N_("Upload server config"),
+ InputAction::UPLOAD_SERVER_CONFIG,
+ "",
+ },
+ {
"",
InputAction::NO_VALUE,
""