From 061a6776dbe1b8a7baa6237eed494a73b359e641 Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Sun, 30 Jul 2023 16:20:51 -0400 Subject: [PATCH] Close and hide launcher window if requested --- launcher/src/launchercore.cpp | 8 ++++++++ launcher/ui/main.qml | 8 ++++++++ 2 files changed, 16 insertions(+) diff --git a/launcher/src/launchercore.cpp b/launcher/src/launchercore.cpp index f3ed76c..a0dbf76 100755 --- a/launcher/src/launchercore.cpp +++ b/launcher/src/launchercore.cpp @@ -86,6 +86,10 @@ void LauncherCore::beginVanillaGame(const QString &gameExecutablePath, const Pro { auto gameProcess = new QProcess(this); gameProcess->setProcessEnvironment(QProcessEnvironment::systemEnvironment()); + connect(gameProcess, qOverload(&QProcess::finished), this, [this](int exitCode) { + Q_UNUSED(exitCode) + Q_EMIT gameClosed(); + }); auto args = getGameArgs(profile, auth); @@ -101,6 +105,10 @@ void LauncherCore::beginDalamudGame(const QString &gameExecutablePath, const Pro dataDir = "Z:" + dataDir.replace('/', '\\'); auto dalamudProcess = new QProcess(this); + connect(dalamudProcess, qOverload(&QProcess::finished), this, [this](int exitCode) { + Q_UNUSED(exitCode) + Q_EMIT gameClosed(); + }); QProcessEnvironment env = QProcessEnvironment::systemEnvironment(); env.insert("DALAMUD_RUNTIME", dataDir + "\\DalamudRuntime"); diff --git a/launcher/ui/main.qml b/launcher/ui/main.qml index a40ff59..977e50e 100644 --- a/launcher/ui/main.qml +++ b/launcher/ui/main.qml @@ -54,6 +54,14 @@ Kirigami.ApplicationWindow { function onLoadingFinished() { checkSetup() } + + function onSuccessfulLaunch() { + hide() + } + + function onGameClosed() { + Qt.callLater(Qt.quit) + } } Component.onCompleted: checkSetup()