mirror of
https://invent.kde.org/marcoa/a-la-karte.git
synced 2026-02-10 05:13:08 +00:00
Initial release of A-La-Karte, a unified game launcher for KDE Plasma. Includes the QML UI, platform importers, AppStream metadata, icons, and developer documentation.
346 lines
11 KiB
QML
346 lines
11 KiB
QML
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
// SPDX-FileCopyrightText: 2026 A-La-Karte Contributors
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls as QQC2
|
|
import QtQuick.Layouts
|
|
import org.kde.kirigami as Kirigami
|
|
import org.kde.kirigamiaddons.formcard as FormCard
|
|
import org.kde.alakarte
|
|
import "components"
|
|
|
|
ColumnLayout {
|
|
id: settingsPage
|
|
spacing: Kirigami.Units.mediumSpacing
|
|
|
|
function focusFirstControl() {
|
|
showPlatformBadgesDelegate.forceActiveFocus()
|
|
}
|
|
|
|
FormCard.FormHeader {
|
|
Layout.fillWidth: true
|
|
title: i18n("Appearance")
|
|
}
|
|
|
|
FormCard.FormCard {
|
|
Layout.fillWidth: true
|
|
FormCard.FormCheckDelegate {
|
|
id: showPlatformBadgesDelegate
|
|
text: i18n("Show platform badges")
|
|
description: i18n("Display platform icons on game cards")
|
|
checked: App.config.showPlatformBadges
|
|
onToggled: App.config.showPlatformBadges = checked
|
|
}
|
|
}
|
|
|
|
FormCard.FormHeader {
|
|
Layout.fillWidth: true
|
|
title: i18n("Import Sources")
|
|
}
|
|
|
|
FormCard.FormCard {
|
|
Layout.fillWidth: true
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Steam")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "com.valvesoftware.Steam"
|
|
secondary: "steam"
|
|
resourceFallback: Qt.resolvedUrl("icons/brand/steam-symbolic.svg")
|
|
}
|
|
checked: App.config.importSteam
|
|
onToggled: App.config.importSteam = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Lutris")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "lutris"
|
|
secondary: "applications-games"
|
|
}
|
|
checked: App.config.importLutris
|
|
onToggled: App.config.importLutris = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Heroic Games Launcher")
|
|
description: i18n("Epic, GOG, and Amazon games")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "com.heroicgameslauncher.hgl"
|
|
secondary: "applications-games"
|
|
}
|
|
checked: App.config.importHeroic
|
|
onToggled: App.config.importHeroic = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Desktop Entries")
|
|
description: i18n("Games from .desktop files")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "user-desktop"
|
|
secondary: "computer"
|
|
}
|
|
checked: App.config.importDesktop
|
|
onToggled: App.config.importDesktop = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Bottles")
|
|
description: i18n("Wine applications")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "com.usebottles.bottles"
|
|
secondary: "application-x-executable"
|
|
}
|
|
checked: App.config.importBottles
|
|
onToggled: App.config.importBottles = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Flatpak")
|
|
description: i18n("Flatpak game applications")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "flatpak-discover"
|
|
secondary: "applications-games"
|
|
}
|
|
checked: App.config.importFlatpak
|
|
onToggled: App.config.importFlatpak = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("itch.io")
|
|
description: i18n("Games from itch.io app")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "io.itch.itch"
|
|
secondary: "itch"
|
|
resourceFallback: Qt.resolvedUrl("icons/brand/itchdotio-symbolic.svg")
|
|
}
|
|
checked: App.config.importItch
|
|
onToggled: App.config.importItch = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Legendary")
|
|
description: i18n("Epic Games via Legendary CLI")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "legendary"
|
|
secondary: "applications-games"
|
|
}
|
|
checked: App.config.importLegendary
|
|
onToggled: App.config.importLegendary = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("RetroArch")
|
|
description: i18n("Games from RetroArch playlists")
|
|
icon.name: ""
|
|
leading: IconWithResourceFallback {
|
|
primary: "org.libretro.RetroArch"
|
|
secondary: "retroarch"
|
|
resourceFallback: Qt.resolvedUrl("icons/brand/retroarch-symbolic.svg")
|
|
}
|
|
checked: App.config.importRetroArch
|
|
onToggled: App.config.importRetroArch = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Auto-import on startup")
|
|
description: i18n("Scan for new games when launching")
|
|
checked: App.config.autoImportOnStartup
|
|
onToggled: App.config.autoImportOnStartup = checked
|
|
}
|
|
}
|
|
|
|
FormCard.FormHeader {
|
|
Layout.fillWidth: true
|
|
title: i18n("Behavior")
|
|
}
|
|
|
|
FormCard.FormCard {
|
|
Layout.fillWidth: true
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Exit after launching game")
|
|
description: i18n("Close A-La-Karte when a game starts")
|
|
checked: App.config.exitAfterLaunch
|
|
onToggled: App.config.exitAfterLaunch = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Click cover to launch")
|
|
description: i18n("Clicking the cover launches the game instead of showing details")
|
|
checked: App.config.coverLaunchesGame
|
|
onToggled: App.config.coverLaunchesGame = checked
|
|
}
|
|
}
|
|
|
|
FormCard.FormHeader {
|
|
Layout.fillWidth: true
|
|
title: i18n("Cover Art")
|
|
}
|
|
|
|
FormCard.FormCard {
|
|
Layout.fillWidth: true
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("High quality images")
|
|
description: i18n("Sharper covers at the cost of memory")
|
|
checked: App.config.highQualityImages
|
|
onToggled: App.config.highQualityImages = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Animated covers")
|
|
description: i18n("Play animated cover art when available")
|
|
checked: App.config.animatedCovers
|
|
onToggled: App.config.animatedCovers = checked
|
|
}
|
|
}
|
|
|
|
FormCard.FormHeader {
|
|
Layout.fillWidth: true
|
|
title: i18n("SteamGridDB")
|
|
}
|
|
|
|
FormCard.FormCard {
|
|
Layout.fillWidth: true
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Enable SteamGridDB")
|
|
description: i18n("Automatically download cover art")
|
|
checked: App.steamGridDB.enabled
|
|
onToggled: App.steamGridDB.enabled = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormTextFieldDelegate {
|
|
label: i18n("SteamGridDB API Key")
|
|
text: App.steamGridDB.apiKey
|
|
placeholderText: i18n("Enter your API key")
|
|
echoMode: TextInput.Password
|
|
enabled: App.steamGridDB.enabled
|
|
onTextChanged: App.steamGridDB.apiKey = text
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormCheckDelegate {
|
|
text: i18n("Prefer SteamGridDB covers")
|
|
description: i18n("Replace existing covers with SteamGridDB art")
|
|
checked: App.steamGridDB.preferSteamGridDB
|
|
enabled: App.steamGridDB.enabled
|
|
onToggled: App.steamGridDB.preferSteamGridDB = checked
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormButtonDelegate {
|
|
text: i18n("Fetch All Covers")
|
|
description: App.steamGridDB.busy ? i18n("Fetching...") : i18n("Download covers for all games")
|
|
icon.name: "download"
|
|
enabled: App.steamGridDB.enabled && App.steamGridDB.apiKey.length > 0 && !App.steamGridDB.busy
|
|
onClicked: App.steamGridDB.fetchAllCovers()
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormTextDelegate {
|
|
text: i18n("Get a free API key at steamgriddb.com")
|
|
textItem.font: Kirigami.Theme.smallFont
|
|
textItem.color: Kirigami.Theme.linkColor
|
|
|
|
TapHandler {
|
|
onTapped: Qt.openUrlExternally("https://www.steamgriddb.com/profile/preferences/api")
|
|
}
|
|
}
|
|
}
|
|
|
|
FormCard.FormHeader {
|
|
Layout.fillWidth: true
|
|
title: i18n("Library")
|
|
}
|
|
|
|
FormCard.FormCard {
|
|
Layout.fillWidth: true
|
|
FormCard.FormButtonDelegate {
|
|
text: i18n("Import All Games")
|
|
description: i18n("Scan all enabled sources")
|
|
icon.name: "document-import"
|
|
enabled: !App.importing
|
|
onClicked: App.importAllGames()
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormButtonDelegate {
|
|
text: i18n("Remove Missing Games")
|
|
description: i18n("Remove games whose executables no longer exist")
|
|
icon.name: "edit-delete"
|
|
onClicked: App.removeMissingGames()
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormButtonDelegate {
|
|
text: i18n("Clear Library")
|
|
description: i18n("Remove all games")
|
|
icon.name: "edit-clear-all"
|
|
onClicked: clearConfirmDialog.open()
|
|
}
|
|
|
|
FormCard.FormDelegateSeparator {}
|
|
|
|
FormCard.FormButtonDelegate {
|
|
text: i18n("Reset Application")
|
|
description: i18n("Clear library and reset all settings to defaults")
|
|
icon.name: "edit-reset"
|
|
onClicked: resetConfirmDialog.open()
|
|
}
|
|
}
|
|
|
|
Kirigami.PromptDialog {
|
|
id: clearConfirmDialog
|
|
title: i18n("Clear Library")
|
|
subtitle: i18n("Are you sure you want to remove all games?")
|
|
standardButtons: Kirigami.Dialog.Yes | Kirigami.Dialog.No
|
|
onAccepted: App.clearLibrary()
|
|
}
|
|
|
|
Kirigami.PromptDialog {
|
|
id: resetConfirmDialog
|
|
title: i18n("Reset Application")
|
|
subtitle: i18n("This will remove all games and reset all settings to defaults. Are you sure?")
|
|
standardButtons: Kirigami.Dialog.Yes | Kirigami.Dialog.No
|
|
onAccepted: {
|
|
App.clearLibrary()
|
|
App.config.resetToDefaults()
|
|
}
|
|
}
|
|
}
|