diff --git a/launcher/include/launchercore.h b/launcher/include/launchercore.h index 2cb6fcf..754cc5f 100755 --- a/launcher/include/launchercore.h +++ b/launcher/include/launchercore.h @@ -147,6 +147,7 @@ Q_SIGNALS: void currentProfileChanged(); void autoLoginProfileChanged(); void cachedLogoImageChanged(); + void showWindow(); protected: friend class Patcher; diff --git a/launcher/src/launchercore.cpp b/launcher/src/launchercore.cpp index 2a51fbb..fa11e5c 100755 --- a/launcher/src/launchercore.cpp +++ b/launcher/src/launchercore.cpp @@ -518,15 +518,24 @@ QCoro::Task<> LauncherCore::fetchNews() QCoro::Task<> LauncherCore::handleGameExit(Profile *profile) { #ifdef BUILD_SYNC - qCDebug(ASTRA_LOG) << "Game closed! Uploading character data..."; - const auto characterSync = new CharacterSync(*profile->account(), *this, this); - co_await characterSync->sync(false); // TODO: handle errors and especially interactive ones -#endif + if (m_settings->enableSync()) { + Q_EMIT showWindow(); + qCDebug(ASTRA_LOG) << "Game closed! Uploading character data..."; + const auto characterSync = new CharacterSync(*profile->account(), *this, this); + co_await characterSync->sync(false); + + // Tell the user they can now quit. + Q_EMIT stageChanged(i18n("You may now safely close the game.")); + + co_return; + } +#endif // Otherwise, quit when everything is finished. if (m_settings->closeWhenLaunched()) { QCoreApplication::exit(); } + co_return; } diff --git a/launcher/ui/Main.qml b/launcher/ui/Main.qml index ce0bc67..7252fae 100644 --- a/launcher/ui/Main.qml +++ b/launcher/ui/Main.qml @@ -121,6 +121,10 @@ Kirigami.ApplicationWindow { function onCurrentProfileChanged() { appWindow.checkSetup(); } + + function onShowWindow() { + appWindow.show(); + } } Connections {