1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-20 11:47:46 +00:00
astra/launcher/ui/Setup/ExistingSetup.qml
Joshua Goins 4948db82be Add a method to use existing game installations from other launchers
This should work for XIVLauncher.Core, XIVQuickLauncher and the official
launcher. More testing is needed of course, but the framework is there
now.
2024-05-26 08:03:52 -04:00

76 lines
1.8 KiB
QML

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
import QtQuick
import QtQuick.Layouts
import QtQuick.Dialogs
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import zone.xiv.astra
import "../Components"
FormCard.FormCardPage {
id: page
property var profile
title: i18n("Find Existing Installation")
data: FolderDialog {
id: dialog
onAccepted: {
page.profile.gamePath = decodeURIComponent(selectedFolder.toString().replace("file://", ""));
applicationWindow().checkSetup();
}
}
FormCard.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing
Repeater {
model: ExistingInstallModel {}
delegate: FormCard.FormButtonDelegate {
required property var path
required property var type
text: path
description: type
onClicked: {
page.profile.gamePath = path;
applicationWindow().checkSetup();
}
}
}
}
FormCard.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing
FormCard.FormTextDelegate {
id: helpTextDelegate
text: i18n("If you can't find your existing game installation, manually select the path below.")
}
FormCard.FormDelegateSeparator {
above: helpTextDelegate
below: selectDelegate
}
FormCard.FormButtonDelegate {
id: selectDelegate
icon.name: "document-open-folder"
text: i18n("Select Existing Path")
onClicked: dialog.open()
}
}
}