mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix missing argument exception
This commit is contained in:
parent
227134d9c1
commit
226a171550
@ -143,7 +143,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,7 +230,7 @@ class QFlightCreator(QDialog):
|
||||
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)
|
||||
self.roster_editor.replace(None, None)
|
||||
if squadron is not None:
|
||||
self.roster_editor.replace(
|
||||
squadron, FlightRoster(squadron, self.flight_size_spinner.value())
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
import logging
|
||||
from typing import Optional, Callable, Union
|
||||
from typing import Optional, Callable
|
||||
|
||||
from PySide2.QtCore import Signal, QModelIndex
|
||||
from PySide2.QtWidgets import (
|
||||
@ -26,7 +26,7 @@ class PilotSelector(QComboBox):
|
||||
available_pilots_changed = Signal()
|
||||
|
||||
def __init__(
|
||||
self, squadron: Union[Squadron, None], roster: Optional[IFlightRoster], idx: int
|
||||
self, squadron: Optional[Squadron], roster: Optional[IFlightRoster], idx: int
|
||||
) -> None:
|
||||
super().__init__()
|
||||
self.squadron = squadron
|
||||
@ -84,7 +84,7 @@ 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: Optional[Squadron], new_roster: Optional[FlightRoster]) -> None:
|
||||
self.squadron = squadron
|
||||
self.roster = new_roster
|
||||
self.rebuild()
|
||||
@ -159,7 +159,7 @@ class PilotControls(QHBoxLayout):
|
||||
finally:
|
||||
self.player_checkbox.blockSignals(False)
|
||||
|
||||
def replace(self, squadron: Squadron, new_roster: Optional[FlightRoster]) -> None:
|
||||
def replace(self, squadron: Optional[Squadron], new_roster: Optional[FlightRoster]) -> None:
|
||||
self.roster = new_roster
|
||||
if self.roster is None or self.pilot_index >= self.roster.max_size:
|
||||
self.disable_and_clear()
|
||||
@ -209,7 +209,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: Optional[Squadron], new_roster: Optional[FlightRoster]
|
||||
) -> None:
|
||||
if self.roster is not None:
|
||||
self.roster.clear()
|
||||
self.roster = new_roster
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user