From a188aa2e1795f5f105315b3d77104c8c92fe89d9 Mon Sep 17 00:00:00 2001 From: ItsLemmy Date: Wed, 26 Nov 2025 15:57:34 -0500 Subject: [PATCH] Autofmt + all missing transactions --- Assets/Translations/de.json | 45 ++++++++++------- Assets/Translations/en.json | 34 ++++++------- Assets/Translations/es.json | 45 ++++++++++------- Assets/Translations/fr.json | 45 ++++++++++------- Assets/Translations/nl.json | 45 ++++++++++------- Assets/Translations/pt.json | 45 ++++++++++------- Assets/Translations/ru.json | 45 ++++++++++------- Assets/Translations/tr.json | 45 ++++++++++------- Assets/Translations/uk-UA.json | 45 ++++++++++------- Assets/Translations/zh-CN.json | 45 ++++++++++------- Modules/OSD/OSD.qml | 8 +-- Services/Media/AudioService.qml | 88 ++++++++++++++++++--------------- 12 files changed, 320 insertions(+), 215 deletions(-) diff --git a/Assets/Translations/de.json b/Assets/Translations/de.json index 33d9e822..30c8f96f 100644 --- a/Assets/Translations/de.json +++ b/Assets/Translations/de.json @@ -426,6 +426,19 @@ "panel": { "week": "Woche" }, + "timer": { + "countdown": "Countdown", + "duration": "Dauer", + "hours": "h", + "minutes": "m", + "pause": "Pause", + "reset": "Zurücksetzen", + "seconds": "s", + "start": "Start", + "stopwatch": "Stoppuhr", + "timer": "Timer", + "title": "Zeitmesser" + }, "weather": { "loading": "Wetter wird geladen…" } @@ -1474,6 +1487,20 @@ "title": "Starter" }, "location": { + "calendar": { + "banner": { + "label": "Überschrift" + }, + "calendar": { + "label": "Kalender" + }, + "cards": { + "section": { + "description": "Karten im Kalenderfeld organisieren und aktivieren/deaktivieren.", + "label": "Kalenderkarten" + } + } + }, "date-time": { "12hour-format": { "description": "Zeigt die Uhrzeit im 12-Stunden-Format auf dem Sperrbildschirm und im Kalender an. Die Uhr in der Statusleiste hat eigene Einstellungen.", @@ -2405,21 +2432,5 @@ "searching": "Suche nach nahegelegenen Netzwerken...", "title": "WLAN" } - }, - "location": { - "calendar": { - "banner": { - "label": "Kopfzeile" - }, - "calendar": { - "label": "Kalender" - }, - "cards": { - "section": { - "description": "Karten im Kalender-Panel organisieren und aktivieren/deaktivieren.", - "label": "Kalender-Karten" - } - } - } } -} \ No newline at end of file +} diff --git a/Assets/Translations/en.json b/Assets/Translations/en.json index 6f03d28a..c15e208f 100644 --- a/Assets/Translations/en.json +++ b/Assets/Translations/en.json @@ -427,15 +427,15 @@ "week": "Week" }, "timer": { + "countdown": "Countdown", "duration": "Duration", "hours": "h", "minutes": "m", - "seconds": "s", "pause": "Pause", - "start": "Start", "reset": "Reset", + "seconds": "s", + "start": "Start", "stopwatch": "Stopwatch", - "countdown": "Countdown", "timer": "Timer", "title": "Timer" }, @@ -1487,6 +1487,20 @@ "title": "Launcher" }, "location": { + "calendar": { + "banner": { + "label": "Header" + }, + "calendar": { + "label": "Calendar" + }, + "cards": { + "section": { + "description": "Organize and enable/disable cards in the calendar panel.", + "label": "Calendar cards" + } + } + }, "date-time": { "12hour-format": { "description": "Displays time in 12-hour format on the lock screen and calendar. The bar clock has its own settings.", @@ -1547,20 +1561,6 @@ "description": "Show the daily weather forecast directly in your calendar view.", "label": "Display weather in calendar" } - }, - "calendar": { - "banner": { - "label": "Header" - }, - "calendar": { - "label": "Calendar" - }, - "cards": { - "section": { - "description": "Organize and enable/disable cards in the calendar panel.", - "label": "Calendar cards" - } - } } }, "lock-screen": { diff --git a/Assets/Translations/es.json b/Assets/Translations/es.json index 49342a8e..8fcd6ac2 100644 --- a/Assets/Translations/es.json +++ b/Assets/Translations/es.json @@ -426,6 +426,19 @@ "panel": { "week": "Semana" }, + "timer": { + "countdown": "Cuenta regresiva", + "duration": "Duración", + "hours": "h", + "minutes": "m", + "pause": "Pausa", + "reset": "Restablecer", + "seconds": "s", + "start": "Comenzar", + "stopwatch": "Cronómetro", + "timer": "Temporizador", + "title": "Temporizador" + }, "weather": { "loading": "Cargando el clima…" } @@ -1474,6 +1487,20 @@ "title": "Lanzador" }, "location": { + "calendar": { + "banner": { + "label": "Encabezado" + }, + "calendar": { + "label": "Calendario" + }, + "cards": { + "section": { + "description": "Organizar y activar/desactivar tarjetas en el panel del calendario.", + "label": "Tarjetas de calendario" + } + } + }, "date-time": { "12hour-format": { "description": "Muestra la hora en formato de 12 horas en la pantalla de bloqueo y el calendario. El reloj de la barra tiene su propia configuración.", @@ -2405,21 +2432,5 @@ "searching": "Buscando redes cercanas...", "title": "Wi-Fi" } - }, - "location": { - "calendar": { - "cards": { - "section": { - "description": "Organizar y activar/desactivar tarjetas en el panel del calendario.", - "label": "Tarjetas del calendario" - } - }, - "banner": { - "label": "Encabezado" - }, - "calendar": { - "label": "Calendario" - } - } } -} \ No newline at end of file +} diff --git a/Assets/Translations/fr.json b/Assets/Translations/fr.json index 1dafd4b4..18b88e16 100644 --- a/Assets/Translations/fr.json +++ b/Assets/Translations/fr.json @@ -426,6 +426,19 @@ "panel": { "week": "Semaine" }, + "timer": { + "countdown": "Compte à rebours", + "duration": "Durée", + "hours": "h", + "minutes": "m", + "pause": "Pause", + "reset": "Réinitialiser", + "seconds": "s", + "start": "Commencer", + "stopwatch": "Chronomètre", + "timer": "Minuteur", + "title": "Minuteur" + }, "weather": { "loading": "Chargement de la météo…" } @@ -1474,6 +1487,20 @@ "title": "Lanceur" }, "location": { + "calendar": { + "banner": { + "label": "En-tête" + }, + "calendar": { + "label": "Calendrier" + }, + "cards": { + "section": { + "description": "Organiser et activer/désactiver les cartes dans le panneau de calendrier.", + "label": "Cartes de calendrier" + } + } + }, "date-time": { "12hour-format": { "description": "Affiche l'heure au format 12 heures sur l'écran de verrouillage et dans le calendrier. L'horloge de la barre possède ses propres paramètres.", @@ -2405,21 +2432,5 @@ "searching": "Recherche de réseaux à proximité en cours...", "title": "Wi-Fi" } - }, - "location": { - "calendar": { - "cards": { - "section": { - "description": "Organiser et activer/désactiver les cartes dans le panneau du calendrier.", - "label": "Cartes du calendrier" - } - }, - "banner": { - "label": "En-tête" - }, - "calendar": { - "label": "Calendrier" - } - } } -} \ No newline at end of file +} diff --git a/Assets/Translations/nl.json b/Assets/Translations/nl.json index 6e67fa2e..6f684784 100644 --- a/Assets/Translations/nl.json +++ b/Assets/Translations/nl.json @@ -426,6 +426,19 @@ "panel": { "week": "Week" }, + "timer": { + "countdown": "Aftellen", + "duration": "Duur", + "hours": "h", + "minutes": "m", + "pause": "Pauze", + "reset": "Resetten", + "seconds": "s", + "start": "Begin", + "stopwatch": "Stopwatch", + "timer": "Timer", + "title": "Timer" + }, "weather": { "loading": "Weer laden…" } @@ -1474,6 +1487,20 @@ "title": "Launcher" }, "location": { + "calendar": { + "banner": { + "label": "Koptekst" + }, + "calendar": { + "label": "Kalender" + }, + "cards": { + "section": { + "description": "Kaarten organiseren en in-/uitschakelen in het kalenderpaneel.", + "label": "Kalenderkaarten" + } + } + }, "date-time": { "12hour-format": { "description": "Toont tijd in 12-uurs formaat op het vergrendelscherm en in de kalender. De klok op de balk heeft zijn eigen instellingen.", @@ -2405,21 +2432,5 @@ "searching": "Zoeken naar netwerken in de buurt...", "title": "Wi-Fi" } - }, - "location": { - "calendar": { - "cards": { - "section": { - "description": "Organiseer en schakel kaarten in het kalenderpaneel in/uit.", - "label": "Kalenderkaarten" - } - }, - "banner": { - "label": "Koptekst" - }, - "calendar": { - "label": "Kalender" - } - } } -} \ No newline at end of file +} diff --git a/Assets/Translations/pt.json b/Assets/Translations/pt.json index 4f578e9a..209297a1 100644 --- a/Assets/Translations/pt.json +++ b/Assets/Translations/pt.json @@ -426,6 +426,19 @@ "panel": { "week": "Semana" }, + "timer": { + "countdown": "Contagem regressiva", + "duration": "Duração", + "hours": "h", + "minutes": "m", + "pause": "Pausar", + "reset": "Reiniciar", + "seconds": "s", + "start": "Começar", + "stopwatch": "Cronômetro", + "timer": "Temporizador", + "title": "Temporizador" + }, "weather": { "loading": "Carregando o clima…" } @@ -1474,6 +1487,20 @@ "title": "Lançador" }, "location": { + "calendar": { + "banner": { + "label": "Cabeçalho" + }, + "calendar": { + "label": "Calendário" + }, + "cards": { + "section": { + "description": "Organize e ative/desative cartões no painel do calendário.", + "label": "Cartões de calendário" + } + } + }, "date-time": { "12hour-format": { "description": "Exibe a hora no formato de 12 horas na tela de bloqueio e no calendário. O relógio da barra tem suas próprias configurações.", @@ -2405,21 +2432,5 @@ "searching": "Procurando redes próximas...", "title": "Wi-Fi" } - }, - "location": { - "calendar": { - "cards": { - "section": { - "description": "Organize e ative/desative cartões no painel do calendário.", - "label": "Cartões do calendário" - } - }, - "banner": { - "label": "Cabeçalho" - }, - "calendar": { - "label": "Calendário" - } - } } -} \ No newline at end of file +} diff --git a/Assets/Translations/ru.json b/Assets/Translations/ru.json index c7a70449..df6a8a85 100644 --- a/Assets/Translations/ru.json +++ b/Assets/Translations/ru.json @@ -426,6 +426,19 @@ "panel": { "week": "Неделя" }, + "timer": { + "countdown": "Обратный отсчёт", + "duration": "Продолжительность", + "hours": "ч", + "minutes": "м", + "pause": "Пауза", + "reset": "Сброс", + "seconds": "с", + "start": "Начать", + "stopwatch": "Секундомер", + "timer": "Таймер", + "title": "Таймер" + }, "weather": { "loading": "Загрузка погоды…" } @@ -1474,6 +1487,20 @@ "title": "Запуск" }, "location": { + "calendar": { + "banner": { + "label": "Заголовок" + }, + "calendar": { + "label": "Календарь" + }, + "cards": { + "section": { + "description": "Организуйте и включайте/выключайте карточки в панели календаря.", + "label": "Карточки календаря" + } + } + }, "date-time": { "12hour-format": { "description": "Отображает время в 12-часовом формате на экране блокировки и в календаре. Часы на панели имеют собственные настройки.", @@ -2405,21 +2432,5 @@ "searching": "Поиск ближайших сетей...", "title": "Wi-Fi" } - }, - "location": { - "calendar": { - "cards": { - "section": { - "description": "Организуйте и включайте/отключайте карточки на панели календаря.", - "label": "Карточки календаря" - } - }, - "banner": { - "label": "Заголовок" - }, - "calendar": { - "label": "Календарь" - } - } } -} \ No newline at end of file +} diff --git a/Assets/Translations/tr.json b/Assets/Translations/tr.json index 0a99f0bd..952f39f1 100644 --- a/Assets/Translations/tr.json +++ b/Assets/Translations/tr.json @@ -426,6 +426,19 @@ "panel": { "week": "Hafta" }, + "timer": { + "countdown": "Geri sayım", + "duration": "Süre", + "hours": "h", + "minutes": "m", + "pause": "Duraklat", + "reset": "Sıfırla", + "seconds": "s", + "start": "Başla", + "stopwatch": "Kronometre", + "timer": "Zamanlayıcı", + "title": "Zamanlayıcı" + }, "weather": { "loading": "Hava durumu yükleniyor..." } @@ -1474,6 +1487,20 @@ "title": "Başlatıcı" }, "location": { + "calendar": { + "banner": { + "label": "Başlık" + }, + "calendar": { + "label": "Takvim" + }, + "cards": { + "section": { + "description": "Takvim panelinde kartları düzenleyin ve etkinleştirin/devre dışı bırakın.", + "label": "Takvim kartları" + } + } + }, "date-time": { "12hour-format": { "description": "Zamanı kilit ekranında ve takvimde 12 saatlik formatta gösterir. Çubuk saatinin kendi ayarları vardır.", @@ -2405,21 +2432,5 @@ "searching": "Yakındaki ağlar aranıyor...", "title": "Wi-Fi" } - }, - "location": { - "calendar": { - "cards": { - "section": { - "description": "Takvim panelindeki kartları düzenleyin ve etkinleştirin/devre dışı bırakın.", - "label": "Takvim kartları" - } - }, - "banner": { - "label": "Başlık" - }, - "calendar": { - "label": "Takvim" - } - } } -} \ No newline at end of file +} diff --git a/Assets/Translations/uk-UA.json b/Assets/Translations/uk-UA.json index b04556c5..e2da1d15 100644 --- a/Assets/Translations/uk-UA.json +++ b/Assets/Translations/uk-UA.json @@ -426,6 +426,19 @@ "panel": { "week": "Тиждень" }, + "timer": { + "countdown": "Зворотний відлік", + "duration": "Тривалість", + "hours": "г", + "minutes": "м", + "pause": "Пауза", + "reset": "Скинути", + "seconds": "с", + "start": "Почати", + "stopwatch": "Секундомір", + "timer": "Таймер", + "title": "Таймер" + }, "weather": { "loading": "Завантаження погоди…" } @@ -1474,6 +1487,20 @@ "title": "Запускач" }, "location": { + "calendar": { + "banner": { + "label": "Заголовок" + }, + "calendar": { + "label": "Календар" + }, + "cards": { + "section": { + "description": "Організуйте та вмикайте/вимикайте картки на панелі календаря.", + "label": "Календарні картки" + } + } + }, "date-time": { "12hour-format": { "description": "Відображати час у 12-годинному форматі на екрані блокування та в календарі. Годинник на панелі має власні налаштування.", @@ -2405,21 +2432,5 @@ "searching": "Пошук близьких мереж...", "title": "Wi-Fi" } - }, - "location": { - "calendar": { - "cards": { - "section": { - "description": "Організуйте та увімкніть/вимкніть картки на панелі календаря.", - "label": "Картки календаря" - } - }, - "banner": { - "label": "Заголовок" - }, - "calendar": { - "label": "Календар" - } - } } -} \ No newline at end of file +} diff --git a/Assets/Translations/zh-CN.json b/Assets/Translations/zh-CN.json index 5cf6c196..0005856b 100644 --- a/Assets/Translations/zh-CN.json +++ b/Assets/Translations/zh-CN.json @@ -426,6 +426,19 @@ "panel": { "week": "周" }, + "timer": { + "countdown": "倒计时", + "duration": "时长", + "hours": "h", + "minutes": "米", + "pause": "暂停", + "reset": "重置", + "seconds": "s", + "start": "开始", + "stopwatch": "秒表", + "timer": "计时器", + "title": "计时器" + }, "weather": { "loading": "正在加载天气…" } @@ -1474,6 +1487,20 @@ "title": "启动器" }, "location": { + "calendar": { + "banner": { + "label": "标题" + }, + "calendar": { + "label": "日历" + }, + "cards": { + "section": { + "description": "在日历面板中组织和启用/禁用卡片。", + "label": "日历卡" + } + } + }, "date-time": { "12hour-format": { "description": "在锁屏和日历上以 12 小时制格式显示时间。状态栏时钟有其自己的设置。", @@ -2405,21 +2432,5 @@ "searching": "正在搜索附近网络...", "title": "Wi-Fi" } - }, - "location": { - "calendar": { - "cards": { - "section": { - "description": "组织并启用/禁用日历面板中的卡片。", - "label": "日历卡片" - } - }, - "banner": { - "label": "标题" - }, - "calendar": { - "label": "日历" - } - } } -} \ No newline at end of file +} diff --git a/Modules/OSD/OSD.qml b/Modules/OSD/OSD.qml index 6b222b95..d0e1ea90 100644 --- a/Modules/OSD/OSD.qml +++ b/Modules/OSD/OSD.qml @@ -222,8 +222,8 @@ Variants { // If volume OSD is currently showing, refresh it to show new device's volume if (root.currentOSDType === OSD.Type.Volume) { Qt.callLater(() => { - showOSD(OSD.Type.Volume); - }); + showOSD(OSD.Type.Volume); + }); } } @@ -231,8 +231,8 @@ Variants { // If input volume OSD is currently showing, refresh it to show new device's volume if (root.currentOSDType === OSD.Type.InputVolume) { Qt.callLater(() => { - showOSD(OSD.Type.InputVolume); - }); + showOSD(OSD.Type.InputVolume); + }); } } } diff --git a/Services/Media/AudioService.qml b/Services/Media/AudioService.qml index e8ae16fe..823ddc90 100644 --- a/Services/Media/AudioService.qml +++ b/Services/Media/AudioService.qml @@ -19,9 +19,11 @@ Singleton { // Output Volume - read directly from device (like friend's version) readonly property real volume: { - if (!sink?.audio) return 0; + if (!sink?.audio) + return 0; const vol = sink.audio.volume; - if (vol === undefined || isNaN(vol)) return 0; + if (vol === undefined || isNaN(vol)) + return 0; const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0; return Math.max(0, Math.min(maxVolume, vol)); } @@ -29,9 +31,11 @@ Singleton { // Input Volume - read directly from device (like friend's version) readonly property real inputVolume: { - if (!source?.audio) return 0; + if (!source?.audio) + return 0; const vol = source.audio.volume; - if (vol === undefined || isNaN(vol)) return 0; + if (vol === undefined || isNaN(vol)) + return 0; const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0; return Math.max(0, Math.min(maxVolume, vol)); } @@ -41,28 +45,32 @@ Singleton { // Filtered device nodes (non-stream sinks and sources) readonly property var deviceNodes: Pipewire.ready ? Pipewire.nodes.values.reduce((acc, node) => { - if (!node.isStream) { - if (node.isSink) { - acc.sinks.push(node); - } else if (node.audio) { - acc.sources.push(node); - } - } - return acc; - }, { - "sources": [], - "sinks": [] - }) : { "sources": [], "sinks": [] } + if (!node.isStream) { + if (node.isSink) { + acc.sinks.push(node); + } else if (node.audio) { + acc.sources.push(node); + } + } + return acc; + }, { + "sources": [], + "sinks": [] + }) : { + "sources": [], + "sinks": [] + } // Validated source (ensures it's a proper audio source, not a sink) readonly property PwNode validatedSource: { - if (!Pipewire.ready) return null; + if (!Pipewire.ready) + return null; const raw = Pipewire.defaultAudioSource; if (!raw || raw.isSink || !raw.audio) - return null; + return null; // Optional: check type if available (type reflects media.class per docs) if (raw.type && typeof raw.type === "string" && !raw.type.startsWith("Audio/Source")) - return null; + return null; return raw; } @@ -86,7 +94,6 @@ Singleton { objects: [...root.sinks, ...root.sources] } - // Watch output device changes for clamping Connections { target: sink?.audio ?? null @@ -107,21 +114,20 @@ Singleton { } const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0; - + // If volume exceeds max, clamp it (but only if we didn't just set it) if (vol > maxVolume) { root.isSettingOutputVolume = true; Qt.callLater(() => { - if (root.sink?.audio && root.sink.audio.volume > maxVolume) { - root.sink.audio.volume = maxVolume; - } - root.isSettingOutputVolume = false; - }); + if (root.sink?.audio && root.sink.audio.volume > maxVolume) { + root.sink.audio.volume = maxVolume; + } + root.isSettingOutputVolume = false; + }); } } } - // Watch input device changes for clamping Connections { target: source?.audio ?? null @@ -142,16 +148,16 @@ Singleton { } const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0; - + // If volume exceeds max, clamp it (but only if we didn't just set it) if (vol > maxVolume) { root.isSettingInputVolume = true; Qt.callLater(() => { - if (root.source?.audio && root.source.audio.volume > maxVolume) { - root.source.audio.volume = maxVolume; - } - root.isSettingInputVolume = false; - }); + if (root.source?.audio && root.source.audio.volume > maxVolume) { + root.source.audio.volume = maxVolume; + } + root.isSettingInputVolume = false; + }); } } } @@ -187,16 +193,16 @@ Singleton { const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0; const clampedVolume = Math.max(0, Math.min(maxVolume, newVolume)); - + // Set flag to prevent feedback loop, then set the actual volume isSettingOutputVolume = true; sink.audio.muted = false; sink.audio.volume = clampedVolume; - + // Clear flag after a short delay to allow external changes to be detected Qt.callLater(() => { - isSettingOutputVolume = false; - }); + isSettingOutputVolume = false; + }); } function setOutputMuted(muted: bool) { @@ -251,16 +257,16 @@ Singleton { const maxVolume = Settings.data.audio.volumeOverdrive ? 1.5 : 1.0; const clampedVolume = Math.max(0, Math.min(maxVolume, newVolume)); - + // Set flag to prevent feedback loop, then set the actual volume isSettingInputVolume = true; source.audio.muted = false; source.audio.volume = clampedVolume; - + // Clear flag after a short delay to allow external changes to be detected Qt.callLater(() => { - isSettingInputVolume = false; - }); + isSettingInputVolume = false; + }); } function setInputMuted(muted: bool) {