1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-21 20:27:45 +00:00
astra/launcher/ui/Setup/AccountSetup.qml

94 lines
2.5 KiB
QML
Raw Normal View History

// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
// SPDX-License-Identifier: GPL-3.0-or-later
2023-12-17 12:47:13 -05:00
pragma ComponentBehavior: Bound
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
2023-09-16 18:15:11 -04:00
import zone.xiv.astra
FormCard.FormCardPage {
id: page
property var profile
title: i18n("Account Setup")
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
FormCard.FormTextDelegate {
id: helpTextDelegate
text: i18n("Select an account to use for '%1'.", LauncherCore.currentProfile.name)
}
}
FormCard.FormHeader {
title: i18n("Existing Accounts")
visible: LauncherCore.accountManager.hasAnyAccounts()
}
FormCard.FormCard {
visible: LauncherCore.accountManager.hasAnyAccounts()
Layout.fillWidth: true
Repeater {
model: LauncherCore.accountManager
FormCard.FormButtonDelegate {
required property var account
text: account.name
onClicked: {
page.profile.account = account
applicationWindow().checkSetup()
}
}
}
}
FormCard.FormHeader {
2024-05-26 08:18:48 -04:00
title: i18n("Add Account")
visible: LauncherCore.accountManager.hasAnyAccounts()
}
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
FormCard.FormButtonDelegate {
id: addSquareEnixButton
2024-05-26 08:18:48 -04:00
text: i18n("Square Enix Account…")
description: i18n("Used for logging into the official game servers.")
icon.name: "list-add-symbolic"
2023-12-17 12:47:13 -05:00
onClicked: page.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSquareEnix"), {
profile: page.profile
})
}
FormCard.FormDelegateSeparator {
above: addSquareEnixButton
below: addSapphireButton
}
FormCard.FormButtonDelegate {
id: addSapphireButton
2024-05-26 08:18:48 -04:00
text: i18n("Sapphire Account…")
description: i18n("Only for Sapphire servers, don't select this if unless you need to connect to one.")
icon.name: "list-add-symbolic"
2023-12-17 12:47:13 -05:00
onClicked: page.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSapphire"), {
profile: page.profile
})
}
}
}