mirror of
https://github.com/dcs-retribution/dcs-retribution.git
synced 2025-11-10 15:41:24 +00:00
Fix deletion of waypoints.
`FlightPlan.waypoints` returns a list created from the iterator now, so removing items from that list does not actually alter the flight plan. Fixes https://github.com/Khopa/dcs_liberation/issues/489
This commit is contained in:
parent
b5ff32c5b6
commit
b0b9c1c8e6
@ -69,8 +69,6 @@ class FlightPlan:
|
||||
"""A list of all waypoints in the flight plan, in order."""
|
||||
return list(self.iter_waypoints())
|
||||
|
||||
|
||||
|
||||
def iter_waypoints(self) -> Iterator[FlightWaypoint]:
|
||||
"""Iterates over all waypoints in the flight plan, in order."""
|
||||
raise NotImplementedError
|
||||
|
||||
@ -1,4 +1,3 @@
|
||||
import itertools
|
||||
from datetime import timedelta
|
||||
|
||||
from PySide2.QtCore import QItemSelectionModel, QPoint
|
||||
@ -32,10 +31,6 @@ class QFlightWaypointList(QTableView):
|
||||
self.update_list()
|
||||
|
||||
self.selectionModel().setCurrentIndex(self.indexAt(QPoint(1, 1)), QItemSelectionModel.Select)
|
||||
self.selectionModel().selectionChanged.connect(self.on_waypoint_selected_changed)
|
||||
|
||||
def on_waypoint_selected_changed(self):
|
||||
index = self.selectionModel().currentIndex().row()
|
||||
|
||||
def update_list(self):
|
||||
self.model.clear()
|
||||
|
||||
@ -104,7 +104,8 @@ class QFlightWaypointTab(QFrame):
|
||||
return
|
||||
|
||||
self.degrade_to_custom_flight_plan()
|
||||
self.flight.flight_plan.waypoints.remove(waypoint)
|
||||
assert isinstance(self.flight.flight_plan, CustomFlightPlan)
|
||||
self.flight.flight_plan.custom_waypoints.remove(waypoint)
|
||||
|
||||
def on_fast_waypoint(self):
|
||||
self.subwindow = QPredefinedWaypointSelectionWindow(self.game, self.flight, self.flight_waypoint_list)
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user