feat(icom): the speaker choice appears beside the RX-audio option too

Same remembered preference as the console's speaker button, surfaced where
the stream itself is enabled — tick RX audio and decide in the same breath
whether it reaches the speakers. Applied immediately, no save needed.
This commit is contained in:
2026-08-29 20:02:28 +02:00
parent b244575937
commit 7ac342e2d4
6 changed files with 38 additions and 4 deletions
+19
View File
@@ -10,6 +10,7 @@ import {
GetLookupSettings, SaveLookupSettings, ClearLookupCache, TestLookupProvider,
GetListsSettings, SaveListsSettings,
GetCATSettings, SaveCATSettings, GetRadios, SaveRadios, SetActiveRadio, ActiveRadioID, DiscoverFlexRadios,
GetAudioMonitorPref,
ListProfiles, GetActiveProfile, SaveProfile, DeleteProfile, ActivateProfile, DuplicateProfile,
GetRotators, SaveRotators, TestRotatorDevice, RotatorPark, RotatorStop,
GetRotorPresets, SaveRotorPresets, ResetRotorPresets,
@@ -1601,6 +1602,7 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
// The saved radios. The CAT panel edits ONE of them — whichever is on the air
// — and the list is what makes switching possible without touching profiles.
const [radios, setRadios] = useState<any[]>([]);
const [listenPref, setListenPref] = useState(true);
const [activeRadio, setActiveRadioId] = useState('');
const [radioBusy, setRadioBusy] = useState(false);
const [catCfg, setCatCfg] = useState<CATSettings>({
@@ -2204,6 +2206,7 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
// buttons. See rotorPresetsLoaded for the belt to this brace.
try { setRotorPresets((((await GetRotorPresets()) ?? []) as any)); setRotorPresetsLoaded(true); } catch {}
try {
try { setListenPref(!!(await GetAudioMonitorPref())); } catch {}
const rl: any = await GetRadios();
setRadios(rl ?? []);
// The backend is the only one who knows which radio is on the air —
@@ -3626,6 +3629,22 @@ function SettingsModalImpl({ onClose, onSaved, initialSection, onMainPaneChanged
<span className="block text-[11px] text-muted-foreground">{t('cat.icomNetAudioHint')}</span>
</span>
</label>
{!!(catCfg as any).icom_net_audio && (
<label className="col-span-2 flex items-start gap-2 text-sm cursor-pointer pl-6">
{/* The speaker choice, right where the stream is enabled. Same
remembered preference as the console's speaker button
applied immediately, no save needed. */}
<Checkbox checked={listenPref}
onCheckedChange={(c) => {
setListenPref(!!c);
(c ? AudioStartMonitor() : Promise.resolve(AudioStopMonitor())).catch(() => setListenPref(!c));
}} />
<span>
{t('cat.icomNetListen')}
<span className="block text-[11px] text-muted-foreground">{t('cat.icomNetListenHint')}</span>
</span>
</label>
)}
</>
)}
{catCfg.backend === 'tci' && (
File diff suppressed because one or more lines are too long