2023-07-30 08:49:34 -04:00
|
|
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-09-16 18:15:11 -04:00
|
|
|
import QtQuick
|
2024-04-01 14:54:41 -04:00
|
|
|
import QtQuick.Window
|
2023-09-16 18:15:11 -04:00
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
|
|
|
|
import zone.xiv.astra
|
2023-07-30 08:49:34 -04:00
|
|
|
|
|
|
|
Kirigami.Page {
|
2023-12-17 12:47:13 -05:00
|
|
|
id: page
|
|
|
|
|
2023-07-30 08:49:34 -04:00
|
|
|
property var gameInstaller
|
|
|
|
|
|
|
|
title: i18n("Game Installation")
|
|
|
|
|
|
|
|
Kirigami.LoadingPlaceholder {
|
|
|
|
anchors.centerIn: parent
|
|
|
|
|
2024-04-01 14:54:41 -04:00
|
|
|
text: i18n("Installing…")
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
2023-08-18 21:59:42 -04:00
|
|
|
Kirigami.PromptDialog {
|
|
|
|
id: errorDialog
|
2024-04-01 14:54:41 -04:00
|
|
|
title: i18n("Installation Error")
|
2023-08-18 21:59:42 -04:00
|
|
|
|
|
|
|
showCloseButton: false
|
|
|
|
standardButtons: Kirigami.Dialog.Ok
|
|
|
|
|
2024-04-01 14:54:41 -04:00
|
|
|
onAccepted: page.Window.window.pageStack.layers.pop()
|
|
|
|
onRejected: page.Window.window.pageStack.layers.pop()
|
2023-08-18 21:59:42 -04:00
|
|
|
}
|
|
|
|
|
2024-04-01 14:54:41 -04:00
|
|
|
Component.onCompleted: gameInstaller.start()
|
2023-07-30 08:49:34 -04:00
|
|
|
|
|
|
|
Connections {
|
2023-12-17 12:47:13 -05:00
|
|
|
target: page.gameInstaller
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2025-02-01 10:13:05 -05:00
|
|
|
function onInstallFinished(): void {
|
2024-04-01 14:54:41 -04:00
|
|
|
// Prevents it from failing to push the page if the install happens too quickly.
|
|
|
|
Qt.callLater(() => applicationWindow().checkSetup());
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
2023-08-18 21:59:42 -04:00
|
|
|
|
2025-02-01 10:13:05 -05:00
|
|
|
function onError(message: string): void {
|
2024-04-01 14:54:41 -04:00
|
|
|
errorDialog.subtitle = i18n("An error has occurred while installing the game:\n\n%1", message);
|
|
|
|
errorDialog.open();
|
2023-08-18 21:59:42 -04:00
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
2025-02-01 10:13:05 -05:00
|
|
|
}
|