Report errors from other parts of the VerifyDCPJob.
authorCarl Hetherington <cth@carlh.net>
Thu, 19 Apr 2018 23:41:46 +0000 (00:41 +0100)
committerCarl Hetherington <cth@carlh.net>
Thu, 19 Apr 2018 23:41:46 +0000 (00:41 +0100)
src/tools/dcpomatic_player.cc
src/wx/verify_dcp_dialog.cc
src/wx/verify_dcp_dialog.h

index 9b45affd2a5c5576be947c29893fded65a541be0..bd1b982e0ed012260780fa0fd1061a314f9ce7de 100644 (file)
@@ -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 ();
        }
index aff4a92f05b55372b15624670faf25df37eab5ac..634bee96ef182854ef10247408874b2f36f9fe06 100644 (file)
 
 #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);
index 1ecaf2d7366a9cc75cc305482a10cd402fe215a4..d2f21863d606eaf389c788c5a1bbb31e1e1b8517 100644 (file)
 #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;