summaryrefslogtreecommitdiffstats
path: root/gui/mainwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'gui/mainwindow.cpp')
-rw-r--r--gui/mainwindow.cpp17
1 files changed, 17 insertions, 0 deletions
diff --git a/gui/mainwindow.cpp b/gui/mainwindow.cpp
index 7d1e1510..82ae41d9 100644
--- a/gui/mainwindow.cpp
+++ b/gui/mainwindow.cpp
@@ -541,10 +541,21 @@ void MainWindow::launchInstance(BaseInstance *instance, LoginResponse response)
if(!proc)
return;
+ // Prepare GUI: If it shall stay open disable the required parts
+ if (globalSettings->get("NoHide").toBool())
+ {
+ ui->actionLaunchInstance->setEnabled(false);
+ }
+ else
+ {
+ this->hide();
+ }
+
console = new ConsoleWindow(proc);
console->show();
connect(proc, SIGNAL(log(QString, MessageLevel::Enum)),
console, SLOT(write(QString, MessageLevel::Enum)));
+ connect(proc, SIGNAL(ended()), this, SLOT(instanceEnded()));
proc->launch();
}
@@ -673,3 +684,9 @@ void MainWindow::on_actionEditInstNotes_triggered()
linst->setNotes(noteedit.getText());
}
}
+
+void MainWindow::instanceEnded()
+{
+ this->show();
+ ui->actionLaunchInstance->setEnabled(m_selectedInstance);
+}