Add save button for playlist name.
[dcpomatic.git] / src / tools / dcpomatic_combiner.cc
index 566ec82f1fe8d90e502c2ceb7e963f98a3bd8d9a..e773e4a37e3bfcaef0dc77df8592e36fb8bd922b 100644 (file)
@@ -28,9 +28,9 @@
 #include "lib/job_manager.h"
 #include "lib/util.h"
 #include <dcp/combine.h>
-DCPOMATIC_DISABLE_WARNINGS
+LIBDCP_DISABLE_WARNINGS
 #include <wx/filepicker.h>
-DCPOMATIC_ENABLE_WARNINGS
+LIBDCP_ENABLE_WARNINGS
 #include <wx/wx.h>
 #include <boost/bind/bind.hpp>
 #include <boost/filesystem.hpp>
@@ -65,7 +65,7 @@ public:
 
        }
 
-       boost::filesystem::path get () const
+       optional<boost::filesystem::path> get () const
        {
                return boost::filesystem::path(wx_to_std(GetPath()));
        }
@@ -100,11 +100,17 @@ public:
                        boost::bind(&DOMFrame::inputs, this),
                        boost::bind(&DOMFrame::set_inputs, this, _1),
                        &display_string,
-                       false,
-                       true
+                       EditableListTitle::VISIBLE,
+                       EditableListButton::NEW | EditableListButton::REMOVE
                        );
 
-               auto output = new wxBoxSizer (wxHORIZONTAL);
+               auto output = new wxFlexGridSizer (2, DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+               output->AddGrowableCol (1, 1);
+
+               add_label_to_sizer (output, overall_panel, _("Annotation text"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
+               _annotation_text = new wxTextCtrl (overall_panel, wxID_ANY, wxT(""));
+               output->Add (_annotation_text, 1, wxEXPAND);
+
                add_label_to_sizer (output, overall_panel, _("Output DCP folder"), true, 0, wxLEFT | wxRIGHT | wxALIGN_CENTRE_VERTICAL);
                _output = new DirPickerCtrl (overall_panel);
                output->Add (_output, 1, wxEXPAND);
@@ -162,7 +168,7 @@ private:
                }
 
                auto jm = JobManager::instance ();
-               jm->add (make_shared<CombineDCPJob>(_inputs, output));
+               jm->add (make_shared<CombineDCPJob>(_inputs, output, wx_to_std(_annotation_text->GetValue())));
                bool const ok = display_progress (_("DCP-o-matic Combine"), _("Combining DCPs"));
                if (!ok) {
                        return;
@@ -189,6 +195,7 @@ private:
        }
 
        EditableList<boost::filesystem::path, DirDialogWrapper>* _input;
+       wxTextCtrl* _annotation_text = nullptr;
        DirPickerCtrl* _output;
        vector<boost::filesystem::path> _inputs;
        Button* _combine;
@@ -203,7 +210,7 @@ public:
        bool OnInit () override
        {
                try {
-                       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));
 
                        SetAppName (_("DCP-o-matic Combiner"));
@@ -257,9 +264,9 @@ public:
                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)