From c65bab6efec27d7b0654609798f77dd617d33d2d Mon Sep 17 00:00:00 2001 From: Sky Date: Tue, 22 Oct 2013 18:25:10 +0100 Subject: Respect console options (opening a console at all, automatically closing) --- gui/consolewindow.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'gui/consolewindow.cpp') diff --git a/gui/consolewindow.cpp b/gui/consolewindow.cpp index deeedd65..6ed4a0ec 100644 --- a/gui/consolewindow.cpp +++ b/gui/consolewindow.cpp @@ -14,7 +14,7 @@ ConsoleWindow::ConsoleWindow(MinecraftProcess *mcproc, QWidget *parent) : { MultiMCPlatform::fixWM_CLASS(this); ui->setupUi(this); - connect(mcproc, SIGNAL(ended()), this, SLOT(onEnded())); + connect(mcproc, SIGNAL(ended(BaseInstance*)), this, SLOT(onEnded(BaseInstance*))); } ConsoleWindow::~ConsoleWindow() @@ -109,9 +109,14 @@ void ConsoleWindow::on_btnKillMinecraft_clicked() r_u_sure.close(); } -void ConsoleWindow::onEnded() +void ConsoleWindow::onEnded(BaseInstance *instance) { ui->btnKillMinecraft->setEnabled(false); - // TODO: Check why this doesn't work - if (!proc->exitCode()) this->close(); + + // 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(); + } } -- cgit v1.2.3