diff --git a/changelog.md b/changelog.md index 04a2c94a..4c8fbf3e 100644 --- a/changelog.md +++ b/changelog.md @@ -25,6 +25,7 @@ Saves from 8.x are not compatible with 9.0.0. * **[UI]** Fixed deleting waypoints in custom flight plans deleting the wrong waypoint. * **[UI]** Fixed flight properties UI to support F-15E S4+ laser codes. * **[UI]** In unit transfer dialog, only list control points that are reachable from the control point units are being transferred from. +* **[UI]** Fixed UI bug where altering an "ahead of package" TOT offset would change the offset back to a "behind pacakge" offset. # 8.1.0 diff --git a/qt_ui/windows/mission/flight/settings/FlightPlanPropertiesGroup.py b/qt_ui/windows/mission/flight/settings/FlightPlanPropertiesGroup.py index 720d5eda..96b63a36 100644 --- a/qt_ui/windows/mission/flight/settings/FlightPlanPropertiesGroup.py +++ b/qt_ui/windows/mission/flight/settings/FlightPlanPropertiesGroup.py @@ -51,10 +51,10 @@ class FlightPlanPropertiesGroup(QGroupBox): tot_offset_layout.addWidget(QLabel("TOT Offset (minutes:seconds)")) tot_offset_layout.addStretch() - negative_offset_checkbox = QCheckBox("Ahead of package") - negative_offset_checkbox.setChecked(negative) - negative_offset_checkbox.toggled.connect(self.toggle_negative_offset) - tot_offset_layout.addWidget(negative_offset_checkbox) + self.negative_offset_checkbox = QCheckBox("Ahead of package") + self.negative_offset_checkbox.setChecked(negative) + self.negative_offset_checkbox.toggled.connect(self.toggle_negative_offset) + tot_offset_layout.addWidget(self.negative_offset_checkbox) self.tot_offset_spinner = QTimeEdit(QTime(hours, minutes, seconds)) self.tot_offset_spinner.setMaximumTime(QTime(59, 0)) @@ -113,9 +113,12 @@ class FlightPlanPropertiesGroup(QGroupBox): ) def set_tot_offset(self, offset: QTime) -> None: - self.flight.flight_plan.tot_offset = timedelta( + offset = timedelta( hours=offset.hour(), minutes=offset.minute(), seconds=offset.second() ) + if self.negative_offset_checkbox.isChecked(): + offset = -offset + self.flight.flight_plan.tot_offset = offset self.update_departure_time() def toggle_negative_offset(self) -> None: