mirror of
https://github.com/redstrate/Astra.git
synced 2025-04-23 21:07:45 +00:00
Use the fancy categorized settings
This commit is contained in:
parent
b716801165
commit
c2fdf5961e
7 changed files with 209 additions and 170 deletions
|
@ -11,11 +11,14 @@ SPDX-License-Identifier: GPL-3.0-or-later
|
|||
<file>ui/Pages/MainPage.qml</file>
|
||||
<file>ui/Pages/NewsPage.qml</file>
|
||||
<file>ui/Pages/StatusPage.qml</file>
|
||||
<file>ui/Settings/AboutPage.qml</file>
|
||||
<file>ui/Settings/AccountSettings.qml</file>
|
||||
<file>ui/Settings/AccountsPage.qml</file>
|
||||
<file>ui/Settings/CompatibilityToolSetup.qml</file>
|
||||
<file>ui/Settings/DeveloperSettings.qml</file>
|
||||
<file>ui/Settings/GeneralSettings.qml</file>
|
||||
<file>ui/Settings/ProfileSettings.qml</file>
|
||||
<file>ui/Settings/ProfilesPage.qml</file>
|
||||
<file>ui/Settings/SettingsPage.qml</file>
|
||||
<file>ui/Setup/AccountSetup.qml</file>
|
||||
<file>ui/Setup/AddSapphire.qml</file>
|
||||
|
|
14
launcher/ui/Settings/AboutPage.qml
Normal file
14
launcher/ui/Settings/AboutPage.qml
Normal file
|
@ -0,0 +1,14 @@
|
|||
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||
// 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
|
||||
}
|
66
launcher/ui/Settings/AccountsPage.qml
Normal file
66
launcher/ui/Settings/AccountsPage.qml
Normal file
|
@ -0,0 +1,66 @@
|
|||
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||
// 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')
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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,12 +31,15 @@ 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
|
||||
|
||||
|
|
|
@ -9,7 +9,14 @@ import QtQuick.Layouts 1.15
|
|||
import org.kde.kirigamiaddons.formcard 1.0 as FormCard
|
||||
import zone.xiv.astra 1.0
|
||||
|
||||
FormCard.FormCard {
|
||||
FormCard.FormCardPage {
|
||||
title: i18n("General")
|
||||
|
||||
FormCard.FormHeader {
|
||||
title: i18n("General settings")
|
||||
}
|
||||
|
||||
FormCard.FormCard {
|
||||
FormCard.FormCheckDelegate {
|
||||
id: closeAstraDelegate
|
||||
|
||||
|
@ -30,4 +37,5 @@ FormCard.FormCard {
|
|||
checked: LauncherCore.showNews
|
||||
onCheckedChanged: LauncherCore.showNews = checked
|
||||
}
|
||||
}
|
||||
}
|
50
launcher/ui/Settings/ProfilesPage.qml
Normal file
50
launcher/ui/Settings/ProfilesPage.qml
Normal file
|
@ -0,0 +1,50 @@
|
|||
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
||||
// 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()
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -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")
|
||||
}
|
||||
]
|
||||
}
|
Loading…
Add table
Reference in a new issue