1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00
astra/launcher/ui/Settings/ProfilesPage.qml
Joshua Goins 49f8aae877 Add support for installing the official benchmark
This uses the same profile system as the regular game, and can be used
to download the current benchmark (currently hardcoded, to be fixed
later.) Or as always, install it offline from an existing zip.
2024-04-19 20:32:28 -04:00

103 lines
No EOL
2.7 KiB
QML

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import QtQuick.Window
import QtQuick.Controls as QQC2
import org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import zone.xiv.astra
FormCard.FormCardPage {
id: page
title: i18nc("@title:window", "Profiles")
actions: [
Kirigami.Action {
text: i18n("Add Profile…")
icon.name: "list-add"
onTriggered: {
page.Window.window.close();
LauncherCore.currentProfile = LauncherCore.profileManager.addProfile();
}
}
]
FormCard.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing
FormCard.FormButtonDelegate {
text: i18n("Auto-login Profile")
description: LauncherCore.autoLoginProfile ? LauncherCore.autoLoginProfile.name : i18n("Disabled")
QQC2.Menu {
id: profileMenu
QQC2.MenuItem {
text: "Disabled"
onClicked: {
LauncherCore.autoLoginProfile = null;
profileMenu.close();
}
}
Repeater {
model: LauncherCore.profileManager
QQC2.MenuItem {
required property var profile
text: profile.name
onClicked: {
LauncherCore.autoLoginProfile = profile;
profileMenu.close();
}
}
}
}
onClicked: profileMenu.popup()
}
}
FormCard.FormCard {
Layout.fillWidth: true
Layout.topMargin: Kirigami.Units.largeSpacing
Repeater {
model: LauncherCore.profileManager
ColumnLayout {
id: layout
required property var profile
required property int index
spacing: 0
FormCard.FormButtonDelegate {
id: buttonDelegate
text: layout.profile.name
description: layout.profile.subtitle
onClicked: page.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "ProfileSettings"), {
profile: layout.profile
})
}
FormCard.FormDelegateSeparator {
visible: layout.index + 1 < LauncherCore.profileManager.numProfiles
}
}
}
}
}