diff --git a/launcher/resources.qrc b/launcher/resources.qrc index 5d8f696..c77a8ab 100644 --- a/launcher/resources.qrc +++ b/launcher/resources.qrc @@ -11,11 +11,14 @@ SPDX-License-Identifier: GPL-3.0-or-later ui/Pages/MainPage.qml ui/Pages/NewsPage.qml ui/Pages/StatusPage.qml + ui/Settings/AboutPage.qml ui/Settings/AccountSettings.qml + ui/Settings/AccountsPage.qml ui/Settings/CompatibilityToolSetup.qml ui/Settings/DeveloperSettings.qml ui/Settings/GeneralSettings.qml ui/Settings/ProfileSettings.qml + ui/Settings/ProfilesPage.qml ui/Settings/SettingsPage.qml ui/Setup/AccountSetup.qml ui/Setup/AddSapphire.qml diff --git a/launcher/ui/Settings/AboutPage.qml b/launcher/ui/Settings/AboutPage.qml new file mode 100644 index 0000000..a66cbd7 --- /dev/null +++ b/launcher/ui/Settings/AboutPage.qml @@ -0,0 +1,14 @@ +// SPDX-FileCopyrightText: 2023 Joshua Goins +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 +import QtQuick.Window 2.15 +import org.kde.kirigami 2.20 as Kirigami +import QtQuick.Controls 2.15 as Controls +import QtQuick.Layouts 1.15 +import org.kde.kirigamiaddons.formcard 1.0 as FormCard +import zone.xiv.astra 1.0 + +FormCard.AboutPage { + aboutData: About +} \ No newline at end of file diff --git a/launcher/ui/Settings/AccountsPage.qml b/launcher/ui/Settings/AccountsPage.qml new file mode 100644 index 0000000..07ec152 --- /dev/null +++ b/launcher/ui/Settings/AccountsPage.qml @@ -0,0 +1,66 @@ +// SPDX-FileCopyrightText: 2023 Joshua Goins +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 +import QtQuick.Window 2.15 +import org.kde.kirigami 2.20 as Kirigami +import QtQuick.Controls 2.15 as Controls +import QtQuick.Layouts 1.15 +import org.kde.kirigamiaddons.formcard 1.0 as FormCard +import zone.xiv.astra 1.0 + +FormCard.FormCardPage { + 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') + } + } +} \ No newline at end of file diff --git a/launcher/ui/Settings/DeveloperSettings.qml b/launcher/ui/Settings/DeveloperSettings.qml index 37b7d73..f1c6d58 100644 --- a/launcher/ui/Settings/DeveloperSettings.qml +++ b/launcher/ui/Settings/DeveloperSettings.qml @@ -11,11 +11,15 @@ import zone.xiv.astra 1.0 import "../Components" -Kirigami.ScrollablePage { +FormCard.FormCardPage { id: page title: i18n("Developer Settings") + FormCard.FormHeader { + title: i18n("Patching") + } + FormCard.FormCard { Layout.fillWidth: true @@ -27,11 +31,14 @@ Kirigami.ScrollablePage { checked: LauncherCore.keepPatches onCheckedChanged: LauncherCore.keepPatches = checked } + } - FormCard.FormDelegateSeparator { - above: keepPatchesDelegate - below: dalamudServerDelegate - } + FormCard.FormHeader { + title: i18n("Servers") + } + + FormCard.FormCard { + Layout.fillWidth: true FormCard.FormTextFieldDelegate { id: dalamudServerDelegate diff --git a/launcher/ui/Settings/GeneralSettings.qml b/launcher/ui/Settings/GeneralSettings.qml index 0cb2662..b303c00 100644 --- a/launcher/ui/Settings/GeneralSettings.qml +++ b/launcher/ui/Settings/GeneralSettings.qml @@ -9,25 +9,33 @@ import QtQuick.Layouts 1.15 import org.kde.kirigamiaddons.formcard 1.0 as FormCard import zone.xiv.astra 1.0 -FormCard.FormCard { - FormCard.FormCheckDelegate { - id: closeAstraDelegate +FormCard.FormCardPage { + title: i18n("General") - text: i18n("Close Astra when game is launched") - checked: LauncherCore.closeWhenLaunched - onCheckedChanged: LauncherCore.closeWhenLaunched = checked + FormCard.FormHeader { + title: i18n("General settings") } - FormCard.FormDelegateSeparator { - above: closeAstraDelegate - below: showNewsDelegate - } + FormCard.FormCard { + FormCard.FormCheckDelegate { + id: closeAstraDelegate - FormCard.FormCheckDelegate { - id: showNewsDelegate + text: i18n("Close Astra when game is launched") + checked: LauncherCore.closeWhenLaunched + onCheckedChanged: LauncherCore.closeWhenLaunched = checked + } - text: i18n("Enable and show news") - checked: LauncherCore.showNews - onCheckedChanged: LauncherCore.showNews = checked + FormCard.FormDelegateSeparator { + above: closeAstraDelegate + below: showNewsDelegate + } + + FormCard.FormCheckDelegate { + id: showNewsDelegate + + text: i18n("Enable and show news") + checked: LauncherCore.showNews + onCheckedChanged: LauncherCore.showNews = checked + } } } \ No newline at end of file diff --git a/launcher/ui/Settings/ProfilesPage.qml b/launcher/ui/Settings/ProfilesPage.qml new file mode 100644 index 0000000..15a0b86 --- /dev/null +++ b/launcher/ui/Settings/ProfilesPage.qml @@ -0,0 +1,50 @@ +// SPDX-FileCopyrightText: 2023 Joshua Goins +// SPDX-License-Identifier: GPL-3.0-or-later + +import QtQuick 2.15 +import QtQuick.Window 2.15 +import org.kde.kirigami 2.20 as Kirigami +import QtQuick.Controls 2.15 as Controls +import QtQuick.Layouts 1.15 +import org.kde.kirigamiaddons.formcard 1.0 as FormCard +import zone.xiv.astra 1.0 + +FormCard.FormCardPage { + title: i18n("General") + + FormCard.FormHeader { + title: i18n("Profiles") + } + + FormCard.FormCard { + Layout.fillWidth: true + + Repeater { + model: LauncherCore.profileManager + + FormCard.FormButtonDelegate { + required property var profile + + text: profile.name + onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/ProfileSettings.qml', { + profile: profile + }) + } + } + + FormCard.FormDelegateSeparator { + below: addProfileButton + } + + FormCard.FormButtonDelegate { + id: addProfileButton + + text: i18n("Add Profile") + icon.name: "list-add" + onClicked: { + applicationWindow().currentSetupProfile = LauncherCore.profileManager.addProfile() + applicationWindow().checkSetup() + } + } + } +} \ No newline at end of file diff --git a/launcher/ui/Settings/SettingsPage.qml b/launcher/ui/Settings/SettingsPage.qml index 1f62b1e..3fbcc80 100644 --- a/launcher/ui/Settings/SettingsPage.qml +++ b/launcher/ui/Settings/SettingsPage.qml @@ -2,159 +2,50 @@ // SPDX-License-Identifier: GPL-3.0-or-later import QtQuick 2.15 -import QtQuick.Window 2.15 -import org.kde.kirigami 2.20 as Kirigami -import QtQuick.Controls 2.15 as Controls +import org.kde.kirigami 2.18 as Kirigami +import org.kde.kirigamiaddons.settings 1.0 as KirigamiSettings import QtQuick.Layouts 1.15 -import org.kde.kirigamiaddons.formcard 1.0 as FormCard -import zone.xiv.astra 1.0 -FormCard.FormCardPage { - id: page - - title: i18n("Settings") - - FormCard.FormHeader { - title: i18n("General") - } - - GeneralSettings { - Layout.fillWidth: true - } - - FormCard.FormHeader { - title: i18n("Profiles") - } - - FormCard.FormCard { - Layout.fillWidth: true - - Repeater { - model: LauncherCore.profileManager - - FormCard.FormButtonDelegate { - required property var profile - - text: profile.name - onClicked: applicationWindow().pageStack.layers.push('qrc:/ui/Settings/ProfileSettings.qml', { - profile: profile - }) - } - } - - FormCard.FormDelegateSeparator { - below: addProfileButton - } - - FormCard.FormButtonDelegate { - id: addProfileButton - - text: i18n("Add Profile") - icon.name: "list-add" - onClicked: { - applicationWindow().currentSetupProfile = LauncherCore.profileManager.addProfile() - applicationWindow().checkSetup() - } - } - } - - 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 +KirigamiSettings.CategorizedSettings { + id: settingsPage + objectName: "settingsPage" + actions: [ + KirigamiSettings.SettingAction { + actionName: "general" + text: i18n("General") + icon.name: "zone.xiv.astra" + page: Qt.resolvedUrl("GeneralSettings.qml") + }, + KirigamiSettings.SettingAction { + actionName: "profiles" + text: i18n("Profiles") + icon.name: "preferences-desktop-gaming" + page: Qt.resolvedUrl("ProfilesPage.qml") + }, + KirigamiSettings.SettingAction { + actionName: "accounts" + text: i18n("Accounts") + icon.name: "preferences-system-users" + page: Qt.resolvedUrl("AccountsPage.qml") + }, + KirigamiSettings.SettingAction { + actionName: "compattool" + text: i18n("Compatibility Tool") + icon.name: "system-run" + page: Qt.resolvedUrl("CompatibilityToolSetup.qml") + }, + KirigamiSettings.SettingAction { + actionName: "devtool" 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 - + icon.name: "preferences-others" + page: Qt.resolvedUrl("DeveloperSettings.qml") + }, + KirigamiSettings.SettingAction { + actionName: "about" text: i18n("About Astra") - icon.name: "help-about-symbolic" - - Component { - id: aboutPage - FormCard.AboutPage { - aboutData: About - } - } - - onClicked: applicationWindow().pageStack.layers.push(aboutPage) + icon.name: "help-about" + page: Qt.resolvedUrl("AboutPage.qml") } - } -} \ No newline at end of file + ] +}