Check content for changes on loading a project.
[dcpomatic.git] / src / tools / dcpomatic.cc
index a97e12b6952f51f2dc00a28518ce678b5cc3c4b5..0af65bd2611cafa0bedee24e6241563a2db6f5b4 100644 (file)
@@ -71,6 +71,7 @@
 #include "lib/transcode_job.h"
 #include "lib/dkdm_wrapper.h"
 #include "lib/audio_content.h"
+#include "lib/check_content_change_job.h"
 #include "lib/text_content.h"
 #include <dcp/exceptions.h>
 #include <dcp/raw_convert.h>
@@ -414,6 +415,8 @@ public:
                }
 
                set_film (film);
+
+               JobManager::instance()->add(shared_ptr<Job>(new CheckContentChangeJob(film)));
        }
        catch (std::exception& e) {
                wxString p = std_to_wx (file.string ());
@@ -434,7 +437,7 @@ public:
                if (_film->directory()) {
                        Config::instance()->add_to_history (_film->directory().get());
                }
-               _film->Changed.connect (boost::bind (&DOMFrame::set_menu_sensitivity, this));
+               _film->Change.connect (boost::bind (&DOMFrame::film_change, this, _1));
        }
 
        shared_ptr<Film> film () const {
@@ -443,6 +446,13 @@ public:
 
 private:
 
+       void film_change (ChangeType type)
+       {
+               if (type == CHANGE_TYPE_DONE) {
+                       set_menu_sensitivity ();
+               }
+       }
+
        void file_changed (boost::filesystem::path f)
        {
                string s = wx_to_std (_("DCP-o-matic"));
@@ -636,7 +646,7 @@ private:
                        }
                }
 
-               if (!get_hints(_film).empty() && Config::instance()->show_hints_before_make_dcp()) {
+               if (Config::instance()->show_hints_before_make_dcp()) {
                        HintsDialog* hints = new HintsDialog (this, _film, false);
                        int const r = hints->ShowModal();
                        hints->Destroy ();
@@ -735,7 +745,7 @@ private:
                        return;
                }
 
-               if (!get_hints(_film).empty() && Config::instance()->show_hints_before_make_dcp()) {
+               if (Config::instance()->show_hints_before_make_dcp()) {
                        HintsDialog* hints = new HintsDialog (this, _film, false);
                        int const r = hints->ShowModal();
                        hints->Destroy ();