summaryrefslogtreecommitdiff
path: root/src/wx/content_menu.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2022-10-15 01:10:46 +0200
committerCarl Hetherington <cth@carlh.net>2022-10-15 23:24:56 +0200
commit589a866b05ee0d9d27f83d37e10a1025c406951d (patch)
treeda6d3452eec2f2ab3fabf46afac4a127622edeb5 /src/wx/content_menu.cc
parentc080192cf7bd5b92ae4a929fd5dc5ae55ae9c754 (diff)
Make ignore video option respect OK/Cancel.
Diffstat (limited to 'src/wx/content_menu.cc')
-rw-r--r--src/wx/content_menu.cc17
1 files changed, 14 insertions, 3 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index 6c4864239..9ef674fd1 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -43,6 +43,7 @@
#include "lib/image_content.h"
#include "lib/job_manager.h"
#include "lib/playlist.h"
+#include "lib/scope_guard.h"
#include "lib/video_content.h"
#include <dcp/cpl.h>
#include <dcp/decrypted_kdm.h>
@@ -461,9 +462,19 @@ ContentMenu::properties ()
void
ContentMenu::advanced ()
{
- auto d = new ContentAdvancedDialog (_parent, _content.front());
- d->ShowModal ();
- d->Destroy ();
+ DCPOMATIC_ASSERT(!_content.empty());
+
+ auto content = _content.front();
+ auto dialog = new ContentAdvancedDialog(_parent, content);
+ ScopeGuard sg = [dialog]() { dialog->Destroy(); };
+
+ if (dialog->ShowModal() == wxID_CANCEL) {
+ return;
+ }
+
+ if (content->video) {
+ content->video->set_use(!dialog->ignore_video());
+ }
}