feat: load the user's mpv.conf

This commit is contained in:
tri committed 2026-10-28 00:03:01 +07:00
1 parent fe2f159660
commit 6b5742b2ca
11 files changed
+298 -6

No files matched your search

+1
View File
@@ -33,6 +33,7 @@ Kirigami.ApplicationWindow {
id: settingsPage
SettingsPage {
translator: player.translator
mpvItem: player.mpvItem
}
}
+4
View File
@@ -14,6 +14,7 @@ Kirigami.Page {
property bool fullScreen: false
readonly property alias mediaTitle: mpv.mediaTitle
readonly property alias translator: translator
readonly property MpvItem mpvItem: mpv
signal aboutRequested()
signal settingsRequested()
@@ -175,6 +176,9 @@ Kirigami.Page {
MpvItem {
id: mpv
loadUserConfig: QtPotatoSettings.loadMpvConfig
// QtPotato's own subtitle settings win over mpv.conf.
onUserConfigApplied: page.applySubtitleStyle()
anchors {
left: parent.left
right: parent.right
+27
View File
@@ -9,6 +9,7 @@ FormCard.FormCardPage {
id: page
required property TranslationService translator
required property MpvItem mpvItem
title: KI18n.i18nc("@title", "Settings")
@@ -27,6 +28,32 @@ FormCard.FormCardPage {
onVisibleChanged: if (!visible) page.translator.clearError()
}
FormCard.FormHeader {
title: KI18n.i18nc("@title:group", "Player")
}
FormCard.FormCard {
FormCard.FormSwitchDelegate {
text: KI18n.i18nc("@option:check", "Use mpv.conf")
description: KI18n.i18nc("@info", "Reads mpv.conf from %1, like the mpv player does. Changes apply the next time QtPotato starts. Subtitle text size and outline set below take precedence.", page.mpvItem.userConfigDir)
checked: QtPotatoSettings.loadMpvConfig
onToggled: QtPotatoSettings.loadMpvConfig = checked
}
FormCard.FormDelegateSeparator {}
FormCard.FormTextDelegate {
text: page.mpvItem.loadedUserConfigFiles.length > 0
? KI18n.i18nc("@info", "Loaded: %1", page.mpvItem.loadedUserConfigFiles.join(", "))
: (QtPotatoSettings.loadMpvConfig
? KI18n.i18nc("@info", "No mpv.conf found")
: KI18n.i18nc("@info", "mpv.conf is not used"))
description: page.mpvItem.skippedUserOptions.length > 0
? KI18n.i18nc("@info", "Ignored because they would break the built-in player: %1", page.mpvItem.skippedUserOptions.join(", "))
: ""
}
}
FormCard.FormHeader {
title: KI18n.i18nc("@title:group", "Subtitles")
}