And another missed warnings.h
[dcpomatic.git] / src / tools / dcpomatic_disk.cc
index f495ecc4188b8bb9b2aef37548da8ace017ed38a..e4cc6c264e65df68d1e4d5c33934c853af075f83 100644 (file)
 #include "lib/signal_manager.h"
 #include "lib/util.h"
 #include "lib/version.h"
-#include "lib/warnings.h"
+#include <dcp/warnings.h>
 #include <wx/cmdline.h>
 #include <wx/wx.h>
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
 #include <boost/process.hpp>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 #ifdef DCPOMATIC_WINDOWS
 #include <boost/process/windows.hpp>
 #endif
@@ -139,7 +139,7 @@ public:
                /* XXX: this is a hack, but I expect we'll need logs and I'm not sure if there's
                 * a better place to put them.
                 */
-               dcpomatic_log.reset(new FileLog(config_path() / "disk.log"));
+               dcpomatic_log = make_shared<FileLog>(State::write_path("disk.log"));
                dcpomatic_log->set_types (dcpomatic_log->types() | LogEntry::TYPE_DISK);
                LOG_DISK("dcpomatic_disk %1 started", dcpomatic_git_commit);
 
@@ -182,6 +182,11 @@ public:
 
        void set_dcp (boost::filesystem::path dcp)
        {
+               if (!boost::filesystem::exists(dcp / "ASSETMAP") && !boost::filesystem::exists(dcp / "ASSETMAP.xml")) {
+                       error_dialog (nullptr, _("No ASSETMAP or ASSETMAP.xml found in this folder.  Please choose a DCP folder."));
+                       return;
+               }
+
                _dcp_path = dcp;
                _dcp_name->SetLabel (std_to_wx(dcp.filename().string()));
        }
@@ -413,7 +418,7 @@ public:
                : _frame (nullptr)
        {}
 
-       bool OnInit ()
+       bool OnInit () override
        {
                try {
                        Config::FailedToLoad.connect (boost::bind (&App::config_failed_to_load, this));
@@ -484,13 +489,13 @@ public:
                return true;
        }
 
-       void OnInitCmdLine (wxCmdLineParser& parser)
+       void OnInitCmdLine (wxCmdLineParser& parser) override
        {
                parser.SetDesc (command_line_description);
                parser.SetSwitchChars (wxT ("-"));
        }
 
-       bool OnCmdLineParsed (wxCmdLineParser& parser)
+       bool OnCmdLineParsed (wxCmdLineParser& parser) override
        {
                _skip_alpha_check = parser.Found(wxT("sure"));
 
@@ -544,14 +549,14 @@ public:
                }
        }
 
-       bool OnExceptionInMainLoop ()
+       bool OnExceptionInMainLoop () override
        {
                report_exception ();
                /* This will terminate the program */
                return false;
        }
 
-       void OnUnhandledException ()
+       void OnUnhandledException () override
        {
                report_exception ();
        }