summaryrefslogtreecommitdiffstats
path: root/gui/ConsoleWindow.cpp
diff options
context:
space:
mode:
authorPetr Mrázek <peterix@gmail.com>2013-11-12 09:23:39 +0100
committerPetr Mrázek <peterix@gmail.com>2013-11-12 09:23:39 +0100
commitfdc58bb91360c04eed13a4fd4f8323a6a467dc37 (patch)
treec4cee6d1c623d60bd51bc254649749824f36d539 /gui/ConsoleWindow.cpp
parente611aef0e77f727d0c77f6dea0d373e7a12b241c (diff)
downloadMultiMC-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 'gui/ConsoleWindow.cpp')
-rw-r--r--gui/ConsoleWindow.cpp9
1 files changed, 5 insertions, 4 deletions
diff --git a/gui/ConsoleWindow.cpp b/gui/ConsoleWindow.cpp
index ec25b9cf..a3f294e6 100644
--- a/gui/ConsoleWindow.cpp
+++ b/gui/ConsoleWindow.cpp
@@ -122,14 +122,15 @@ void ConsoleWindow::on_btnKillMinecraft_clicked()
ui->btnKillMinecraft->setEnabled(true);
}
-void ConsoleWindow::onEnded(BaseInstance *instance)
+void ConsoleWindow::onEnded(BaseInstance* instance, int code, QProcess::ExitStatus status)
{
ui->btnKillMinecraft->setEnabled(false);
- // TODO: Might need an option to forcefully close, even on an error
if(instance->settings().get("AutoCloseConsole").toBool())
{
- // TODO: Check why this doesn't work
- if (!proc->exitCode()) this->close();
+ if (code == 0 && status != QProcess::CrashExit)
+ {
+ this->close();
+ }
}
}