2023-08-18 23:27:29 -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
|
|
|
|
import QtQuick.Layouts
|
|
|
|
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
import org.kde.kirigamiaddons.formcard as FormCard
|
|
|
|
|
|
|
|
import zone.xiv.astra
|
2023-08-18 23:27:29 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormCardPage {
|
2023-08-18 23:27:29 -04:00
|
|
|
id: page
|
|
|
|
|
|
|
|
property var installer: null
|
|
|
|
|
|
|
|
title: i18n("Install Compatibility Tool")
|
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormHeader {
|
|
|
|
title: i18n("Compatibility Tool")
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormCard {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
|
|
|
FormCard.FormTextDelegate {
|
|
|
|
text: i18n("Press the button below to install the compatibility tool for Steam.")
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
below: installToolButton
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
id: installToolButton
|
|
|
|
|
|
|
|
text: i18n("Install Tool")
|
|
|
|
icon.name: "install"
|
|
|
|
onClicked: {
|
|
|
|
page.installer = LauncherCore.createCompatInstaller();
|
|
|
|
page.installer.installCompatibilityTool();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: installToolButton
|
|
|
|
below: removeToolButton
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
id: removeToolButton
|
|
|
|
|
|
|
|
text: i18n("Remove Tool")
|
|
|
|
icon.name: "delete"
|
|
|
|
onClicked: {
|
|
|
|
page.installer = LauncherCore.createCompatInstaller();
|
|
|
|
page.installer.removeCompatibilityTool();
|
2023-08-18 23:27:29 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
property Kirigami.PromptDialog errorDialog: Kirigami.PromptDialog {
|
2023-08-18 23:27:29 -04:00
|
|
|
title: i18n("Install error")
|
|
|
|
|
|
|
|
showCloseButton: false
|
|
|
|
standardButtons: Kirigami.Dialog.Ok
|
|
|
|
|
|
|
|
onAccepted: applicationWindow().pageStack.layers.pop()
|
|
|
|
onRejected: applicationWindow().pageStack.layers.pop()
|
|
|
|
}
|
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
data: Connections {
|
2023-08-18 23:27:29 -04:00
|
|
|
enabled: page.installer !== null
|
|
|
|
target: page.installer
|
|
|
|
|
|
|
|
function onInstallFinished() {
|
|
|
|
applicationWindow().pageStack.layers.pop()
|
|
|
|
}
|
|
|
|
|
|
|
|
function onError(message) {
|
|
|
|
errorDialog.subtitle = message
|
|
|
|
errorDialog.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|