mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-25 05:47:45 +00:00
Re-open the game window (if you have that option enabled) to show sync
This commit is contained in:
parent
a0da4d02b7
commit
ce1411de79
3 changed files with 18 additions and 4 deletions
|
@ -147,6 +147,7 @@ Q_SIGNALS:
|
||||||
void currentProfileChanged();
|
void currentProfileChanged();
|
||||||
void autoLoginProfileChanged();
|
void autoLoginProfileChanged();
|
||||||
void cachedLogoImageChanged();
|
void cachedLogoImageChanged();
|
||||||
|
void showWindow();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
friend class Patcher;
|
friend class Patcher;
|
||||||
|
|
|
@ -518,15 +518,24 @@ QCoro::Task<> LauncherCore::fetchNews()
|
||||||
QCoro::Task<> LauncherCore::handleGameExit(Profile *profile)
|
QCoro::Task<> LauncherCore::handleGameExit(Profile *profile)
|
||||||
{
|
{
|
||||||
#ifdef BUILD_SYNC
|
#ifdef BUILD_SYNC
|
||||||
|
if (m_settings->enableSync()) {
|
||||||
|
Q_EMIT showWindow();
|
||||||
|
|
||||||
qCDebug(ASTRA_LOG) << "Game closed! Uploading character data...";
|
qCDebug(ASTRA_LOG) << "Game closed! Uploading character data...";
|
||||||
const auto characterSync = new CharacterSync(*profile->account(), *this, this);
|
const auto characterSync = new CharacterSync(*profile->account(), *this, this);
|
||||||
co_await characterSync->sync(false); // TODO: handle errors and especially interactive ones
|
co_await characterSync->sync(false);
|
||||||
#endif
|
|
||||||
|
|
||||||
|
// 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.
|
// Otherwise, quit when everything is finished.
|
||||||
if (m_settings->closeWhenLaunched()) {
|
if (m_settings->closeWhenLaunched()) {
|
||||||
QCoreApplication::exit();
|
QCoreApplication::exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
co_return;
|
co_return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -121,6 +121,10 @@ Kirigami.ApplicationWindow {
|
||||||
function onCurrentProfileChanged() {
|
function onCurrentProfileChanged() {
|
||||||
appWindow.checkSetup();
|
appWindow.checkSetup();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function onShowWindow() {
|
||||||
|
appWindow.show();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Connections {
|
Connections {
|
||||||
|
|
Loading…
Add table
Reference in a new issue