Allow specification of trusted devices by thumbprint rather than
[dcpomatic.git] / src / tools / dcpomatic.cc
index d7862a803221278f864d1efb5ff49fefd0174593..3d74859dc9e139ec9d97e01386386f1f3a562884 100644 (file)
@@ -22,7 +22,7 @@
  *  @brief The main DCP-o-matic GUI.
  */
 
-#include "wx/control_film_viewer.h"
+#include "wx/controls.h"
 #include "wx/film_viewer.h"
 #include "wx/film_editor.h"
 #include "wx/job_manager_view.h"
@@ -55,6 +55,7 @@
 #include "lib/version.h"
 #include "lib/signal_manager.h"
 #include "lib/log.h"
+#include "lib/screen.h"
 #include "lib/job_manager.h"
 #include "lib/exceptions.h"
 #include "lib/cinema.h"
@@ -91,6 +92,7 @@
 #include <boost/filesystem.hpp>
 #include <boost/noncopyable.hpp>
 #include <boost/foreach.hpp>
+#include <boost/algorithm/string.hpp>
 #include <iostream>
 #include <fstream>
 /* This is OK as it's only used with DCPOMATIC_WINDOWS */
@@ -114,6 +116,8 @@ using boost::shared_ptr;
 using boost::dynamic_pointer_cast;
 using boost::optional;
 using boost::function;
+using boost::is_any_of;
+using boost::algorithm::find;
 using dcp::raw_convert;
 
 class FilmChangedClosingDialog : public boost::noncopyable
@@ -476,7 +480,24 @@ private:
                        try {
                                new_film (d->path(), d->template_name());
                        } catch (boost::filesystem::filesystem_error& e) {
-                               error_dialog (this, _("Could not create folder to store film"), std_to_wx(e.what()));
+#ifdef DCPOMATIC_WINDOWS
+                               string bad_chars = "<>:\"/|?*";
+                               string const filename = d->path().string();
+                               string found_bad_chars;
+                               for (size_t i = 0; i < bad_chars.length(); ++i) {
+                                       if (filename.find(bad_chars[i]) != string::npos && found_bad_chars.find(bad_chars[i]) == string::npos) {
+                                               found_bad_chars += bad_chars[i];
+                                       }
+                               }
+                               wxString message = _("Could not create folder to store film.");
+                               if (!found_bad_chars.empty()) {
+                                       message += "  ";
+                                       message += wxString::Format (_("Try removing the %s characters from your folder name."), std_to_wx(found_bad_chars).data());
+                               }
+                               error_dialog (this, message, std_to_wx(e.what()));
+#else
+                               error_dialog (this, _("Could not create folder to store film."), std_to_wx(e.what()));
+#endif
                        }
                }
 
@@ -803,7 +824,7 @@ private:
                try {
                        kdm = _film->make_kdm (
                                Config::instance()->decryption_chain()->leaf(),
-                               vector<dcp::Certificate> (),
+                               vector<string>(),
                                d->cpl (),
                                dcp::LocalTime ("2012-01-01T01:00:00+00:00"),
                                dcp::LocalTime ("2112-01-01T01:00:00+00:00"),
@@ -1301,12 +1322,12 @@ private:
 
        void back_frame ()
        {
-               _film_viewer->move (-_film_viewer->one_video_frame());
+               _film_viewer->seek_by (-_film_viewer->one_video_frame(), true);
        }
 
        void forward_frame ()
        {
-               _film_viewer->move (_film_viewer->one_video_frame());
+               _film_viewer->seek_by (_film_viewer->one_video_frame(), true);
        }
 
        FilmEditor* _film_editor;