2023-07-30 08:49:34 -04:00
|
|
|
// SPDX-FileCopyrightText: 2023 Joshua Goins <josh@redstrate.com>
|
|
|
|
// SPDX-License-Identifier: GPL-3.0-or-later
|
|
|
|
|
2023-09-16 18:15:11 -04:00
|
|
|
import QtQuick
|
|
|
|
import QtQuick.Controls as QQC2
|
|
|
|
import QtQuick.Layouts
|
2023-09-20 16:44:43 -04:00
|
|
|
import QtQuick.Window
|
2023-09-16 18:15:11 -04:00
|
|
|
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
import org.kde.kirigamiaddons.formcard as FormCard
|
|
|
|
|
|
|
|
import zone.xiv.astra
|
2023-07-30 08:49:34 -04:00
|
|
|
|
|
|
|
import "../Components"
|
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormCardPage {
|
2023-07-30 08:49:34 -04:00
|
|
|
id: page
|
|
|
|
|
|
|
|
property var profile
|
|
|
|
|
2023-09-20 15:30:50 -04:00
|
|
|
title: i18nc("@window:title", "Edit Profile")
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormHeader {
|
|
|
|
title: i18n("General")
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormCard {
|
|
|
|
Layout.fillWidth: true
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormTextFieldDelegate {
|
|
|
|
id: nameDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
label: i18n("Name")
|
|
|
|
text: page.profile.name
|
|
|
|
onTextChanged: page.profile.name = text
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: nameDelegate
|
|
|
|
below: gamePathDelegate
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormFolderDelegate {
|
|
|
|
id: gamePathDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
text: i18n("Game Path")
|
|
|
|
folder: page.profile.gamePath
|
2023-09-20 15:57:27 -04:00
|
|
|
|
|
|
|
onAccepted: (folder) => page.profile.gamePath = folder
|
2023-08-19 10:30:52 -04:00
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: gamePathDelegate
|
|
|
|
below: directXDelegate
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
id: directXDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
text: i18n("DirectX Version")
|
|
|
|
model: ["DirectX 11", "DirectX 9"]
|
|
|
|
currentIndex: page.profile.directx9Enabled ? 1 : 0
|
|
|
|
onCurrentIndexChanged: page.profile.directx9Enabled = (currentIndex === 1)
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: directXDelegate
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormTextDelegate {
|
|
|
|
description: page.profile.expansionVersionText
|
|
|
|
}
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormHeader {
|
|
|
|
title: i18n("Wine")
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormCard {
|
|
|
|
Layout.fillWidth: true
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
id: wineTypeDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
text: i18n("Wine Type")
|
2023-12-20 18:00:40 -05:00
|
|
|
model: [i18n("Built-in"), i18n("Custom")]
|
2023-08-19 10:30:52 -04:00
|
|
|
currentIndex: page.profile.wineType
|
|
|
|
onCurrentIndexChanged: page.profile.wineType = currentIndex
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: wineTypeDelegate
|
|
|
|
below: winePathDelegate
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormFileDelegate {
|
|
|
|
id: winePathDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-10-08 13:23:04 -04:00
|
|
|
text: i18n("Wine Executable")
|
2023-08-19 10:30:52 -04:00
|
|
|
file: page.profile.winePath
|
2023-12-20 18:00:40 -05:00
|
|
|
enabled: page.profile.wineType !== Profile.BuiltIn
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: winePathDelegate
|
|
|
|
below: winePrefixPathDelegate
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormFolderDelegate {
|
|
|
|
id: winePrefixPathDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
text: i18n("Wine Prefix Path")
|
|
|
|
folder: page.profile.winePrefixPath
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: winePrefixPathDelegate
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormTextDelegate {
|
|
|
|
description: page.profile.wineVersionText
|
|
|
|
}
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormHeader {
|
|
|
|
title: i18n("Tools")
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormCard {
|
|
|
|
Layout.fillWidth: true
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
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 {
|
2023-09-16 18:15:11 -04:00
|
|
|
QQC2.CheckBox {
|
2023-08-19 10:30:52 -04:00
|
|
|
Kirigami.FormData.label: "Fullscreen:"
|
|
|
|
checked: page.profile.gamescopeFullscreen
|
|
|
|
onCheckedChanged: page.profile.gamescopeFullscreen = checked
|
|
|
|
}
|
2023-09-16 18:15:11 -04:00
|
|
|
QQC2.CheckBox {
|
2023-08-19 10:30:52 -04:00
|
|
|
Kirigami.FormData.label: "Borderless:"
|
|
|
|
checked: page.profile.gamescopeBorderless
|
|
|
|
onCheckedChanged: page.profile.gamescopeBorderless = checked
|
|
|
|
}
|
2023-09-16 18:15:11 -04:00
|
|
|
QQC2.SpinBox {
|
2023-08-19 10:30:52 -04:00
|
|
|
Kirigami.FormData.label: "Width:"
|
|
|
|
to: 4096
|
|
|
|
value: page.profile.gamescopeWidth
|
|
|
|
onValueModified: page.profile.gamescopeWidth = value
|
|
|
|
}
|
2023-09-16 18:15:11 -04:00
|
|
|
QQC2.SpinBox {
|
2023-08-19 10:30:52 -04:00
|
|
|
Kirigami.FormData.label: "Height:"
|
|
|
|
to: 4096
|
|
|
|
value: page.profile.gamescopeHeight
|
|
|
|
onValueModified: page.profile.gamescopeHeight = value
|
|
|
|
}
|
2023-09-16 18:15:11 -04:00
|
|
|
QQC2.SpinBox {
|
2023-08-19 10:30:52 -04:00
|
|
|
Kirigami.FormData.label: "Refresh Rate:"
|
|
|
|
to: 512
|
|
|
|
value: page.profile.gamescopeRefreshRate
|
|
|
|
onValueModified: page.profile.gamescopeRefreshRate = value
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
}
|
2023-08-19 10:30:52 -04:00
|
|
|
|
|
|
|
onClicked: gamescopeSettingsDialog.open()
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
visible: false
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormCheckDelegate {
|
|
|
|
id: gamemodeDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
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
|
|
|
|
}
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormHeader {
|
|
|
|
title: i18n("Dalamud")
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormCard {
|
|
|
|
Layout.fillWidth: true
|
2023-07-31 19:02:42 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormCheckDelegate {
|
|
|
|
id: enableDalamudDelegate
|
2023-07-31 19:02:42 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
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
|
|
|
|
}
|
2023-07-31 19:02:42 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: enableDalamudDelegate
|
|
|
|
below: dalamudChannelDelegate
|
|
|
|
}
|
2023-07-31 19:02:42 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
id: dalamudChannelDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
text: i18n("Update Channel")
|
2023-12-23 11:22:34 -05:00
|
|
|
model: [i18n("Stable"), i18n("Staging")]
|
2023-08-19 10:30:52 -04:00
|
|
|
currentIndex: page.profile.dalamudChannel
|
|
|
|
onCurrentIndexChanged: page.profile.dalamudChannel = currentIndex
|
|
|
|
enabled: page.profile.dalamudEnabled
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: dalamudChannelDelegate
|
|
|
|
below: dalamudInjectDelegate
|
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormComboBoxDelegate {
|
|
|
|
id: dalamudInjectDelegate
|
2023-07-30 08:49:34 -04:00
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
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"]
|
2023-09-20 16:28:59 -04:00
|
|
|
currentIndex: page.profile.dalamudInjectMethod
|
|
|
|
onCurrentIndexChanged: page.profile.dalamudInjectMethod = currentIndex
|
2023-08-19 10:30:52 -04:00
|
|
|
enabled: page.profile.dalamudEnabled
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
|
2023-08-19 10:30:52 -04:00
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: dalamudInjectDelegate
|
|
|
|
below: dalamudDelayDelegate
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormSpinBoxDelegate {
|
|
|
|
id: dalamudDelayDelegate
|
|
|
|
|
|
|
|
label: i18n("Injection Delay")
|
2023-09-20 16:28:59 -04:00
|
|
|
value: page.profile.dalamudInjectDelay
|
|
|
|
onValueChanged: page.profile.dalamudInjectDelay = value
|
2023-08-19 10:30:52 -04:00
|
|
|
enabled: page.profile.dalamudEnabled
|
|
|
|
}
|
|
|
|
|
|
|
|
FormCard.FormDelegateSeparator {
|
|
|
|
above: dalamudDelayDelegate
|
|
|
|
}
|
|
|
|
|
|
|
|
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)
|
2023-08-19 10:53:41 -04:00
|
|
|
|
|
|
|
Kirigami.PromptDialog {
|
|
|
|
id: deletePrompt
|
|
|
|
|
|
|
|
title: i18nc("@title", "Delete Profile")
|
|
|
|
subtitle: i18nc("@label", "Are you sure you want to delete this profile?")
|
|
|
|
standardButtons: Kirigami.Dialog.Ok | Kirigami.Dialog.Cancel
|
|
|
|
showCloseButton: false
|
|
|
|
|
|
|
|
onAccepted: {
|
|
|
|
LauncherCore.profileManager.deleteProfile(page.profile);
|
2023-09-20 16:44:43 -04:00
|
|
|
page.Window.window.pageStack.layers.pop();
|
2023-08-19 10:53:41 -04:00
|
|
|
}
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
2023-08-19 10:53:41 -04:00
|
|
|
|
|
|
|
onClicked: deletePrompt.open()
|
2023-07-30 08:49:34 -04:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|