From 23f6addf359ebc861dbbc84696a406064f75ee1a Mon Sep 17 00:00:00 2001 From: Thomas Goyne Date: Sun, 15 Jun 2014 07:03:51 -0700 Subject: [PATCH] Close the detached video dialog when video is closed --- src/dialog_detached_video.cpp | 4 ++-- src/dialog_detached_video.h | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/src/dialog_detached_video.cpp b/src/dialog_detached_video.cpp index 80995a8ca..173f9e8d9 100644 --- a/src/dialog_detached_video.cpp +++ b/src/dialog_detached_video.cpp @@ -129,8 +129,8 @@ void DialogDetachedVideo::OnKeyDown(wxKeyEvent &evt) { hotkey::check("Video Display", context, evt); } -void DialogDetachedVideo::OnVideoOpen() { - if (context->project->VideoProvider()) +void DialogDetachedVideo::OnVideoOpen(AsyncVideoProvider *new_provider) { + if (new_provider) SetTitle(fmt_tl("Video: %s", context->project->VideoName().filename())); else { Close(); diff --git a/src/dialog_detached_video.h b/src/dialog_detached_video.h index ec8e17fe3..97be3fb59 100644 --- a/src/dialog_detached_video.h +++ b/src/dialog_detached_video.h @@ -38,6 +38,7 @@ #include namespace agi { struct Context; } +class AsyncVideoProvider; class PersistLocation; class VideoBox; class VideoDisplay; @@ -53,7 +54,7 @@ class DialogDetachedVideo final : public wxDialog { /// Minimize event handler to hack around a wx bug void OnMinimize(wxIconizeEvent &evt); void OnKeyDown(wxKeyEvent &evt); - void OnVideoOpen(); + void OnVideoOpen(AsyncVideoProvider *new_provider); public: /// @brief Constructor