Ensure replay loop is cancelled before window is hidden

* See also f56a989e4f - we don't want to make the replay loop always on
  top though
This commit is contained in:
baldurk
2025-02-21 14:38:54 +00:00
parent 31d29fcea1
commit 46f83c15a4
3 changed files with 33 additions and 2 deletions
+8 -1
View File
@@ -2588,7 +2588,7 @@ void MainWindow::on_action_Start_Replay_Loop_triggered()
if(!m_Ctx.IsCaptureLoaded())
return;
QDialog popup;
RDDialog popup;
popup.setWindowFlags(popup.windowFlags() & ~Qt::WindowContextHelpButtonHint);
popup.setWindowIcon(windowIcon());
@@ -2651,6 +2651,13 @@ void MainWindow::on_action_Start_Replay_Loop_triggered()
m_Ctx.Replay().AsyncInvoke([winData, id](IReplayController *r) { r->ReplayLoop(winData, id); });
QObject::connect(&popup, &RDDialog::aboutToClose,
[this](QCloseEvent *) { m_Ctx.Replay().CancelReplayLoop(); });
QObject::connect(&popup, &RDDialog::keyPress, [this](QKeyEvent *e) {
if(e->matches(QKeySequence::Cancel))
m_Ctx.Replay().CancelReplayLoop();
});
RDDialog::show(&popup);
m_Ctx.Replay().CancelReplayLoop();