mirror of
https://github.com/Moepchi/webspeak3.git
synced 2026-12-03 09:52:50 +08:00
Options -> Meldungen: checkmark applies the sound pack to all favorites
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Hu2cuPLqpuKVfd9wWFFakU
This commit is contained in:
1 parent
b4bd62c1b5
commit
b808e2ec99
6 files changed
+35
-7
No files matched your search
+20
-2
@@ -6717,7 +6717,13 @@ function SoundPackOptions() {
|
|||||||
const notificationLeaves = (node: NotificationNode): string[] =>
|
const notificationLeaves = (node: NotificationNode): string[] =>
|
||||||
node.key ? [node.key] : (node.children ?? []).flatMap(notificationLeaves);
|
node.key ? [node.key] : (node.children ?? []).flatMap(notificationLeaves);
|
||||||
|
|
||||||
function MeldungenPanel({ onOpenFavorites }: { onOpenFavorites: () => void }) {
|
function MeldungenPanel({
|
||||||
|
onOpenFavorites,
|
||||||
|
onApplyPackToFavorites,
|
||||||
|
}: {
|
||||||
|
onOpenFavorites: () => void;
|
||||||
|
onApplyPackToFavorites: () => void;
|
||||||
|
}) {
|
||||||
const t = useT();
|
const t = useT();
|
||||||
const [settings, setSettings] = useState<NotificationSettings>(getNotificationSettings);
|
const [settings, setSettings] = useState<NotificationSettings>(getNotificationSettings);
|
||||||
const [packs, reloadPacks] = useSoundPacks();
|
const [packs, reloadPacks] = useSoundPacks();
|
||||||
@@ -6843,6 +6849,14 @@ function MeldungenPanel({ onOpenFavorites }: { onOpenFavorites: () => void }) {
|
|||||||
<select id="ts-notify-pack" value={settings.pack} onChange={(e) => save({ ...settings, pack: e.target.value })}>
|
<select id="ts-notify-pack" value={settings.pack} onChange={(e) => save({ ...settings, pack: e.target.value })}>
|
||||||
<SoundPackOptions key={packs.length} />
|
<SoundPackOptions key={packs.length} />
|
||||||
</select>
|
</select>
|
||||||
|
<button
|
||||||
|
title={t("notify.applyToFavorites")}
|
||||||
|
onClick={() => {
|
||||||
|
if (window.confirm(t("notify.applyToFavoritesConfirm"))) onApplyPackToFavorites();
|
||||||
|
}}
|
||||||
|
>
|
||||||
|
✔
|
||||||
|
</button>
|
||||||
<button title={t("notify.importPack")} onClick={() => fileRef.current?.click()}>
|
<button title={t("notify.importPack")} onClick={() => fileRef.current?.click()}>
|
||||||
📂
|
📂
|
||||||
</button>
|
</button>
|
||||||
@@ -7869,6 +7883,7 @@ function OptionsDialog({
|
|||||||
onOpenIdentities,
|
onOpenIdentities,
|
||||||
onClearCache,
|
onClearCache,
|
||||||
onOpenFavorites,
|
onOpenFavorites,
|
||||||
|
onApplyPackToFavorites,
|
||||||
}: {
|
}: {
|
||||||
section: string;
|
section: string;
|
||||||
onSectionChange: (id: string) => void;
|
onSectionChange: (id: string) => void;
|
||||||
@@ -7889,6 +7904,7 @@ function OptionsDialog({
|
|||||||
onOpenIdentities: () => void;
|
onOpenIdentities: () => void;
|
||||||
onClearCache: () => void;
|
onClearCache: () => void;
|
||||||
onOpenFavorites: () => void;
|
onOpenFavorites: () => void;
|
||||||
|
onApplyPackToFavorites: () => void;
|
||||||
}) {
|
}) {
|
||||||
const t = useT();
|
const t = useT();
|
||||||
const active = OPTIONS_SECTIONS.find((s) => s.id === section) ?? OPTIONS_SECTIONS[0];
|
const active = OPTIONS_SECTIONS.find((s) => s.id === section) ?? OPTIONS_SECTIONS[0];
|
||||||
@@ -7952,7 +7968,7 @@ function OptionsDialog({
|
|||||||
) : active.id === "sicherheit" ? (
|
) : active.id === "sicherheit" ? (
|
||||||
<SecurityPanel onOpenIdentities={onOpenIdentities} onClearCache={onClearCache} />
|
<SecurityPanel onOpenIdentities={onOpenIdentities} onClearCache={onClearCache} />
|
||||||
) : active.id === "meldungen" ? (
|
) : active.id === "meldungen" ? (
|
||||||
<MeldungenPanel onOpenFavorites={onOpenFavorites} />
|
<MeldungenPanel onOpenFavorites={onOpenFavorites} onApplyPackToFavorites={onApplyPackToFavorites} />
|
||||||
) : (
|
) : (
|
||||||
<>
|
<>
|
||||||
<h3>{t(`options.section.${active.id}`)}</h3>
|
<h3>{t(`options.section.${active.id}`)}</h3>
|
||||||
@@ -13161,6 +13177,8 @@ function AppInner() {
|
|||||||
onOpenWhisperLists={() => setWhisperListsOpen(true)}
|
onOpenWhisperLists={() => setWhisperListsOpen(true)}
|
||||||
onOpenIdentities={() => setIdentitiesOpen(true)}
|
onOpenIdentities={() => setIdentitiesOpen(true)}
|
||||||
onOpenFavorites={openManageFavorites}
|
onOpenFavorites={openManageFavorites}
|
||||||
|
// Native's ✔: the chosen pack becomes every favorite's pack (drop their overrides).
|
||||||
|
onApplyPackToFavorites={() => saveFavorites(favorites.map(({ soundPack: _, ...f }) => f))}
|
||||||
onClearCache={handleClearCache}
|
onClearCache={handleClearCache}
|
||||||
section={optionsSection}
|
section={optionsSection}
|
||||||
onSectionChange={setOptionsSection}
|
onSectionChange={setOptionsSection}
|
||||||
|
|||||||
@@ -902,5 +902,7 @@
|
|||||||
"notify.text.none": "Žádná",
|
"notify.text.none": "Žádná",
|
||||||
"notify.text.server": "Server",
|
"notify.text.server": "Server",
|
||||||
"notify.text.channel": "Kanál",
|
"notify.text.channel": "Kanál",
|
||||||
"notify.resetAll": "Obnovit všechny změny"
|
"notify.resetAll": "Obnovit všechny změny",
|
||||||
|
"notify.applyToFavorites": "Použít tento zvukový balíček pro všechny oblíbené",
|
||||||
|
"notify.applyToFavoritesConfirm": "Nastavit všem oblíbeným tento zvukový balíček? Vlastní balíčky jednotlivých oblíbených budou zrušeny."
|
||||||
}
|
}
|
||||||
@@ -902,5 +902,7 @@
|
|||||||
"notify.text.none": "Keine",
|
"notify.text.none": "Keine",
|
||||||
"notify.text.server": "Server",
|
"notify.text.server": "Server",
|
||||||
"notify.text.channel": "Channel",
|
"notify.text.channel": "Channel",
|
||||||
"notify.resetAll": "Alle Anpassungen zurücksetzen"
|
"notify.resetAll": "Alle Anpassungen zurücksetzen",
|
||||||
|
"notify.applyToFavorites": "Dieses Sound Pack für alle Favoriten verwenden",
|
||||||
|
"notify.applyToFavoritesConfirm": "Alle Favoriten auf dieses Sound Pack setzen? Eigene Sound Packs einzelner Favoriten werden dabei zurückgesetzt."
|
||||||
}
|
}
|
||||||
@@ -902,5 +902,7 @@
|
|||||||
"notify.text.none": "None",
|
"notify.text.none": "None",
|
||||||
"notify.text.server": "Server",
|
"notify.text.server": "Server",
|
||||||
"notify.text.channel": "Channel",
|
"notify.text.channel": "Channel",
|
||||||
"notify.resetAll": "Reset all changes"
|
"notify.resetAll": "Reset all changes",
|
||||||
|
"notify.applyToFavorites": "Use this sound pack for all favorites",
|
||||||
|
"notify.applyToFavoritesConfirm": "Set all favorites to this sound pack? Sound packs set on individual favorites will be reset."
|
||||||
}
|
}
|
||||||
@@ -901,5 +901,7 @@
|
|||||||
"notify.text.none": "هیچ",
|
"notify.text.none": "هیچ",
|
||||||
"notify.text.server": "سرور",
|
"notify.text.server": "سرور",
|
||||||
"notify.text.channel": "کانال",
|
"notify.text.channel": "کانال",
|
||||||
"notify.resetAll": "بازنشانی همه تغییرات"
|
"notify.resetAll": "بازنشانی همه تغییرات",
|
||||||
|
"notify.applyToFavorites": "استفاده از این بسته صدا برای همه موارد علاقه",
|
||||||
|
"notify.applyToFavoritesConfirm": "همه موارد علاقه روی این بسته صدا تنظیم شوند؟ بستههای صدای جداگانه بازنشانی میشوند."
|
||||||
}
|
}
|
||||||
@@ -901,5 +901,7 @@
|
|||||||
"notify.text.none": "无",
|
"notify.text.none": "无",
|
||||||
"notify.text.server": "服务器",
|
"notify.text.server": "服务器",
|
||||||
"notify.text.channel": "频道",
|
"notify.text.channel": "频道",
|
||||||
"notify.resetAll": "重置所有更改"
|
"notify.resetAll": "重置所有更改",
|
||||||
|
"notify.applyToFavorites": "将此声音包用于所有收藏",
|
||||||
|
"notify.applyToFavoritesConfirm": "将所有收藏设为此声音包?单个收藏的声音包设置将被重置。"
|
||||||
}
|
}
|
||||||
Reference in new issue
Block a user