summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2018-04-20 00:41:46 +0100
committerCarl Hetherington <cth@carlh.net>2018-04-20 00:41:46 +0100
commit899b2ac12ad214f085efccd082d059f6f2ad6531 (patch)
treefc226808c80c44f5849389d1ccd9d251ca39d720
parentcd810b7658b0f4910c093ac191c2b4ba06ba0677 (diff)
Report errors from other parts of the VerifyDCPJob.
-rw-r--r--src/tools/dcpomatic_player.cc2
-rw-r--r--src/wx/verify_dcp_dialog.cc15
-rw-r--r--src/wx/verify_dcp_dialog.h3
3 files changed, 15 insertions, 5 deletions
diff --git a/src/tools/dcpomatic_player.cc b/src/tools/dcpomatic_player.cc
index 9b45affd2..bd1b982e0 100644
--- a/src/tools/dcpomatic_player.cc
+++ b/src/tools/dcpomatic_player.cc
@@ -465,7 +465,7 @@ private:
shared_ptr<VerifyDCPJob> last = dynamic_pointer_cast<VerifyDCPJob> (jm->get().back());
DCPOMATIC_ASSERT (last);
- VerifyDCPDialog* d = new VerifyDCPDialog (this, last->notes ());
+ VerifyDCPDialog* d = new VerifyDCPDialog (this, last);
d->ShowModal ();
d->Destroy ();
}
diff --git a/src/wx/verify_dcp_dialog.cc b/src/wx/verify_dcp_dialog.cc
index aff4a92f0..634bee96e 100644
--- a/src/wx/verify_dcp_dialog.cc
+++ b/src/wx/verify_dcp_dialog.cc
@@ -20,13 +20,15 @@
#include "verify_dcp_dialog.h"
#include "wx_util.h"
+#include "lib/verify_dcp_job.h"
#include <dcp/verify.h>
#include <wx/richtext/richtextctrl.h>
#include <boost/foreach.hpp>
using std::list;
+using boost::shared_ptr;
-VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, list<dcp::VerificationNote> notes)
+VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, shared_ptr<VerifyDCPJob> job)
: wxDialog (parent, wxID_ANY, _("DCP verification"))
{
wxBoxSizer* sizer = new wxBoxSizer (wxVERTICAL);
@@ -44,14 +46,21 @@ VerifyDCPDialog::VerifyDCPDialog (wxWindow* parent, list<dcp::VerificationNote>
_text->GetCaret()->Hide ();
- if (notes.empty ()) {
+ if (job->finished_ok() && job->notes().empty()) {
_text->BeginStandardBullet (N_("standard/circle"), 1, 50);
_text->WriteText (_("DCP validates OK."));
_text->EndStandardBullet ();
return;
}
- BOOST_FOREACH (dcp::VerificationNote i, notes) {
+ /* We might have an error that did not come from dcp::verify; report it if so */
+ if (job->finished_in_error() && job->error_summary() != "") {
+ _text->BeginSymbolBullet (N_("!"), 1, 50);
+ _text->WriteText(std_to_wx(job->error_summary()));
+ _text->Newline();
+ }
+
+ BOOST_FOREACH (dcp::VerificationNote i, job->notes()) {
switch (i.type()) {
case dcp::VerificationNote::VERIFY_NOTE:
_text->BeginStandardBullet (N_("standard/circle"), 1, 50);
diff --git a/src/wx/verify_dcp_dialog.h b/src/wx/verify_dcp_dialog.h
index 1ecaf2d73..d2f21863d 100644
--- a/src/wx/verify_dcp_dialog.h
+++ b/src/wx/verify_dcp_dialog.h
@@ -23,11 +23,12 @@
#include <list>
class wxRichTextCtrl;
+class VerifyDCPJob;
class VerifyDCPDialog : public wxDialog
{
public:
- VerifyDCPDialog (wxWindow* parent, std::list<dcp::VerificationNote> notes);
+ VerifyDCPDialog (wxWindow* parent, boost::shared_ptr<VerifyDCPJob> job);
private:
wxRichTextCtrl* _text;