diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-11-12 09:23:39 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-11-12 09:23:39 +0100 |
commit | fdc58bb91360c04eed13a4fd4f8323a6a467dc37 (patch) | |
tree | c4cee6d1c623d60bd51bc254649749824f36d539 /logic | |
parent | e611aef0e77f727d0c77f6dea0d373e7a12b241c (diff) | |
download | MultiMC-fdc58bb91360c04eed13a4fd4f8323a6a467dc37.tar MultiMC-fdc58bb91360c04eed13a4fd4f8323a6a467dc37.tar.gz MultiMC-fdc58bb91360c04eed13a4fd4f8323a6a467dc37.tar.lz MultiMC-fdc58bb91360c04eed13a4fd4f8323a6a467dc37.tar.xz MultiMC-fdc58bb91360c04eed13a4fd4f8323a6a467dc37.zip |
Fix console not staying open on minecraft crash
Diffstat (limited to 'logic')
-rw-r--r-- | logic/MinecraftProcess.cpp | 23 | ||||
-rw-r--r-- | logic/MinecraftProcess.h | 2 |
2 files changed, 15 insertions, 10 deletions
diff --git a/logic/MinecraftProcess.cpp b/logic/MinecraftProcess.cpp index ff122628..6c86c73a 100644 --- a/logic/MinecraftProcess.cpp +++ b/logic/MinecraftProcess.cpp @@ -111,19 +111,24 @@ void MinecraftProcess::on_stdOut() // exit handler void MinecraftProcess::finish(int code, ExitStatus status) { - if (status != NormalExit) + if (!killed) { - // TODO: error handling + if (status == NormalExit) + { + //: Message displayed on instance exit + emit log(tr("Minecraft exited with exitcode %1.").arg(code)); + } + else + { + //: Message displayed on instance crashed + emit log(tr("Minecraft crashed with exitcode %1.").arg(code)); + } } - - // TODO: Localization - - if (!killed) - //: Message displayed on instance exit - emit log(tr("Minecraft exited with exitcode %1.").arg(status)); else + { //: Message displayed after the instance exits due to kill request emit log(tr("Minecraft was killed by user."), MessageLevel::Error); + } m_prepostlaunchprocess.processEnvironment().insert("INST_EXITCODE", QString(code)); @@ -138,7 +143,7 @@ void MinecraftProcess::finish(int code, ExitStatus status) } } m_instance->cleanupAfterRun(); - emit ended(m_instance); + emit ended(m_instance, code, status); } void MinecraftProcess::killMinecraft() diff --git a/logic/MinecraftProcess.h b/logic/MinecraftProcess.h index ad887c5b..2a61e172 100644 --- a/logic/MinecraftProcess.h +++ b/logic/MinecraftProcess.h @@ -74,7 +74,7 @@ signals: /** * @brief emitted when mc has finished and the PostLaunchCommand was run */ - void ended(BaseInstance *); + void ended(BaseInstance *, int code, ExitStatus status); /** * @brief emitted when we want to log something |