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-12-17 12:47:13 -05:00
|
|
|
pragma ComponentBehavior: Bound
|
|
|
|
|
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
|
|
|
|
2023-09-20 15:30:50 -04:00
|
|
|
import org.kde.kirigami as Kirigami
|
2023-09-16 18:15:11 -04:00
|
|
|
import org.kde.kirigamiaddons.formcard as FormCard
|
|
|
|
|
|
|
|
import zone.xiv.astra
|
2023-08-19 10:49:00 -04:00
|
|
|
|
|
|
|
FormCard.FormCardPage {
|
2023-09-20 16:44:43 -04:00
|
|
|
id: page
|
|
|
|
|
2023-09-20 15:30:50 -04:00
|
|
|
title: i18nc("@title:window", "Profiles")
|
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.profileManager
|
|
|
|
|
2023-10-08 20:24:35 -04:00
|
|
|
ColumnLayout {
|
2023-12-17 12:47:13 -05:00
|
|
|
id: layout
|
|
|
|
|
2023-08-19 10:49:00 -04:00
|
|
|
required property var profile
|
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
|
|
|
|
|
|
|
|
FormCard.FormButtonDelegate {
|
|
|
|
id: buttonDelegate
|
|
|
|
|
2023-12-17 12:47:13 -05:00
|
|
|
text: layout.profile.name
|
2023-10-08 20:24:35 -04:00
|
|
|
onClicked: page.Window.window.pageStack.layers.push(Qt.createComponent("zone.xiv.astra", "ProfileSettings"), {
|
2023-12-17 12:47:13 -05:00
|
|
|
profile: layout.profile
|
2023-10-08 20:24:35 -04:00
|
|
|
})
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator {
|
2024-03-23 12:44:34 -04:00
|
|
|
visible: layout.index + 1 < LauncherCore.profileManager.numProfiles
|
2023-10-08 20:24:35 -04:00
|
|
|
}
|
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: addProfileButton
|
|
|
|
|
|
|
|
text: i18n("Add Profile")
|
|
|
|
icon.name: "list-add"
|
|
|
|
onClicked: {
|
2023-09-20 16:44:43 -04:00
|
|
|
page.Window.window.close();
|
|
|
|
LauncherCore.currentProfile = LauncherCore.profileManager.addProfile();
|
2023-08-19 10:49:00 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|