1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00
astra/launcher/ui/Settings/AccountsPage.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

77 lines
No EOL
2.2 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 org.kde.kirigami as Kirigami
import org.kde.kirigamiaddons.formcard as FormCard
import org.kde.kirigamiaddons.components as Components
import zone.xiv.astra
FormCard.FormCardPage {
id: root
title: i18nc("@title:window", "Accounts")
actions: [
Kirigami.Action {
text: i18n("Add Account…")
icon.name: "list-add-symbolic"
Kirigami.Action {
text: i18n("Square Enix")
onTriggered: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSquareEnix"))
}
Kirigami.Action {
text: i18n("Sapphire")
onTriggered: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSapphire"))
}
}
]
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
visible: repeater.count !== 0
Repeater {
id: repeater
model: LauncherCore.accountManager
ColumnLayout {
id: layout
required property var account
required property int index
spacing: 0
FormCard.FormButtonDelegate {
text: layout.account.name
description: layout.account.isSapphire ? i18n("Sapphire") : i18n("Square Enix")
leading: Components.Avatar
{
name: layout.account.name
source: layout.account.avatarUrl
}
leadingPadding: Kirigami.Units.largeSpacing * 2
onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AccountSettings"), {
account: layout.account
})
}
FormCard.FormDelegateSeparator {
visible: layout.index + 1 < LauncherCore.accountManager.numAccounts
}
}
}
}
}