Skip to content

Commit c6f75d7

Browse files
deruyter92C-Achard
authored andcommitted
warn: confirm before stopping inference while recording
Stopping the DLC processor during a recording skips the processor's `on_recording_stopped` hook, which would normally handle legacy output copies and DB-compatible file alignment. Show a confirmation dialog when the user attempts to stop inference while recording is still active, recommending they stop recording first.
1 parent e0a71be commit c6f75d7

1 file changed

Lines changed: 12 additions & 0 deletions

File tree

‎dlclivegui/gui/main_window.py‎

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2468,6 +2468,18 @@ def _start_inference(self) -> None:
24682468
self._update_dlc_controls_enabled()
24692469

24702470
def _stop_inference(self, show_message: bool = True) -> None:
2471+
if self._rec_manager.is_active:
2472+
answer = QMessageBox.question(
2473+
self,
2474+
"Stop inference while recording?",
2475+
"This will stop any currently running DLC-processor. \n"
2476+
"File saving will not be handled via standard stop-recording hook."
2477+
"The processor might still save it's own data now, but this will not be paired with the recording.\n\n"
2478+
"Stop inference anyway?",
2479+
)
2480+
if answer != QMessageBox.Yes:
2481+
return
2482+
24712483
was_active = self._dlc_active
24722484
self._dlc_active = False
24732485
self._dlc_initialized = False

0 commit comments

Comments
 (0)