mirror of
https://github.com/redstrate/Astra.git
synced 2025-05-13 13:07:44 +00:00
89 lines
2.3 KiB
QML
89 lines
2.3 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("Select Existing Installation")
|
|
|
|
data: FolderDialog {
|
|
id: dialog
|
|
|
|
onAccepted: {
|
|
page.profile.config.gamePath = decodeURIComponent(selectedFolder.toString().replace("file://", ""));
|
|
applicationWindow().checkSetup();
|
|
}
|
|
}
|
|
|
|
FormCard.FormCard {
|
|
visible: existingInstallRepeater.count > 0
|
|
|
|
Layout.fillWidth: true
|
|
Layout.topMargin: Kirigami.Units.largeSpacing * 4
|
|
|
|
FormCard.FormTextDelegate {
|
|
id: foundTextDelegate
|
|
|
|
text: i18n("Astra has found the following installations:")
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {
|
|
above: foundTextDelegate
|
|
}
|
|
|
|
Repeater {
|
|
id: existingInstallRepeater
|
|
model: ExistingInstallModel {}
|
|
|
|
delegate: FormCard.FormButtonDelegate {
|
|
required property string path
|
|
required property string type
|
|
required property string version
|
|
|
|
text: type
|
|
description: i18nc("version (path)", "%1 (%2)", version, path)
|
|
|
|
onClicked: {
|
|
page.profile.config.gamePath = path;
|
|
applicationWindow().checkSetup();
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
FormCard.FormCard {
|
|
Layout.fillWidth: true
|
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
|
|
|
FormCard.FormTextDelegate {
|
|
id: helpTextDelegate
|
|
|
|
text: i18n("If Astra did not detect your installation automatically, try selecting it manually below.")
|
|
}
|
|
FormCard.FormDelegateSeparator {
|
|
above: helpTextDelegate
|
|
below: selectDelegate
|
|
}
|
|
FormCard.FormButtonDelegate {
|
|
id: selectDelegate
|
|
|
|
icon.name: "document-open-folder"
|
|
text: i18n("Select Existing Folder")
|
|
|
|
onClicked: dialog.open()
|
|
}
|
|
}
|
|
}
|