diff --git a/qt_ui/windows/mission/flight/QFlightCreator.py b/qt_ui/windows/mission/flight/QFlightCreator.py index 9183c19e..572d0a98 100644 --- a/qt_ui/windows/mission/flight/QFlightCreator.py +++ b/qt_ui/windows/mission/flight/QFlightCreator.py @@ -144,7 +144,7 @@ class QFlightCreator(QDialog): def reject(self) -> None: super().reject() # Clear the roster to return pilots to the pool. - self.roster_editor.replace(None) + self.roster_editor.replace(None, None) def set_custom_name_text(self, text: str): self.custom_name_text = text @@ -230,9 +230,9 @@ class QFlightCreator(QDialog): def on_squadron_changed(self, index: int) -> None: squadron: Optional[Squadron] = self.squadron_selector.itemData(index) self.update_max_size(self.squadron_selector.aircraft_available) - # Clear the roster first so we return the pilots to the pool. This way if we end - # up repopulating from the same squadron we'll get the same pilots back. - self.roster_editor.replace(None) + # Clear the roster first so that we return the pilots to the pool. This way if + # we end up repopulating from the same squadron we'll get the same pilots back. + self.roster_editor.replace(None, None) if squadron is not None: self.roster_editor.replace( squadron, FlightRoster(squadron, self.flight_size_spinner.value()) diff --git a/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py b/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py index 5e41a54c..e14687d4 100644 --- a/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py +++ b/qt_ui/windows/mission/flight/settings/QFlightSlotEditor.py @@ -84,7 +84,9 @@ class PilotSelector(QComboBox): self.roster.set_pilot(self.pilot_index, pilot) self.available_pilots_changed.emit() - def replace(self, squadron: Squadron, new_roster: Optional[FlightRoster]) -> None: + def replace( + self, squadron: Squadron | None, new_roster: Optional[FlightRoster] + ) -> None: self.squadron = squadron self.roster = new_roster self.rebuild() @@ -199,7 +201,9 @@ class FlightRosterEditor(QVBoxLayout): for controls in self.pilot_controls[new_size:]: controls.disable_and_clear() - def replace(self, squadron: Squadron, new_roster: Optional[FlightRoster]) -> None: + def replace( + self, squadron: Squadron | None, new_roster: Optional[FlightRoster] + ) -> None: if self.roster is not None: self.roster.clear() self.roster = new_roster