summaryrefslogtreecommitdiff
path: root/src/wx/content_menu.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-05-21 00:05:50 +0200
committerCarl Hetherington <cth@carlh.net>2020-05-21 00:05:50 +0200
commit83416808c0b1ca732e7a186d3811f1ec796fea08 (patch)
treef18fde5c358212f5cb0c2ee12700d5b0081590d8 /src/wx/content_menu.cc
parentdda7d841eac2305379aa86d11249dbb4b98d5bb7 (diff)
Give 'wrong target' KDM errors in a dialogue box rather than in the job manager (part of #1161).
Diffstat (limited to 'src/wx/content_menu.cc')
-rw-r--r--src/wx/content_menu.cc13
1 files changed, 12 insertions, 1 deletions
diff --git a/src/wx/content_menu.cc b/src/wx/content_menu.cc
index ec966b81a..d3115ce49 100644
--- a/src/wx/content_menu.cc
+++ b/src/wx/content_menu.cc
@@ -40,6 +40,7 @@
#include "lib/copy_dcp_details_to_film.h"
#include <dcp/cpl.h>
#include <dcp/exceptions.h>
+#include <dcp/decrypted_kdm.h>
#include <wx/wx.h>
#include <wx/dirdlg.h>
#include <boost/foreach.hpp>
@@ -415,6 +416,17 @@ ContentMenu::kdm ()
return;
}
+ /* Try to decrypt it to get an early preview of any errors */
+ try {
+ decrypt_kdm_with_helpful_error (*kdm);
+ } catch (KDMError& e) {
+ error_dialog (_parent, std_to_wx(e.summary()), std_to_wx(e.detail()));
+ return;
+ } catch (exception& e) {
+ error_dialog (_parent, e.what());
+ return;
+ }
+
DCPExaminer ex (dcp, true);
bool kdm_matches_any_cpl = false;
@@ -424,7 +436,6 @@ ContentMenu::kdm ()
}
}
-
bool kdm_matches_selected_cpl = dcp->cpl() || kdm->cpl_id() == dcp->cpl().get();
if (!kdm_matches_any_cpl) {