Tidy up code to report failures to load config in the UI.
[dcpomatic.git] / src / tools / dcpomatic_batch.cc
index ef8816708bbdd4017ef267c5c490fe00a889a2eb..dcda39fd8042c336a3302f293dcd5c21e69ea5e5 100644 (file)
 #include "lib/transcode_job.h"
 #include "lib/util.h"
 #include "lib/version.h"
+#include <dcp/warnings.h>
+LIBDCP_DISABLE_WARNINGS
 #include <wx/aboutdlg.h>
 #include <wx/cmdline.h>
 #include <wx/preferences.h>
 #include <wx/splash.h>
 #include <wx/stdpaths.h>
 #include <wx/wx.h>
+LIBDCP_ENABLE_WARNINGS
 #include <iostream>
 #include <set>
 
@@ -398,7 +401,7 @@ class App : public wxApp
                SetAppName (_("DCP-o-matic Batch Converter"));
                is_batch_converter = true;
 
-               Config::FailedToLoad.connect (boost::bind(&App::config_failed_to_load, this));
+               Config::FailedToLoad.connect(boost::bind(&App::config_failed_to_load, this, _1));
                Config::Warning.connect (boost::bind(&App::config_warning, this, _1));
 
                auto splash = maybe_show_splash ();
@@ -485,9 +488,9 @@ class App : public wxApp
                return true;
        }
 
-       void config_failed_to_load ()
+       void config_failed_to_load(Config::LoadFailure what)
        {
-               message_dialog (_frame, _("The existing configuration failed to load.  Default values will be used instead.  These may take a short time to create."));
+               report_config_load_failure(_frame, what);
        }
 
        void config_warning (string m)