Make some waypoint types undraggable.

None of these (takeoff, landing, divert, bullseye, precise target
locations) can be usefully moved, so prevent it.
This commit is contained in:
Dan Albert
2021-05-24 16:45:21 -07:00
parent e8f326ebce
commit b7b3b35816
3 changed files with 46 additions and 3 deletions

View File

@@ -379,7 +379,9 @@ class WaypointJs(QObject):
altitudeReferenceChanged = Signal()
nameChanged = Signal()
timingChanged = Signal()
isTargetPointChanged = Signal()
isTakeoffChanged = Signal()
isLandingChanged = Signal()
isDivertChanged = Signal()
isBullseyeChanged = Signal()
@@ -438,10 +440,18 @@ class WaypointJs(QObject):
return ""
return f"{prefix} T+{timedelta(seconds=int(time.total_seconds()))}"
@Property(bool, notify=isTargetPointChanged)
def isTargetPoint(self) -> bool:
return self.waypoint.waypoint_type is FlightWaypointType.TARGET_POINT
@Property(bool, notify=isTakeoffChanged)
def isTakeoff(self) -> bool:
return self.waypoint.waypoint_type is FlightWaypointType.TAKEOFF
@Property(bool, notify=isLandingChanged)
def isLanding(self) -> bool:
return self.waypoint.waypoint_type is FlightWaypointType.LANDING_POINT
@Property(bool, notify=isDivertChanged)
def isDivert(self) -> bool:
return self.waypoint.waypoint_type is FlightWaypointType.DIVERT