From 26fb4e659a55b2399fe42f18955e72325ce6485a Mon Sep 17 00:00:00 2001 From: Lars Toenning Date: Sat, 12 Jul 2025 21:00:01 +0200 Subject: [PATCH] fix: Avoid overwriting COM properties --- src/gui/components/cockpitcomcomponent.cpp | 14 ++++++++++++-- 1 file changed, 12 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cockpitcomcomponent.cpp b/src/gui/components/cockpitcomcomponent.cpp index fefb5c102..e8fb64914 100644 --- a/src/gui/components/cockpitcomcomponent.cpp +++ b/src/gui/components/cockpitcomcomponent.cpp @@ -147,8 +147,18 @@ namespace swift::gui::components // unavailable context during shutdown possible // mostly when client runs with DBus, but DBus is down if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return false; } - return sGui->getIContextOwnAircraft()->updateCockpit(ownAircraft.getCom1System(), ownAircraft.getCom2System(), - ownAircraft.getTransponder(), identifier()); + + // The CockpitComForm triggering this slot only includes frequencies and transponder mode/code. + // Everything else is left as default default (especially radio volume and TX/RX state). + CComSystem com1 = sGui->getIContextOwnAircraft()->getOwnAircraft().getCom1System(); + CComSystem com2 = sGui->getIContextOwnAircraft()->getOwnAircraft().getCom2System(); + com1.setFrequencyActive(ownAircraft.getCom1System().getFrequencyActive()); + com1.setFrequencyStandby(ownAircraft.getCom1System().getFrequencyStandby()); + com2.setFrequencyActive(ownAircraft.getCom2System().getFrequencyActive()); + com2.setFrequencyStandby(ownAircraft.getCom2System().getFrequencyStandby()); + + return sGui->getIContextOwnAircraft()->updateCockpit(com1, com2, + ownAircraft.getTransponder(), identifier()); } void CCockpitComComponent::forceCockpitUpdateFromOwnAircraftContext()