1
Fork 0
mirror of https://github.com/redstrate/Astra.git synced 2025-04-24 13:27:45 +00:00

Switch to the new FormCard API for most of the user interface

This commit is contained in:
Joshua Goins 2023-08-19 10:30:52 -04:00
parent 9aed8ed011
commit b716801165
8 changed files with 876 additions and 793 deletions

View file

@ -6,7 +6,7 @@ import QtQuick.Window 2.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import zone.xiv.astra 1.0 import zone.xiv.astra 1.0
Controls.Control { Controls.Control {
@ -51,155 +51,142 @@ Controls.Control {
contentItem: ColumnLayout { contentItem: ColumnLayout {
width: parent.width width: parent.width
MobileForm.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing FormCard.FormCard {
Layout.fillWidth: true Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader { FormCard.FormButtonDelegate {
title: i18n("Current Profile") text: i18n("Current Profile")
} description: page.profile.name
MobileForm.FormButtonDelegate { Controls.Menu {
text: page.profile.name id: profileMenu
Controls.Menu { Repeater {
id: profileMenu model: LauncherCore.profileManager
Repeater { Controls.MenuItem {
model: LauncherCore.profileManager required property var profile
Controls.MenuItem { Controls.MenuItem {
required property var profile text: profile.name
Controls.MenuItem { onClicked: {
text: profile.name page.profile = profile
profileMenu.close()
onClicked: {
page.profile = profile
profileMenu.close()
}
} }
} }
} }
} }
onClicked: profileMenu.popup()
} }
onClicked: profileMenu.popup()
} }
} }
MobileForm.FormCard { FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader { FormCard.FormButtonDelegate {
title: i18n("Login") text: i18n("Current Account")
description: page.profile.account.name
leading: Kirigami.Avatar
{
source: page.profile.account.avatarUrl
} }
MobileForm.FormButtonDelegate { leadingPadding: Kirigami.Units.largeSpacing * 2
text: page.profile.account.name
leading: Kirigami.Avatar Controls.Menu {
{ id: accountMenu
source: page.profile.account.avatarUrl
}
leadingPadding: Kirigami.Units.largeSpacing * 2 Repeater {
model: LauncherCore.accountManager
Controls.Menu { Controls.MenuItem {
id: accountMenu required property var account
Repeater {
model: LauncherCore.accountManager
Controls.MenuItem { Controls.MenuItem {
required property var account text: account.name
icon.name: account.avatarUrl.length === 0 ? "actor" : ""
icon.source: account.avatarUrl
Controls.MenuItem { onClicked: {
text: account.name page.profile.account = account
icon.name: account.avatarUrl.length === 0 ? "actor" : "" accountMenu.close()
icon.source: account.avatarUrl
onClicked: {
page.profile.account = account
accountMenu.close()
}
} }
} }
} }
} }
onClicked: accountMenu.popup()
} }
MobileForm.FormDelegateSeparator { onClicked: accountMenu.popup()
} }
MobileForm.FormTextFieldDelegate { FormCard.FormDelegateSeparator {
id: usernameField }
label: page.profile.account.isSapphire ? i18n("Username") : i18n("Square Enix ID")
text: page.profile.account.name
enabled: false
}
MobileForm.FormDelegateSeparator { FormCard.FormTextFieldDelegate {
} id: usernameField
label: page.profile.account.isSapphire ? i18n("Username") : i18n("Square Enix ID")
text: page.profile.account.name
enabled: false
}
MobileForm.FormTextFieldDelegate { FormCard.FormDelegateSeparator {
id: passwordField }
label: page.profile.account.isSapphire ? i18n("Password") : i18n("Square Enix Password")
echoMode: TextInput.Password
focus: true
onAccepted: {
if (otpField.visible) {
otpField.clicked();
} else {
loginButton.clicked();
}
}
text: page.profile.account.rememberPassword ? "abcdefg" : ""
}
MobileForm.FormDelegateSeparator { FormCard.FormTextFieldDelegate {
} id: passwordField
label: page.profile.account.isSapphire ? i18n("Password") : i18n("Square Enix Password")
MobileForm.FormTextFieldDelegate { echoMode: TextInput.Password
id: otpField focus: true
label: i18n("One-time Password") onAccepted: {
visible: page.profile.account.useOTP if (otpField.visible) {
onAccepted: loginButton.clicked() otpField.clicked();
} } else {
loginButton.clicked();
MobileForm.FormDelegateSeparator {}
MobileForm.FormButtonDelegate {
id: loginButton
text: i18n("Log In")
icon.name: "unlock"
enabled: page.isLoginValid
onClicked: {
LauncherCore.login(page.profile, usernameField.text, passwordField.text, otpField.text)
pageStack.layers.push('qrc:/ui/Pages/StatusPage.qml')
} }
} }
text: page.profile.account.rememberPassword ? "abcdefg" : ""
}
MobileForm.FormDelegateSeparator { FormCard.FormDelegateSeparator {
visible: forgotPasswordButton.visible }
FormCard.FormTextFieldDelegate {
id: otpField
label: i18n("One-time Password")
visible: page.profile.account.useOTP
onAccepted: loginButton.clicked()
}
FormCard.FormDelegateSeparator {}
FormCard.FormButtonDelegate {
id: loginButton
text: i18n("Log In")
icon.name: "unlock"
enabled: page.isLoginValid
onClicked: {
LauncherCore.login(page.profile, usernameField.text, passwordField.text, otpField.text)
pageStack.layers.push('qrc:/ui/Pages/StatusPage.qml')
} }
}
MobileForm.FormButtonDelegate { FormCard.FormDelegateSeparator {
id: forgotPasswordButton visible: forgotPasswordButton.visible
}
text: i18n("Forgot ID or Password") FormCard.FormButtonDelegate {
icon.name: "dialog-password" id: forgotPasswordButton
visible: !page.profile.account.isSapphire
onClicked: applicationWindow().openUrl('https://secure.square-enix.com/account/app/svc/reminder') text: i18n("Forgot ID or Password")
} icon.name: "dialog-password"
visible: !page.profile.account.isSapphire
onClicked: applicationWindow().openUrl('https://secure.square-enix.com/account/app/svc/reminder')
} }
} }
} }

View file

@ -6,7 +6,7 @@ import QtQuick.Window 2.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import QtGraphicalEffects 1.0 import QtGraphicalEffects 1.0
import zone.xiv.astra 1.0 import zone.xiv.astra 1.0
@ -83,84 +83,80 @@ Controls.Control {
} }
} }
MobileForm.FormCard { FormCard.FormHeader {
Layout.topMargin: Kirigami.Units.largeSpacing title: i18n("News")
Layout.fillWidth: true
maximumWidth: layout.maximumWidth
}
FormCard.FormCard {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
maximumWidth: layout.maximumWidth maximumWidth: layout.maximumWidth
visible: LauncherCore.headline !== null visible: LauncherCore.headline !== null
contentItem: ColumnLayout { Repeater {
spacing: 0 model: LauncherCore.headline !== null ? LauncherCore.headline.news : undefined
MobileForm.FormCardHeader { FormCard.FormButtonDelegate {
title: i18n("News") text: modelData.title
} description: Qt.formatDate(modelData.date)
Repeater { onClicked: applicationWindow().openUrl(modelData.url)
model: LauncherCore.headline !== null ? LauncherCore.headline.news : undefined onHoveredChanged: {
if (hovered) {
MobileForm.FormButtonDelegate { applicationWindow().hoverLinkIndicator.text = modelData.url;
text: modelData.title } else {
description: Qt.formatDate(modelData.date) applicationWindow().hoverLinkIndicator.text = "";
onClicked: applicationWindow().openUrl(modelData.url)
onHoveredChanged: {
if (hovered) {
applicationWindow().hoverLinkIndicator.text = modelData.url;
} else {
applicationWindow().hoverLinkIndicator.text = "";
}
} }
} }
} }
}
MobileForm.FormTextDelegate { FormCard.FormTextDelegate {
description: i18n("No news.") description: i18n("No news.")
visible: LauncherCore.headline !== null ? LauncherCore.headline.failedToLoad : false visible: LauncherCore.headline !== null ? LauncherCore.headline.failedToLoad : false
}
} }
} }
MobileForm.FormCard { FormCard.FormHeader {
Layout.topMargin: Kirigami.Units.largeSpacing title: i18n("Topics")
Layout.fillWidth: true
maximumWidth: layout.maximumWidth
}
FormCard.FormCard {
Layout.fillWidth: true Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter | Qt.AlignTop Layout.alignment: Qt.AlignHCenter | Qt.AlignTop
maximumWidth: layout.maximumWidth maximumWidth: layout.maximumWidth
visible: LauncherCore.headline !== null visible: LauncherCore.headline !== null
contentItem: ColumnLayout { Repeater {
spacing: 0 model: LauncherCore.headline !== null ? LauncherCore.headline.topics : undefined
MobileForm.FormCardHeader { FormCard.FormButtonDelegate {
title: i18n("Topics") text: modelData.title
} description: Qt.formatDate(modelData.date)
Repeater { hoverEnabled: true
model: LauncherCore.headline !== null ? LauncherCore.headline.topics : undefined onClicked: applicationWindow().openUrl(modelData.url)
onHoveredChanged: {
MobileForm.FormButtonDelegate { if (hovered) {
text: modelData.title applicationWindow().hoverLinkIndicator.text = modelData.url;
description: Qt.formatDate(modelData.date) } else {
applicationWindow().hoverLinkIndicator.text = "";
hoverEnabled: true
onClicked: applicationWindow().openUrl(modelData.url)
onHoveredChanged: {
if (hovered) {
applicationWindow().hoverLinkIndicator.text = modelData.url;
} else {
applicationWindow().hoverLinkIndicator.text = "";
}
} }
} }
} }
}
MobileForm.FormTextDelegate { FormCard.FormTextDelegate {
description: i18n("No topics.") description: i18n("No topics.")
visible: LauncherCore.headline !== null ? LauncherCore.headline.failedToLoad : false visible: LauncherCore.headline !== null ? LauncherCore.headline.failedToLoad : false
}
} }
} }

View file

@ -6,202 +6,228 @@ import QtQuick.Window 2.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import zone.xiv.astra 1.0 import zone.xiv.astra 1.0
Kirigami.ScrollablePage { FormCard.FormCardPage {
id: page id: page
property var account property var account
title: i18n("Account Settings") title: i18n("Account Settings")
ColumnLayout { FormCard.FormHeader {
width: parent.width title: i18n("General")
}
MobileForm.FormCard { FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing Layout.fillWidth: true
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader { FormCard.FormTextFieldDelegate {
title: i18n("General") id: usernameDelegate
}
label: i18n("Username")
MobileForm.FormTextFieldDelegate { text: page.account.name
label: i18n("Username") onTextChanged: page.account.name = text
text: page.account.name
onTextChanged: page.account.name = text
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormComboBoxDelegate {
text: i18n("Language")
model: ["Japanese", "English", "German", "French"]
currentIndex: page.account.language
onCurrentIndexChanged: page.account.language = currentIndex
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormComboBoxDelegate {
text: i18n("Account type")
model: ["Square Enix", "Sapphire"]
currentIndex: page.account.isSapphire ? 1 : 0
onCurrentIndexChanged: page.account.isSapphire = (currentIndex === 1)
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormComboBoxDelegate {
id: licenseField
text: i18n("License")
description: i18n("If the account holds multiple licenses, choose the preferred one.")
model: ["Windows", "Steam", "macOS"]
currentIndex: page.account.license
onCurrentIndexChanged: page.account.license = currentIndex
visible: !page.account.isSapphire
}
MobileForm.FormDelegateSeparator {
visible: licenseField.visible
}
MobileForm.FormCheckDelegate {
id: freeTrialField
text: i18n("Free trial")
checked: page.account.isFreeTrial
onCheckedChanged: page.account.isFreeTrial = checked
visible: !page.account.isSapphire
}
MobileForm.FormDelegateSeparator {
visible: freeTrialField.visible
}
MobileForm.FormCheckDelegate {
id: needOTPField
text: i18n("Needs a one-time password")
checked: page.account.useOTP
onCheckedChanged: page.account.useOTP = checked
visible: !page.account.isSapphire
}
MobileForm.FormDelegateSeparator {
visible: needOTPField.visible
}
MobileForm.FormTextFieldDelegate {
label: i18n("Lobby URL")
text: page.account.lobbyUrl
onTextChanged: page.account.lobbyUrl = text
visible: page.account.isSapphire
placeholderText: "neolobby0X.ffxiv.com"
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormButtonDelegate {
text: i18n("Set Lodestone Character")
description: i18n("Associate a character's avatar with this account.")
icon.name: "actor"
Kirigami.PromptDialog {
id: lodestoneDialog
title: i18n("Enter Lodestone Id")
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
onAccepted: page.account.lodestoneId = lodestoneIdField.text
Controls.TextField {
id: lodestoneIdField
text: page.account.lodestoneId
placeholderText: qsTr("123456...")
}
}
onClicked: lodestoneDialog.open()
}
}
} }
MobileForm.FormCard { FormCard.FormDelegateSeparator {
Layout.topMargin: Kirigami.Units.largeSpacing above: usernameDelegate
Layout.fillWidth: true below: languageDelegate
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader {
title: i18n("Login")
}
MobileForm.FormCheckDelegate {
text: i18n("Remember password")
checked: page.account.rememberPassword
onCheckedChanged: page.account.rememberPassword = checked
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormCheckDelegate {
id: generateOTPField
text: i18n("Automatically generate one-time passwords")
checked: page.account.rememberOTP
onCheckedChanged: page.account.rememberOTP = checked
enabled: page.account.useOTP
visible: !page.account.isSapphire
}
MobileForm.FormDelegateSeparator {
visible: generateOTPField.visible
}
MobileForm.FormButtonDelegate {
text: i18n("Enter OTP Secret")
icon.name: "list-add-symbolic"
enabled: page.account.rememberOTP
visible: generateOTPField.visible
Kirigami.PromptDialog {
id: otpDialog
title: i18n("Enter OTP Secret")
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
onAccepted: page.account.setOTPSecret(otpSecretField.text)
Controls.TextField {
id: otpSecretField
placeholderText: qsTr("ABCD EFGH...")
}
}
onClicked: otpDialog.open()
}
}
} }
MobileForm.FormCard { FormCard.FormComboBoxDelegate {
Layout.topMargin: Kirigami.Units.largeSpacing id: languageDelegate
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormButtonDelegate { text: i18n("Language")
text: i18n("Delete Account") model: ["Japanese", "English", "German", "French"]
description: !enabled ? i18n("Cannot delete the only account.") : "" currentIndex: page.account.language
icon.name: "delete" onCurrentIndexChanged: page.account.language = currentIndex
enabled: LauncherCore.accountManager.canDelete(page.account) }
onClicked: {
LauncherCore.accountManager.deleteAccount(page.account) FormCard.FormDelegateSeparator {
applicationWindow().pageStack.layers.pop() above: languageDelegate
} below: accountTypeDelegate
}
FormCard.FormComboBoxDelegate {
id: accountTypeDelegate
text: i18n("Account type")
model: ["Square Enix", "Sapphire"]
currentIndex: page.account.isSapphire ? 1 : 0
onCurrentIndexChanged: page.account.isSapphire = (currentIndex === 1)
}
FormCard.FormDelegateSeparator {
above: accountTypeDelegate
below: licenseField
}
FormCard.FormComboBoxDelegate {
id: licenseField
text: i18n("License")
description: i18n("If the account holds multiple licenses, choose the preferred one.")
model: ["Windows", "Steam", "macOS"]
currentIndex: page.account.license
onCurrentIndexChanged: page.account.license = currentIndex
visible: !page.account.isSapphire
}
FormCard.FormDelegateSeparator {
above: licenseField
below: freeTrialField
visible: licenseField.visible
}
FormCard.FormCheckDelegate {
id: freeTrialField
text: i18n("Free trial")
checked: page.account.isFreeTrial
onCheckedChanged: page.account.isFreeTrial = checked
visible: !page.account.isSapphire
}
FormCard.FormDelegateSeparator {
above: freeTrialField
below: needOTPField
visible: freeTrialField.visible
}
FormCard.FormCheckDelegate {
id: needOTPField
text: i18n("Needs a one-time password")
checked: page.account.useOTP
onCheckedChanged: page.account.useOTP = checked
visible: !page.account.isSapphire
}
FormCard.FormDelegateSeparator {
above: needOTPField
below: lobbyURLDelegate
visible: needOTPField.visible
}
FormCard.FormTextFieldDelegate {
id: lobbyURLDelegate
label: i18n("Lobby URL")
text: page.account.lobbyUrl
onTextChanged: page.account.lobbyUrl = text
visible: page.account.isSapphire
placeholderText: "neolobby0X.ffxiv.com"
}
FormCard.FormDelegateSeparator {
above: lobbyURLDelegate
below: lodestoneDelegate
}
FormCard.FormButtonDelegate {
id: lodestoneDelegate
text: i18n("Set Lodestone Character")
description: i18n("Associate a character's avatar with this account.")
icon.name: "actor"
Kirigami.PromptDialog {
id: lodestoneDialog
title: i18n("Enter Lodestone Id")
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
onAccepted: page.account.lodestoneId = lodestoneIdField.text
Controls.TextField {
id: lodestoneIdField
text: page.account.lodestoneId
placeholderText: qsTr("123456...")
} }
} }
onClicked: lodestoneDialog.open()
}
}
FormCard.FormHeader {
title: i18n("Login")
}
FormCard.FormCard {
Layout.fillWidth: true
FormCard.FormCheckDelegate {
id: rememberPasswordDelegate
text: i18n("Remember password")
checked: page.account.rememberPassword
onCheckedChanged: page.account.rememberPassword = checked
}
FormCard.FormDelegateSeparator {
above: rememberPasswordDelegate
below: generateOTPField
}
FormCard.FormCheckDelegate {
id: generateOTPField
text: i18n("Automatically generate one-time passwords")
checked: page.account.rememberOTP
onCheckedChanged: page.account.rememberOTP = checked
enabled: page.account.useOTP
visible: !page.account.isSapphire
}
FormCard.FormDelegateSeparator {
above: generateOTPField
below: otpSecretDelegate
visible: generateOTPField.visible
}
FormCard.FormButtonDelegate {
id: otpSecretDelegate
text: i18n("Enter OTP Secret")
icon.name: "list-add-symbolic"
enabled: page.account.rememberOTP
visible: generateOTPField.visible
Kirigami.PromptDialog {
id: otpDialog
title: i18n("Enter OTP Secret")
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
onAccepted: page.account.setOTPSecret(otpSecretField.text)
Controls.TextField {
id: otpSecretField
placeholderText: qsTr("ABCD EFGH...")
}
}
onClicked: otpDialog.open()
}
}
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
FormCard.FormButtonDelegate {
text: i18n("Delete Account")
description: !enabled ? i18n("Cannot delete the only account.") : ""
icon.name: "delete"
enabled: LauncherCore.accountManager.canDelete(page.account)
onClicked: {
LauncherCore.accountManager.deleteAccount(page.account)
applicationWindow().pageStack.layers.pop()
}
} }
} }
} }

View file

@ -6,59 +6,60 @@ import QtQuick.Window 2.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import zone.xiv.astra 1.0 import zone.xiv.astra 1.0
Kirigami.Page { FormCard.FormCardPage {
id: page id: page
property var installer: null property var installer: null
title: i18n("Install Compatibility Tool") title: i18n("Install Compatibility Tool")
ColumnLayout { FormCard.FormHeader {
width: parent.width title: i18n("Compatibility Tool")
MobileForm.FormCard { }
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader { FormCard.FormCard {
title: i18n("Compatibility Tool") Layout.fillWidth: true
}
MobileForm.FormTextDelegate { FormCard.FormTextDelegate {
text: i18n("Press the button below to install the compatibility tool for Steam.") text: i18n("Press the button below to install the compatibility tool for Steam.")
} }
MobileForm.FormDelegateSeparator {} FormCard.FormDelegateSeparator {
below: installToolButton
}
MobileForm.FormButtonDelegate { FormCard.FormButtonDelegate {
text: i18n("Install Tool") id: installToolButton
icon.name: "install"
onClicked: {
page.installer = LauncherCore.createCompatInstaller();
page.installer.installCompatibilityTool();
}
}
MobileForm.FormDelegateSeparator {} text: i18n("Install Tool")
icon.name: "install"
onClicked: {
page.installer = LauncherCore.createCompatInstaller();
page.installer.installCompatibilityTool();
}
}
MobileForm.FormButtonDelegate { FormCard.FormDelegateSeparator {
text: i18n("Remove Tool") above: installToolButton
icon.name: "delete" below: removeToolButton
onClicked: { }
page.installer = LauncherCore.createCompatInstaller();
page.installer.removeCompatibilityTool(); FormCard.FormButtonDelegate {
} id: removeToolButton
}
text: i18n("Remove Tool")
icon.name: "delete"
onClicked: {
page.installer = LauncherCore.createCompatInstaller();
page.installer.removeCompatibilityTool();
} }
} }
} }
Kirigami.PromptDialog { property Kirigami.PromptDialog errorDialog: Kirigami.PromptDialog {
id: errorDialog
title: i18n("Install error") title: i18n("Install error")
showCloseButton: false showCloseButton: false
@ -68,7 +69,7 @@ Kirigami.Page {
onRejected: applicationWindow().pageStack.layers.pop() onRejected: applicationWindow().pageStack.layers.pop()
} }
Connections { data: Connections {
enabled: page.installer !== null enabled: page.installer !== null
target: page.installer target: page.installer

View file

@ -6,7 +6,7 @@ import QtQuick.Window 2.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import zone.xiv.astra 1.0 import zone.xiv.astra 1.0
import "../Components" import "../Components"
@ -16,40 +16,55 @@ Kirigami.ScrollablePage {
title: i18n("Developer Settings") title: i18n("Developer Settings")
ColumnLayout { FormCard.FormCard {
width: parent.width Layout.fillWidth: true
MobileForm.FormCard { FormCard.FormCheckDelegate {
Layout.topMargin: Kirigami.Units.largeSpacing id: keepPatchesDelegate
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCheckDelegate { text: i18n("Keep Patches")
text: i18n("Keep Patches") description: i18n("Do not delete patches after they're used. Astra will not redownload patch data, if found.")
description: i18n("Do not delete patches after they're used. Astra will not redownload patch data, if found.") checked: LauncherCore.keepPatches
checked: LauncherCore.keepPatches onCheckedChanged: LauncherCore.keepPatches = checked
onCheckedChanged: LauncherCore.keepPatches = checked }
}
MobileForm.FormTextFieldDelegate { FormCard.FormDelegateSeparator {
label: i18n("Dalamud Distribution Server") above: keepPatchesDelegate
text: LauncherCore.dalamudDistribServer below: dalamudServerDelegate
onTextChanged: LauncherCore.dalamudDistribServer = text }
}
MobileForm.FormTextFieldDelegate { FormCard.FormTextFieldDelegate {
label: i18n("SE Main Server") id: dalamudServerDelegate
text: LauncherCore.squareEnixServer
onTextChanged: LauncherCore.squareEnixServer = text
}
MobileForm.FormTextFieldDelegate { label: i18n("Dalamud Distribution Server")
label: i18n("SE Login Server") text: LauncherCore.dalamudDistribServer
text: LauncherCore.squareEnixLoginServer onTextChanged: LauncherCore.dalamudDistribServer = text
onTextChanged: LauncherCore.squareEnixLoginServer = text }
}
} FormCard.FormDelegateSeparator {
above: dalamudServerDelegate
below: mainServerDelegate
}
FormCard.FormTextFieldDelegate {
id: mainServerDelegate
label: i18n("SE Main Server")
text: LauncherCore.squareEnixServer
onTextChanged: LauncherCore.squareEnixServer = text
}
FormCard.FormDelegateSeparator {
above: mainServerDelegate
below: loginServerDelegate
}
FormCard.FormTextFieldDelegate {
id: loginServerDelegate
label: i18n("SE Login Server")
text: LauncherCore.squareEnixLoginServer
onTextChanged: LauncherCore.squareEnixLoginServer = text
} }
} }
} }

View file

@ -6,31 +6,28 @@ import QtQuick.Window 2.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import zone.xiv.astra 1.0 import zone.xiv.astra 1.0
MobileForm.FormCard { FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing FormCard.FormCheckDelegate {
Layout.fillWidth: true id: closeAstraDelegate
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader { text: i18n("Close Astra when game is launched")
title: i18n("General") checked: LauncherCore.closeWhenLaunched
} onCheckedChanged: LauncherCore.closeWhenLaunched = checked
}
MobileForm.FormCheckDelegate { FormCard.FormDelegateSeparator {
text: i18n("Close Astra when game is launched") above: closeAstraDelegate
checked: LauncherCore.closeWhenLaunched below: showNewsDelegate
onCheckedChanged: LauncherCore.closeWhenLaunched = checked }
}
MobileForm.FormDelegateSeparator {} FormCard.FormCheckDelegate {
id: showNewsDelegate
MobileForm.FormCheckDelegate { text: i18n("Enable and show news")
text: i18n("Enable and show news") checked: LauncherCore.showNews
checked: LauncherCore.showNews onCheckedChanged: LauncherCore.showNews = checked
onCheckedChanged: LauncherCore.showNews = checked
}
} }
} }

View file

@ -6,290 +6,334 @@ import QtQuick.Window 2.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import zone.xiv.astra 1.0 import zone.xiv.astra 1.0
import "../Components" import "../Components"
Kirigami.ScrollablePage { FormCard.FormCardPage {
id: page id: page
property var profile property var profile
title: i18n("Profile Settings") title: i18n("Profile Settings")
ColumnLayout { FormCard.FormHeader {
width: parent.width title: i18n("General")
}
MobileForm.FormCard { FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing Layout.fillWidth: true
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader { FormCard.FormTextFieldDelegate {
title: i18n("General") id: nameDelegate
}
MobileForm.FormTextFieldDelegate { label: i18n("Name")
label: i18n("Name") text: page.profile.name
text: page.profile.name onTextChanged: page.profile.name = text
onTextChanged: page.profile.name = text
}
MobileForm.FormDelegateSeparator {}
FormFolderDelegate {
text: i18n("Game Path")
folder: page.profile.gamePath
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormComboBoxDelegate {
text: i18n("DirectX Version")
model: ["DirectX 11", "DirectX 9"]
currentIndex: page.profile.directx9Enabled ? 1 : 0
onCurrentIndexChanged: page.profile.directx9Enabled = (currentIndex === 1)
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormCheckDelegate {
text: i18n("Encrypt Game Arguments")
checked: page.profile.argumentsEncrypted
onCheckedChanged: page.profile.argumentsEncrypted = checked
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormCheckDelegate {
text: i18n("Enable Watchdog")
description: i18n("Gives real-time queue updates. X11 only.")
checked: page.profile.watchdogEnabled
onCheckedChanged: page.profile.watchdogEnabled = checked
enabled: false
visible: false
}
MobileForm.FormDelegateSeparator {
visible: false
}
MobileForm.FormTextDelegate {
description: page.profile.expansionVersionText
}
}
} }
MobileForm.FormCard { FormCard.FormDelegateSeparator {
Layout.topMargin: Kirigami.Units.largeSpacing above: nameDelegate
Layout.fillWidth: true below: gamePathDelegate
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader {
title: i18n("Wine")
}
MobileForm.FormComboBoxDelegate {
text: i18n("Wine Type")
model: ["System", "Custom"]
currentIndex: page.profile.wineType
onCurrentIndexChanged: page.profile.wineType = currentIndex
enabled: !LauncherCore.isSteam
}
MobileForm.FormDelegateSeparator {}
FormFileDelegate {
text: i18n("Wine Path")
file: page.profile.winePath
enabled: !LauncherCore.isSteam && page.profile.wineType !== Profile.System
}
MobileForm.FormDelegateSeparator {}
FormFolderDelegate {
text: i18n("Wine Prefix Path")
folder: page.profile.winePrefixPath
enabled: !LauncherCore.isSteam
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormTextDelegate {
description: page.profile.wineVersionText
}
}
} }
MobileForm.FormCard { FormFolderDelegate {
Layout.topMargin: Kirigami.Units.largeSpacing id: gamePathDelegate
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader { text: i18n("Game Path")
title: i18n("Tools") folder: page.profile.gamePath
} }
MobileForm.FormCheckDelegate { FormCard.FormDelegateSeparator {
text: i18n("Enable ESync") above: gamePathDelegate
description: i18n("Could improve game performance, but requires a patched Wine and kernel.") below: directXDelegate
checked: page.profile.esyncEnabled }
onCheckedChanged: page.profile.esyncEnabled = checked
}
MobileForm.FormDelegateSeparator {} FormCard.FormComboBoxDelegate {
id: directXDelegate
MobileForm.FormCheckDelegate { text: i18n("DirectX Version")
text: i18n("Enable Gamescope") model: ["DirectX 11", "DirectX 9"]
description: i18n("A micro-compositor that uses Wayland to create a nested session.\nIf you use fullscreen mode, it may improve input handling.") currentIndex: page.profile.directx9Enabled ? 1 : 0
checked: page.profile.gamescopeEnabled onCurrentIndexChanged: page.profile.directx9Enabled = (currentIndex === 1)
onCheckedChanged: page.profile.gamescopeEnabled = checked }
visible: false
enabled: false
}
MobileForm.FormDelegateSeparator { FormCard.FormDelegateSeparator {
visible: false above: directXDelegate
} below: encryptArgDelegate
}
MobileForm.FormButtonDelegate { FormCard.FormCheckDelegate {
text: i18n("Configure Gamescope...") id: encryptArgDelegate
icon.name: "configure"
enabled: false
visible: false
Kirigami.PromptDialog {
id: gamescopeSettingsDialog
title: i18n("Configure Gamescope")
Kirigami.FormLayout { text: i18n("Encrypt Game Arguments")
Controls.CheckBox { checked: page.profile.argumentsEncrypted
Kirigami.FormData.label: "Fullscreen:" onCheckedChanged: page.profile.argumentsEncrypted = checked
checked: page.profile.gamescopeFullscreen }
onCheckedChanged: page.profile.gamescopeFullscreen = checked
} FormCard.FormDelegateSeparator {
Controls.CheckBox { above: encryptArgDelegate
Kirigami.FormData.label: "Borderless:" below: enableWatchdogDelegate
checked: page.profile.gamescopeBorderless }
onCheckedChanged: page.profile.gamescopeBorderless = checked
} FormCard.FormCheckDelegate {
Controls.SpinBox { id: enableWatchdogDelegate
Kirigami.FormData.label: "Width:"
to: 4096 text: i18n("Enable Watchdog")
value: page.profile.gamescopeWidth description: i18n("Gives real-time queue updates. X11 only.")
onValueModified: page.profile.gamescopeWidth = value checked: page.profile.watchdogEnabled
} onCheckedChanged: page.profile.watchdogEnabled = checked
Controls.SpinBox { enabled: false
Kirigami.FormData.label: "Height:" visible: false
to: 4096 }
value: page.profile.gamescopeHeight
onValueModified: page.profile.gamescopeHeight = value FormCard.FormDelegateSeparator {
} visible: false
Controls.SpinBox { }
Kirigami.FormData.label: "Refresh Rate:"
to: 512 FormCard.FormTextDelegate {
value: page.profile.gamescopeRefreshRate description: page.profile.expansionVersionText
onValueModified: page.profile.gamescopeRefreshRate = value }
} }
}
FormCard.FormHeader {
title: i18n("Wine")
}
FormCard.FormCard {
Layout.fillWidth: true
FormCard.FormComboBoxDelegate {
id: wineTypeDelegate
text: i18n("Wine Type")
model: ["System", "Custom"]
currentIndex: page.profile.wineType
onCurrentIndexChanged: page.profile.wineType = currentIndex
enabled: !LauncherCore.isSteam
}
FormCard.FormDelegateSeparator {
above: wineTypeDelegate
below: winePathDelegate
}
FormFileDelegate {
id: winePathDelegate
text: i18n("Wine Path")
file: page.profile.winePath
enabled: !LauncherCore.isSteam && page.profile.wineType !== Profile.System
}
FormCard.FormDelegateSeparator {
above: winePathDelegate
below: winePrefixPathDelegate
}
FormFolderDelegate {
id: winePrefixPathDelegate
text: i18n("Wine Prefix Path")
folder: page.profile.winePrefixPath
enabled: !LauncherCore.isSteam
}
FormCard.FormDelegateSeparator {
above: winePrefixPathDelegate
}
FormCard.FormTextDelegate {
description: page.profile.wineVersionText
}
}
FormCard.FormHeader {
title: i18n("Tools")
}
FormCard.FormCard {
Layout.fillWidth: true
FormCard.FormCheckDelegate {
id: esyncDelegate
text: i18n("Enable ESync")
description: i18n("Could improve game performance, but requires a patched Wine and kernel.")
checked: page.profile.esyncEnabled
onCheckedChanged: page.profile.esyncEnabled = checked
}
FormCard.FormDelegateSeparator {
above: esyncDelegate
below: gamemodeDelegate
}
FormCard.FormCheckDelegate {
text: i18n("Enable Gamescope")
description: i18n("A micro-compositor that uses Wayland to create a nested session.\nIf you use fullscreen mode, it may improve input handling.")
checked: page.profile.gamescopeEnabled
onCheckedChanged: page.profile.gamescopeEnabled = checked
visible: false
enabled: false
}
FormCard.FormDelegateSeparator {
visible: false
}
FormCard.FormButtonDelegate {
text: i18n("Configure Gamescope...")
icon.name: "configure"
enabled: false
visible: false
Kirigami.PromptDialog {
id: gamescopeSettingsDialog
title: i18n("Configure Gamescope")
Kirigami.FormLayout {
Controls.CheckBox {
Kirigami.FormData.label: "Fullscreen:"
checked: page.profile.gamescopeFullscreen
onCheckedChanged: page.profile.gamescopeFullscreen = checked
} }
Controls.CheckBox {
onClicked: gamescopeSettingsDialog.open() Kirigami.FormData.label: "Borderless:"
} checked: page.profile.gamescopeBorderless
onCheckedChanged: page.profile.gamescopeBorderless = checked
MobileForm.FormDelegateSeparator { }
visible: false Controls.SpinBox {
} Kirigami.FormData.label: "Width:"
to: 4096
MobileForm.FormCheckDelegate { value: page.profile.gamescopeWidth
text: i18n("Enable Gamemode") onValueModified: page.profile.gamescopeWidth = value
description: i18n("A special game performance tool, that tunes your CPU scheduler among other things.") }
checked: page.profile.gamemodeEnabled Controls.SpinBox {
onCheckedChanged: page.profile.gamemodeEnabled = checked Kirigami.FormData.label: "Height:"
} to: 4096
} value: page.profile.gamescopeHeight
} onValueModified: page.profile.gamescopeHeight = value
}
MobileForm.FormCard { Controls.SpinBox {
Layout.topMargin: Kirigami.Units.largeSpacing Kirigami.FormData.label: "Refresh Rate:"
Layout.fillWidth: true to: 512
contentItem: ColumnLayout { value: page.profile.gamescopeRefreshRate
spacing: 0 onValueModified: page.profile.gamescopeRefreshRate = value
MobileForm.FormCardHeader {
title: i18n("Dalamud")
}
MobileForm.FormCheckDelegate {
text: i18n("Enable Dalamud")
description: i18n("Dalamud extends the game with useful plugins, but use at your own risk.")
checked: page.profile.dalamudEnabled
onCheckedChanged: page.profile.dalamudEnabled = checked
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormComboBoxDelegate {
text: i18n("Update Channel")
model: ["Stable", "Staging", ".NET 5"]
currentIndex: page.profile.dalamudChannel
onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex
enabled: page.profile.dalamudEnabled
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormComboBoxDelegate {
text: i18n("Injection Method")
description: "It shouldn't be nessecary to change this setting, unless you're running into issues injecting Dalamud."
model: ["Entrypoint", "DLL Injection"]
enabled: page.profile.dalamudEnabled
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormSpinBoxDelegate {
label: i18n("Injection Delay")
enabled: page.profile.dalamudEnabled
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormCheckDelegate {
text: i18n("Opt Out of Automatic Marketboard Collection")
checked: page.profile.dalamudOptOut
onCheckedChanged: page.profile.dalamudOptOut = checked
enabled: page.profile.dalamudEnabled
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormTextDelegate {
description: page.profile.dalamudVersionText
}
}
}
MobileForm.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormButtonDelegate {
text: i18n("Delete Profile")
description: !enabled ? i18n("Cannot delete the only profile.") : ""
icon.name: "delete"
enabled: LauncherCore.profileManager.canDelete(page.profile)
onClicked: {
LauncherCore.profileManager.deleteProfile(page.profile)
applicationWindow().pageStack.layers.pop()
} }
} }
} }
onClicked: gamescopeSettingsDialog.open()
}
FormCard.FormDelegateSeparator {
visible: false
}
FormCard.FormCheckDelegate {
id: gamemodeDelegate
text: i18n("Enable Gamemode")
description: i18n("A special game performance tool, that tunes your CPU scheduler among other things.")
checked: page.profile.gamemodeEnabled
onCheckedChanged: page.profile.gamemodeEnabled = checked
}
}
FormCard.FormHeader {
title: i18n("Dalamud")
}
FormCard.FormCard {
Layout.fillWidth: true
FormCard.FormCheckDelegate {
id: enableDalamudDelegate
text: i18n("Enable Dalamud")
description: i18n("Dalamud extends the game with useful plugins, but use at your own risk.")
checked: page.profile.dalamudEnabled
onCheckedChanged: page.profile.dalamudEnabled = checked
}
FormCard.FormDelegateSeparator {
above: enableDalamudDelegate
below: dalamudChannelDelegate
}
FormCard.FormComboBoxDelegate {
id: dalamudChannelDelegate
text: i18n("Update Channel")
model: ["Stable", "Staging", ".NET 5"]
currentIndex: page.profile.dalamudChannel
onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex
enabled: page.profile.dalamudEnabled
}
FormCard.FormDelegateSeparator {
above: dalamudChannelDelegate
below: dalamudInjectDelegate
}
FormCard.FormComboBoxDelegate {
id: dalamudInjectDelegate
text: i18n("Injection Method")
description: "It shouldn't be nessecary to change this setting, unless you're running into issues injecting Dalamud."
model: ["Entrypoint", "DLL Injection"]
enabled: page.profile.dalamudEnabled
}
FormCard.FormDelegateSeparator {
above: dalamudInjectDelegate
below: dalamudDelayDelegate
}
FormCard.FormSpinBoxDelegate {
id: dalamudDelayDelegate
label: i18n("Injection Delay")
enabled: page.profile.dalamudEnabled
}
FormCard.FormDelegateSeparator {
above: dalamudDelayDelegate
below: dalamudOptOutDelegate
}
FormCard.FormCheckDelegate {
id: dalamudOptOutDelegate
text: i18n("Opt Out of Automatic Marketboard Collection")
checked: page.profile.dalamudOptOut
onCheckedChanged: page.profile.dalamudOptOut = checked
enabled: page.profile.dalamudEnabled
}
FormCard.FormDelegateSeparator {
above: dalamudOptOutDelegate
}
FormCard.FormTextDelegate {
description: page.profile.dalamudVersionText
}
}
FormCard.FormCard {
Layout.topMargin: Kirigami.Units.largeSpacing
Layout.fillWidth: true
FormCard.FormButtonDelegate {
text: i18n("Delete Profile")
description: !enabled ? i18n("Cannot delete the only profile.") : ""
icon.name: "delete"
enabled: LauncherCore.profileManager.canDelete(page.profile)
onClicked: {
LauncherCore.profileManager.deleteProfile(page.profile)
applicationWindow().pageStack.layers.pop()
}
} }
} }
} }

View file

@ -6,138 +6,155 @@ import QtQuick.Window 2.15
import org.kde.kirigami 2.20 as Kirigami import org.kde.kirigami 2.20 as Kirigami
import QtQuick.Controls 2.15 as Controls import QtQuick.Controls 2.15 as Controls
import QtQuick.Layouts 1.15 import QtQuick.Layouts 1.15
import org.kde.kirigamiaddons.labs.mobileform 0.1 as MobileForm import org.kde.kirigamiaddons.formcard 1.0 as FormCard
import zone.xiv.astra 1.0 import zone.xiv.astra 1.0
Kirigami.ScrollablePage { FormCard.FormCardPage {
id: page id: page
title: i18n("Settings") title: i18n("Settings")
ColumnLayout { FormCard.FormHeader {
width: parent.width title: i18n("General")
}
GeneralSettings {} GeneralSettings {
Layout.fillWidth: true
}
MobileForm.FormCard { FormCard.FormHeader {
Layout.topMargin: Kirigami.Units.largeSpacing title: i18n("Profiles")
Layout.fillWidth: true }
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader { FormCard.FormCard {
title: i18n("Profiles") Layout.fillWidth: true
}
Repeater { Repeater {
model: LauncherCore.profileManager model: LauncherCore.profileManager
MobileForm.FormButtonDelegate { FormCard.FormButtonDelegate {
required property var profile required property var profile
text: profile.name text: profile.name
onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/ProfileSettings.qml', { onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/ProfileSettings.qml', {
profile: profile profile: profile
}) })
}
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormButtonDelegate {
text: i18n("Add Profile")
icon.name: "list-add"
onClicked: {
applicationWindow().currentSetupProfile = LauncherCore.profileManager.addProfile()
applicationWindow().checkSetup()
}
}
} }
} }
MobileForm.FormCard { FormCard.FormDelegateSeparator {
Layout.topMargin: Kirigami.Units.largeSpacing below: addProfileButton
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
MobileForm.FormCardHeader {
title: i18n("Accounts")
}
Repeater {
model: LauncherCore.accountManager
MobileForm.FormButtonDelegate {
required property var account
text: account.name
leading: Kirigami.Avatar
{
source: account.avatarUrl
}
leadingPadding: Kirigami.Units.largeSpacing * 2
onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/AccountSettings.qml', {
account: account
})
}
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormButtonDelegate {
text: i18n("Add Square Enix Account")
icon.name: "list-add-symbolic"
onClicked: pageStack.layers.push('qrc:/ui/Setup/AddSquareEnix.qml')
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormButtonDelegate {
text: i18n("Add Sapphire Account")
icon.name: "list-add-symbolic"
onClicked: pageStack.layers.push('qrc:/ui/Setup/AddSapphire.qml')
}
}
} }
MobileForm.FormCard { FormCard.FormButtonDelegate {
Layout.topMargin: Kirigami.Units.largeSpacing id: addProfileButton
Layout.fillWidth: true
contentItem: ColumnLayout {
spacing: 0
Component {
id: aboutPage
MobileForm.AboutPage {
aboutData: About
}
}
MobileForm.FormButtonDelegate { text: i18n("Add Profile")
text: i18n("Setup Compatibility Tool") icon.name: "list-add"
icon.name: "install" onClicked: {
onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/CompatibilityToolSetup.qml') applicationWindow().currentSetupProfile = LauncherCore.profileManager.addProfile()
} applicationWindow().checkSetup()
MobileForm.FormDelegateSeparator {}
MobileForm.FormButtonDelegate {
text: i18n("Developer Settings")
icon.name: "configure"
onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/DeveloperSettings.qml')
}
MobileForm.FormDelegateSeparator {}
MobileForm.FormButtonDelegate {
text: i18n("About Astra")
icon.name: "help-about-symbolic"
onClicked: applicationWindow().pageStack.layers.push(aboutPage)
}
} }
} }
} }
FormCard.FormHeader {
title: i18n("Accounts")
}
FormCard.FormCard {
Layout.fillWidth: true
Repeater {
model: LauncherCore.accountManager
FormCard.FormButtonDelegate {
required property var account
text: account.name
leading: Kirigami.Avatar
{
source: account.avatarUrl
}
leadingPadding: Kirigami.Units.largeSpacing * 2
onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/AccountSettings.qml', {
account: account
})
}
}
FormCard.FormDelegateSeparator {
below: addSquareEnixButton
}
FormCard.FormButtonDelegate {
id: addSquareEnixButton
text: i18n("Add Square Enix Account")
icon.name: "list-add-symbolic"
onClicked: pageStack.layers.push('qrc:/ui/Setup/AddSquareEnix.qml')
}
FormCard.FormDelegateSeparator {
above: addSquareEnixButton
below: addSapphireButton
}
FormCard.FormButtonDelegate {
id: addSapphireButton
text: i18n("Add Sapphire Account")
icon.name: "list-add-symbolic"
onClicked: pageStack.layers.push('qrc:/ui/Setup/AddSapphire.qml')
}
}
FormCard.FormCard {
Layout.fillWidth: true
FormCard.FormButtonDelegate {
id: setupCompatToolButton
text: i18n("Setup Compatibility Tool")
icon.name: "install"
onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/CompatibilityToolSetup.qml')
}
FormCard.FormDelegateSeparator {
above: setupCompatToolButton
below: developerSettingsButton
}
FormCard.FormButtonDelegate {
id: developerSettingsButton
text: i18n("Developer Settings")
icon.name: "configure"
onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/DeveloperSettings.qml')
}
FormCard.FormDelegateSeparator {
above: developerSettingsButton
below: aboutButton
}
FormCard.FormButtonDelegate {
id: aboutButton
text: i18n("About Astra")
icon.name: "help-about-symbolic"
Component {
id: aboutPage
FormCard.AboutPage {
aboutData: About
}
}
onClicked: applicationWindow().pageStack.layers.push(aboutPage)
}
}
} }