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 autoLoginProfileChanged();
|
||||
void cachedLogoImageChanged();
|
||||
void showWindow();
|
||||
|
||||
protected:
|
||||
friend class Patcher;
|
||||
|
|
|
@ -518,15 +518,24 @@ QCoro::Task<> LauncherCore::fetchNews()
|
|||
QCoro::Task<> LauncherCore::handleGameExit(Profile *profile)
|
||||
{
|
||||
#ifdef BUILD_SYNC
|
||||
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); // TODO: handle errors and especially interactive ones
|
||||
#endif
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
|
@ -121,6 +121,10 @@ Kirigami.ApplicationWindow {
|
|||
function onCurrentProfileChanged() {
|
||||
appWindow.checkSetup();
|
||||
}
|
||||
|
||||
function onShowWindow() {
|
||||
appWindow.show();
|
||||
}
|
||||
}
|
||||
|
||||
Connections {
|
||||
|
|
Loading…
Add table
Reference in a new issue