diff options
| -rw-r--r-- | TO_PORT | 3 | ||||
| -rw-r--r-- | src/wx/dcp_panel.cc | 51 | ||||
| -rw-r--r-- | src/wx/dcp_panel.h | 2 |
3 files changed, 28 insertions, 28 deletions
@@ -1,6 +1,3 @@ -46db828eab42862bf950b4690d9ad191faf9393e -6921fc71f40fcebe76dad45ffc6204f2e3313e17 -f9e5452c8e07e7c6eed91141532db7c341414d07 a3d9e62ff8e1068312a52460ca193abf87f6a6ad e0b8987596d7b5bb032900305e8ef522e795e8d8 4806d9f4864e2cb7f41b2cc430bbaa869248cf35 diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index d05171e41..0c7cb668d 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -65,9 +65,16 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> f) _use_isdcf_name = new wxCheckBox (_panel, wxID_ANY, _("Use ISDCF name")); grid->Add (_use_isdcf_name, wxGBPosition (r, 0), wxDefaultSpan, flags); - _edit_isdcf_button = new wxButton (_panel, wxID_ANY, _("Details...")); - grid->Add (_edit_isdcf_button, wxGBPosition (r, 1)); - ++r; + + { + wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); + _edit_isdcf_button = new wxButton (_dcp_panel, wxID_ANY, _("Details...")); + s->Add (_edit_isdcf_button, 1, wxEXPAND | wxRIGHT, DCPOMATIC_SIZER_X_GAP); + _copy_isdcf_name_button = new wxButton (_dcp_panel, wxID_ANY, _("Copy as name")); + s->Add (_copy_isdcf_name_button, 1, wxEXPAND | wxLEFT, DCPOMATIC_SIZER_X_GAP); + grid->Add (s, wxGBPosition (r, 1), wxDefaultSpan, wxEXPAND); + ++r; + } add_label_to_grid_bag_sizer (grid, _panel, _("DCP Name"), true, wxGBPosition (r, 0)); _dcp_name = new wxStaticText (_panel, wxID_ANY, wxT (""), wxDefaultPosition, wxDefaultSize, wxST_ELLIPSIZE_END); @@ -98,13 +105,14 @@ DCPPanel::DCPPanel (wxNotebook* n, boost::shared_ptr<Film> f) grid->Add (_standard, wxGBPosition (r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL); ++r; - _name->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::name_changed, this)); - _use_isdcf_name->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::use_isdcf_name_toggled, this)); - _edit_isdcf_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this)); - _dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::dcp_content_type_changed, this)); - _signed->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::signed_toggled, this)); - _encrypted->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::encrypted_toggled, this)); - _standard->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::standard_changed, this)); + _name->Bind (wxEVT_COMMAND_TEXT_UPDATED, boost::bind (&DCPPanel::name_changed, this)); + _use_isdcf_name->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::use_isdcf_name_toggled, this)); + _edit_isdcf_button->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::edit_isdcf_button_clicked, this)); + _copy_isdcf_name_button->Bind(wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DCPPanel::copy_isdcf_name_button_clicked, this)); + _dcp_content_type->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::dcp_content_type_changed, this)); + _signed->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::signed_toggled, this)); + _encrypted->Bind (wxEVT_COMMAND_CHECKBOX_CLICKED, boost::bind (&DCPPanel::encrypted_toggled, this)); + _standard->Bind (wxEVT_COMMAND_CHOICE_SELECTED, boost::bind (&DCPPanel::standard_changed, this)); vector<DCPContentType const *> const ct = DCPContentType::all (); for (vector<DCPContentType const *>::const_iterator i = ct.begin(); i != ct.end(); ++i) { @@ -269,21 +277,7 @@ DCPPanel::film_changed (int p) { checked_set (_use_isdcf_name, _film->use_isdcf_name ()); setup_dcp_name (); - bool const i = _film->use_isdcf_name (); - if (i) { - /* We just chose to use the ISDCF name. The user has probably unticked and re-ticked the box, - so it's fairly likey that the film's name will now be a full ISDCF one. Based on this guess, - remove anything after the first _ in the film's name here. - */ - string const n = _film->name (); - if (n.find ("_") != string::npos) { - _film->set_name (n.substr (0, n.find ("_"))); - } - } else { - /* Otherwise set the name to the full ISDCF name */ - _film->set_name (_film->isdcf_name (true)); - } - _edit_isdcf_button->Enable (i); + _edit_isdcf_button->Enable (_film->use_isdcf_name ()); break; } case Film::ISDCF_METADATA: @@ -641,3 +635,10 @@ DCPPanel::make_audio_panel () return panel; } + +void +DCPPanel::copy_isdcf_name_button_clicked () +{ + _film->set_name (_film->isdcf_name (false)); + _film->set_use_isdcf_name (false); +} diff --git a/src/wx/dcp_panel.h b/src/wx/dcp_panel.h index 88a9c4c51..ced6e6efd 100644 --- a/src/wx/dcp_panel.h +++ b/src/wx/dcp_panel.h @@ -51,6 +51,7 @@ private: void name_changed (); void use_isdcf_name_toggled (); void edit_isdcf_button_clicked (); + void copy_isdcf_name_button_clicked (); void container_changed (); void dcp_content_type_changed (); void scaler_changed (); @@ -86,6 +87,7 @@ private: wxCheckBox* _use_isdcf_name; wxChoice* _container; wxButton* _edit_isdcf_button; + wxButton* _copy_isdcf_name_button; wxChoice* _scaler; wxSpinCtrl* _j2k_bandwidth; wxChoice* _dcp_content_type; |
