From e8151678ddc9fcb5d82b783247b0596c7e003b2b Mon Sep 17 00:00:00 2001 From: Raffson Date: Fri, 13 Jan 2023 20:06:35 +0100 Subject: [PATCH] Fix UI bug in CreateFlight window Pilot's player checkbox would be enabled for non-flyable aircraft if the initially selected aircraft that was flyable. --- qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py b/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py index fd403442..dc421180 100644 --- a/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py +++ b/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py @@ -119,8 +119,13 @@ class PilotControls(QHBoxLayout): pilot = self.selector.itemData(index) self.player_checkbox.blockSignals(True) try: - self.player_checkbox.setChecked(pilot is not None and pilot.player) + if self.roster and self.roster.squadron.aircraft.flyable: + self.player_checkbox.setChecked(pilot is not None and pilot.player) + else: + self.player_checkbox.setChecked(False) finally: + if self.roster is not None: + self.player_checkbox.setEnabled(self.roster.squadron.aircraft.flyable) self.player_checkbox.blockSignals(False) def update_available_pilots(self) -> None: