fix: Avoid overwriting COM properties

This commit is contained in:
Lars Toenning
2025-07-12 21:00:01 +02:00
parent ac79703bfb
commit 26fb4e659a

View File

@@ -147,8 +147,18 @@ namespace swift::gui::components
// unavailable context during shutdown possible // unavailable context during shutdown possible
// mostly when client runs with DBus, but DBus is down // mostly when client runs with DBus, but DBus is down
if (!sGui || sGui->isShuttingDown() || !sGui->getIContextOwnAircraft()) { return false; } 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() void CCockpitComComponent::forceCockpitUpdateFromOwnAircraftContext()