Fix ISDCF name reference in test.
[dcpomatic.git] / src / tools / dcpomatic.cc
index a670af7dbb7b87396aaca76f9b69e32b3409524d..56c1db7b106da239a88cccefe7e1c3df759bb5c6 100644 (file)
@@ -102,7 +102,6 @@ DCPOMATIC_ENABLE_WARNINGS
 #include <shellapi.h>
 #endif
 #include <boost/filesystem.hpp>
-#include <boost/noncopyable.hpp>
 #include <boost/algorithm/string.hpp>
 #include <iostream>
 #include <fstream>
@@ -135,7 +134,7 @@ using namespace boost::placeholders;
 #endif
 using dcp::raw_convert;
 
-class FilmChangedClosingDialog : public boost::noncopyable
+class FilmChangedClosingDialog
 {
 public:
        explicit FilmChangedClosingDialog (string name)
@@ -159,6 +158,9 @@ public:
                _dialog->Destroy ();
        }
 
+       FilmChangedClosingDialog (FilmChangedClosingDialog const&) = delete;
+       FilmChangedClosingDialog& operator= (FilmChangedClosingDialog const&) = delete;
+
        int run ()
        {
                return _dialog->ShowModal ();
@@ -168,7 +170,8 @@ private:
        wxMessageDialog* _dialog;
 };
 
-class FilmChangedDuplicatingDialog : public boost::noncopyable
+
+class FilmChangedDuplicatingDialog
 {
 public:
        explicit FilmChangedDuplicatingDialog (string name)
@@ -192,6 +195,9 @@ public:
                _dialog->Destroy ();
        }
 
+       FilmChangedDuplicatingDialog (FilmChangedDuplicatingDialog const&) = delete;
+       FilmChangedDuplicatingDialog& operator= (FilmChangedDuplicatingDialog const&) = delete;
+
        int run ()
        {
                return _dialog->ShowModal ();
@@ -225,6 +231,7 @@ enum {
        ID_file_close = 100,
        ID_edit_copy,
        ID_edit_paste,
+       ID_edit_select_all,
        ID_jobs_make_dcp,
        ID_jobs_make_dcp_batch,
        ID_jobs_make_kdms,
@@ -318,6 +325,7 @@ public:
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::file_exit, this),               wxID_EXIT);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_copy, this),               ID_edit_copy);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_paste, this),              ID_edit_paste);
+               Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_select_all, this),         ID_edit_select_all);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::edit_preferences, this),        wxID_PREFERENCES);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_make_dcp, this),           ID_jobs_make_dcp);
                Bind (wxEVT_MENU, boost::bind (&DOMFrame::jobs_make_kdms, this),          ID_jobs_make_kdms);
@@ -711,6 +719,11 @@ private:
                d->Destroy ();
        }
 
+       void edit_select_all ()
+       {
+               _film_editor->content_panel()->select_all();
+       }
+
        void edit_preferences ()
        {
                if (!_config_dialog) {
@@ -1320,17 +1333,20 @@ private:
                add_item (_file_menu, _("&Quit"), wxID_EXIT, ALWAYS);
 #endif
 
-               wxMenu* edit = new wxMenu;
+               auto edit = new wxMenu;
                add_item (edit, _("Copy settings\tCtrl-C"), ID_edit_copy, NEEDS_FILM | NOT_DURING_DCP_CREATION | NEEDS_SINGLE_SELECTED_CONTENT);
                add_item (edit, _("Paste settings...\tCtrl-V"), ID_edit_paste, NEEDS_FILM | NOT_DURING_DCP_CREATION | NEEDS_SELECTED_CONTENT | NEEDS_CLIPBOARD);
+               edit->AppendSeparator ();
+               add_item (edit, _("Select all\tShift-Ctrl-A"), ID_edit_select_all, NEEDS_FILM);
 
 #ifdef __WXOSX__
                add_item (_file_menu, _("&Preferences...\tCtrl-P"), wxID_PREFERENCES, ALWAYS);
 #else
+               edit->AppendSeparator ();
                add_item (edit, _("&Preferences...\tCtrl-P"), wxID_PREFERENCES, ALWAYS);
 #endif
 
-               wxMenu* jobs_menu = new wxMenu;
+               auto jobs_menu = new wxMenu;
                add_item (jobs_menu, _("&Make DCP\tCtrl-M"), ID_jobs_make_dcp, NEEDS_FILM | NOT_DURING_DCP_CREATION);
                add_item (jobs_menu, _("Make DCP in &batch converter\tCtrl-B"), ID_jobs_make_dcp_batch, NEEDS_FILM | NOT_DURING_DCP_CREATION);
                jobs_menu->AppendSeparator ();
@@ -1353,11 +1369,11 @@ private:
 
                add_item (jobs_menu, _("Open DCP in &player"), ID_jobs_open_dcp_in_player, NEEDS_FILM | NOT_DURING_DCP_CREATION | NEEDS_CPL);
 
-               wxMenu* view = new wxMenu;
+               auto view = new wxMenu;
                add_item (view, _("Closed captions..."), ID_view_closed_captions, NEEDS_FILM);
                add_item (view, _("Video waveform..."), ID_view_video_waveform, NEEDS_FILM);
 
-               wxMenu* tools = new wxMenu;
+               auto tools = new wxMenu;
                add_item (tools, _("Hints..."), ID_tools_hints, NEEDS_FILM);
                add_item (tools, _("Encoding servers..."), ID_tools_encoding_servers, 0);
                add_item (tools, _("Manage templates..."), ID_tools_manage_templates, 0);
@@ -1462,11 +1478,11 @@ private:
                        return;
                }
 
-               if (uc->state() == UpdateChecker::YES) {
+               if (uc->state() == UpdateChecker::State::YES) {
                        auto dialog = new UpdateDialog (this, uc->stable(), uc->test());
                        dialog->ShowModal ();
                        dialog->Destroy ();
-               } else if (uc->state() == UpdateChecker::FAILED) {
+               } else if (uc->state() == UpdateChecker::State::FAILED) {
                        error_dialog (this, _("The DCP-o-matic download server could not be contacted."));
                } else {
                        error_dialog (this, _("There are no new versions of DCP-o-matic available."));
@@ -1710,17 +1726,27 @@ private:
                        throw;
                } catch (FileError& e) {
                        error_dialog (
-                               0,
-                               wxString::Format (
+                               nullptr,
+                               wxString::Format(
                                        _("An exception occurred: %s (%s)\n\n") + REPORT_PROBLEM,
                                        std_to_wx (e.what()),
-                                       std_to_wx (e.file().string().c_str ())
+                                       std_to_wx (e.file().string().c_str())
+                                       )
+                               );
+               } catch (boost::filesystem::filesystem_error& e) {
+                       error_dialog (
+                               nullptr,
+                               wxString::Format(
+                                       _("An exception occurred: %s (%s) (%s)\n\n") + REPORT_PROBLEM,
+                                       std_to_wx (e.what()),
+                                       std_to_wx (e.path1().string()),
+                                       std_to_wx (e.path2().string())
                                        )
                                );
                } catch (exception& e) {
                        error_dialog (
                                nullptr,
-                               wxString::Format (
+                               wxString::Format(
                                        _("An exception occurred: %s.\n\n") + REPORT_PROBLEM,
                                        std_to_wx (e.what ())
                                        )
@@ -1768,14 +1794,12 @@ private:
 
        void config_failed_to_load ()
        {
-               close_splash ();
                message_dialog (_frame, _("The existing configuration failed to load.  Default values will be used instead.  These may take a short time to create."));
        }
 
        void config_warning (string m)
        {
-               close_splash ();
-               message_dialog (_frame, std_to_wx (m));
+               message_dialog (_frame, std_to_wx(m));
        }
 
        bool config_bad (Config::BadReason reason)