From 4124faf474908e4d79d93b0f624bf8fd81bd9972 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Petr=20Mr=C3=A1zek?= Date: Sat, 23 Nov 2013 01:41:28 +0100 Subject: 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. --- gui/MainWindow.cpp | 29 +++-------------------------- 1 file changed, 3 insertions(+), 26 deletions(-) (limited to 'gui/MainWindow.cpp') diff --git a/gui/MainWindow.cpp b/gui/MainWindow.cpp index 842014d3..fc1b631c 100644 --- a/gui/MainWindow.cpp +++ b/gui/MainWindow.cpp @@ -712,27 +712,10 @@ void MainWindow::launchInstance(BaseInstance *instance, LoginResponse response) if (!proc) return; - // Prepare GUI: If it shall stay open disable the required parts - if (MMC->settings()->get("NoHide").toBool()) - { - ui->actionLaunchInstance->setEnabled(false); - } - else - { - this->hide(); - } + this->hide(); console = new ConsoleWindow(proc); - - connect(proc, SIGNAL(log(QString, MessageLevel::Enum)), console, - SLOT(write(QString, MessageLevel::Enum))); - connect(proc, SIGNAL(ended(BaseInstance*,int,QProcess::ExitStatus)), this, - SLOT(instanceEnded(BaseInstance*,int,QProcess::ExitStatus))); - - if (instance->settings().get("ShowConsole").toBool()) - { - console->show(); - } + connect(console, SIGNAL(isClosing()), this, SLOT(instanceEnded())); proc->setLogin(response.username, response.session_id); proc->launch(); @@ -884,15 +867,9 @@ void MainWindow::on_actionEditInstNotes_triggered() } } -void MainWindow::instanceEnded(BaseInstance *instance, int code, QProcess::ExitStatus status) +void MainWindow::instanceEnded() { this->show(); - ui->actionLaunchInstance->setEnabled(m_selectedInstance); - - if (instance->settings().get("AutoCloseConsole").toBool()) - { - console->close(); - } } void MainWindow::checkSetDefaultJava() -- cgit v1.2.3