Copy current ISDCF name into the film name when 'Use ISDCF name' is un-ticked.
authorCarl Hetherington <cth@carlh.net>
Wed, 10 Sep 2014 22:40:05 +0000 (23:40 +0100)
committerCarl Hetherington <cth@carlh.net>
Wed, 10 Sep 2014 22:40:05 +0000 (23:40 +0100)
ChangeLog
src/wx/film_editor.cc
src/wx/film_editor.h

index a529f6a810154307fe5ff0f342704b355c2bcdb0..32099c35854b7a25b935d833f097dbb3ec63c318 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2014-09-10  Carl Hetherington  <cth@carlh.net>
 
+       * Allow DCP names to be created using the ISDCF template and then
+       edited afterwards (#401).
+
        * Fix hidden advanced preferences button in some locales.
 
 2014-09-08  Carl Hetherington  <cth@carlh.net>
index f569e0422a14a0dbcc134cc69bac3bdf9643181f..e73b272674ff802399817fd6dd7e803b68e53b53 100644 (file)
@@ -115,11 +115,6 @@ FilmEditor::make_dcp_panel ()
        grid->Add (_name, wxGBPosition(r, 1), wxDefaultSpan, wxEXPAND | wxLEFT | wxRIGHT);
        ++r;
        
-       add_label_to_grid_bag_sizer (grid, _dcp_panel, _("DCP Name"), true, wxGBPosition (r, 0));
-       _dcp_name = new wxStaticText (_dcp_panel, wxID_ANY, wxT (""));
-       grid->Add (_dcp_name, wxGBPosition(r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
-       ++r;
-
        int flags = wxALIGN_CENTER_VERTICAL;
 #ifdef __WXOSX__
        flags |= wxALIGN_RIGHT;
@@ -131,6 +126,11 @@ FilmEditor::make_dcp_panel ()
        grid->Add (_edit_isdcf_button, wxGBPosition (r, 1), wxDefaultSpan);
        ++r;
 
+       add_label_to_grid_bag_sizer (grid, _dcp_panel, _("DCP Name"), true, wxGBPosition (r, 0));
+       _dcp_name = new wxStaticText (_dcp_panel, wxID_ANY, wxT (""));
+       grid->Add (_dcp_name, wxGBPosition(r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL);
+       ++r;
+
        add_label_to_grid_bag_sizer (grid, _dcp_panel, _("Container"), true, wxGBPosition (r, 0));
        _container = new wxChoice (_dcp_panel, wxID_ANY);
        grid->Add (_container, wxGBPosition (r, 1), wxDefaultSpan, wxEXPAND);
@@ -474,6 +474,7 @@ FilmEditor::film_changed (Film::Property p)
        case Film::USE_ISDCF_NAME:
                checked_set (_use_isdcf_name, _film->use_isdcf_name ());
                setup_dcp_name ();
+               use_isdcf_name_changed ();
                break;
        case Film::ISDCF_METADATA:
                setup_dcp_name ();
@@ -707,6 +708,18 @@ FilmEditor::use_isdcf_name_toggled ()
        _film->set_use_isdcf_name (_use_isdcf_name->GetValue ());
 }
 
+void
+FilmEditor::use_isdcf_name_changed ()
+{
+       bool const i = _film->use_isdcf_name ();
+
+       if (!i) {
+               _film->set_name (_film->isdcf_name (true));
+       }
+
+       _edit_isdcf_button->Enable (i);
+}
+
 void
 FilmEditor::edit_isdcf_button_clicked ()
 {
index 1854df05eae850bc2f6e5570963bd77effa8bb82..56e725113e402821b4f646859caa09c5946f2e7a 100644 (file)
@@ -32,6 +32,7 @@
 class wxNotebook;
 class wxListCtrl;
 class wxListEvent;
+class wxGridBagSizer;
 class Film;
 class TimelineDialog;
 class Ratio;
@@ -104,6 +105,7 @@ private:
        /* Handle changes to the model */
        void film_changed (Film::Property);
        void film_content_changed (int);
+       void use_isdcf_name_changed ();
 
        void set_general_sensitivity (bool);
        void setup_dcp_name ();