diff options
author | Petr Mrázek <peterix@gmail.com> | 2013-11-23 01:41:28 +0100 |
---|---|---|
committer | Petr Mrázek <peterix@gmail.com> | 2013-11-23 01:41:28 +0100 |
commit | 4124faf474908e4d79d93b0f624bf8fd81bd9972 (patch) | |
tree | 335087d96ddab6b862c187969749134be6b4d96e /logic/MinecraftProcess.cpp | |
parent | 7f5eb5d61ad5c94da5e3a0443ffbcd9088285496 (diff) | |
download | MultiMC-4124faf474908e4d79d93b0f624bf8fd81bd9972.tar MultiMC-4124faf474908e4d79d93b0f624bf8fd81bd9972.tar.gz MultiMC-4124faf474908e4d79d93b0f624bf8fd81bd9972.tar.lz MultiMC-4124faf474908e4d79d93b0f624bf8fd81bd9972.tar.xz MultiMC-4124faf474908e4d79d93b0f624bf8fd81bd9972.zip |
Fix console window (now not a QDialog)
It now opens and coloses as expected, depending on user
preferences and the status of the various processes involved.
Console window geometry and state are remembered between runs.
Diffstat (limited to 'logic/MinecraftProcess.cpp')
-rw-r--r-- | logic/MinecraftProcess.cpp | 17 |
1 files changed, 10 insertions, 7 deletions
diff --git a/logic/MinecraftProcess.cpp b/logic/MinecraftProcess.cpp index 6c86c73a..b3b587e8 100644 --- a/logic/MinecraftProcess.cpp +++ b/logic/MinecraftProcess.cpp @@ -101,7 +101,7 @@ void MinecraftProcess::on_stdOut() for (int i = 0; i < lines.size() - 1; i++) { QString &line = lines[i]; - emit log(line /*.replace(username, "<Username>").replace(sessionID, "<Session ID>")*/, + emit log(line.replace(username, "<Username>").replace(sessionID, "<Session ID>"), getLevel(line, MessageLevel::Message)); } if (!complete) @@ -139,7 +139,8 @@ void MinecraftProcess::finish(int code, ExitStatus status) m_prepostlaunchprocess.waitForFinished(); if (m_prepostlaunchprocess.exitStatus() != NormalExit) { - // TODO: error handling + emit postlaunch_failed(m_instance, m_prepostlaunchprocess.exitCode(), + m_prepostlaunchprocess.exitStatus()); } } m_instance->cleanupAfterRun(); @@ -160,7 +161,9 @@ void MinecraftProcess::launch() m_prepostlaunchprocess.waitForFinished(); if (m_prepostlaunchprocess.exitStatus() != NormalExit) { - // TODO: error handling + m_instance->cleanupAfterRun(); + emit prelaunch_failed(m_instance, m_prepostlaunchprocess.exitCode(), + m_prepostlaunchprocess.exitStatus()); return; } } @@ -171,15 +174,15 @@ void MinecraftProcess::launch() QString JavaPath = m_instance->settings().get("JavaPath").toString(); emit log(QString("Java path: '%1'").arg(JavaPath)); emit log(QString("Arguments: '%1'").arg( - m_args.join("' '") /*.replace(username, "<Username>").replace(sessionID, "<Session -ID>")*/)); + m_args.join("' '").replace(username, "<Username>").replace(sessionID, "<Session ID>"))); start(JavaPath, m_args); if (!waitForStarted()) { //: Error message displayed if instace can't start - emit log(tr("Could not launch minecraft!")); + emit log(tr("Could not launch minecraft!"), MessageLevel::Error); + m_instance->cleanupAfterRun(); + emit launch_failed(m_instance); return; - // TODO: error handling } } |