Slightly better errors when the player fails to load a DCP.
authorCarl Hetherington <cth@carlh.net>
Tue, 27 Aug 2019 21:34:37 +0000 (22:34 +0100)
committerCarl Hetherington <cth@carlh.net>
Tue, 27 Aug 2019 21:34:37 +0000 (22:34 +0100)
src/tools/dcpomatic_player.cc
src/wx/wx_util.cc

index 90cc818..cdacee7 100644 (file)
@@ -464,6 +464,21 @@ public:
 
 private:
 
+       bool report_errors_from_last_job (wxWindow* parent) const
+       {
+               JobManager* jm = JobManager::instance ();
+
+               DCPOMATIC_ASSERT (!jm->get().empty());
+
+               shared_ptr<Job> last = jm->get().back();
+               if (last->finished_in_error()) {
+                       error_dialog(parent, wxString::Format(_("Could not load DCP.\n\n%s."), std_to_wx(last->error_summary()).data()), std_to_wx(last->error_details()));
+                       return false;
+               }
+
+               return true;
+       }
+
        void setup_menu (wxMenuBar* m)
        {
                _file_menu = new wxMenu;
index d2f463b..045712b 100644 (file)
@@ -530,19 +530,3 @@ display_progress (wxString title, wxString task)
 
        return ok;
 }
-
-bool
-report_errors_from_last_job (wxWindow* parent)
-{
-       JobManager* jm = JobManager::instance ();
-
-       DCPOMATIC_ASSERT (!jm->get().empty());
-
-       shared_ptr<Job> last = jm->get().back();
-       if (last->finished_in_error()) {
-               error_dialog(parent, std_to_wx(last->error_summary()) + ".\n", std_to_wx(last->error_details()));
-               return false;
-       }
-
-       return true;
-}