2023-08-19 10:49:00 -04:00
|
|
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-09-16 18:15:11 -04:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Layouts
|
2023-09-20 16:44:43 -04:00
|
|
|
import QtQuick.Window
|
2023-09-16 18:15:11 -04:00
|
|
|
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
import org.kde.kirigamiaddons.formcard as FormCard
|
2023-09-16 17:32:38 -04:00
|
|
|
import org.kde.kirigamiaddons.components as Components
|
2023-09-16 18:15:11 -04:00
|
|
|
|
|
|
|
import zone.xiv.astra
|
2023-08-19 10:49:00 -04:00
|
|
|
|
|
|
|
FormCard.FormCardPage {
|
2023-09-20 16:44:43 -04:00
|
|
|
id: root
|
|
|
|
|
2023-09-20 15:30:50 -04:00
|
|
|
title: i18nc("@title:window", "Accounts")
|
2023-08-19 10:49:00 -04:00
|
|
|
|
|
|
|
FormCard.FormCard {
|
|
|
|
Layout.fillWidth: true
|
2023-09-20 15:30:50 -04:00
|
|
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
2023-08-19 10:49:00 -04:00
|
|
|
|
|
|
|
Repeater {
|
|
|
|
model: LauncherCore.accountManager
|
|
|
|
|
2023-10-08 20:24:35 -04:00
|
|
|
ColumnLayout {
|
2023-08-19 10:49:00 -04:00
|
|
|
required property var account
|
2023-10-08 20:24:35 -04:00
|
|
|
required property int index
|
2023-08-19 10:49:00 -04:00
|
|
|
|
2023-10-08 20:24:35 -04:00
|
|
|
spacing: 0
|
2023-08-19 10:49:00 -04:00
|
|
|
|
2023-10-08 20:24:35 -04:00
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
text: account.name
|
2023-10-11 12:59:50 -04:00
|
|
|
description: account.isSapphire ? i18n("Sapphire") : i18n("Square Enix")
|
2023-10-08 20:24:35 -04:00
|
|
|
|
|
|
|
leading: Components.Avatar {
|
|
|
|
source: account.avatarUrl
|
|
|
|
}
|
|
|
|
|
|
|
|
leadingPadding: Kirigami.Units.largeSpacing * 2
|
2023-08-19 10:49:00 -04:00
|
|
|
|
2023-10-08 20:24:35 -04:00
|
|
|
onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AccountSettings"), {
|
|
|
|
account: account
|
|
|
|
})
|
|
|
|
}
|
2023-08-19 10:49:00 -04:00
|
|
|
|
2023-10-08 20:24:35 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
visible: index + 1 < LauncherCore.accountManager.numAccounts()
|
|
|
|
}
|
2023-08-19 10:49:00 -04:00
|
|
|
}
|
|
|
|
}
|
2023-10-08 20:24:35 -04:00
|
|
|
}
|
2023-08-19 10:49:00 -04:00
|
|
|
|
2023-10-08 20:24:35 -04:00
|
|
|
FormCard.FormCard {
|
|
|
|
Layout.fillWidth: true
|
|
|
|
Layout.topMargin: Kirigami.Units.largeSpacing
|
2023-08-19 10:49:00 -04:00
|
|
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
id: addSquareEnixButton
|
|
|
|
|
|
|
|
text: i18n("Add Square Enix Account")
|
|
|
|
icon.name: "list-add-symbolic"
|
2023-09-20 16:44:43 -04:00
|
|
|
onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSquareEnix"))
|
2023-08-19 10:49:00 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: addSquareEnixButton
|
|
|
|
below: addSapphireButton
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
id: addSapphireButton
|
|
|
|
|
|
|
|
text: i18n("Add Sapphire Account")
|
|
|
|
icon.name: "list-add-symbolic"
|
2023-09-20 16:44:43 -04:00
|
|
|
onClicked: root.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "AddSapphire"))
|
2023-08-19 10:49:00 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|