From 7a01980e54074dcfe3d8c55c396eabd6f0d48497 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Thu, 25 Jul 2019 16:31:58 +0100 Subject: [PATCH] Trim after _ in current name when enabling 'Use ISDCF name' (#1513). --- src/wx/dcp_panel.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index b938ed87d..a7f4f45e9 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -455,6 +455,16 @@ DCPPanel::film_changed (int p) case Film::USE_ISDCF_NAME: { checked_set (_use_isdcf_name, _film->use_isdcf_name ()); + if (_film->use_isdcf_name()) { + /* We are going back to using an ISDCF name. Remove anything after a _ in the current name, + in case the user has clicked 'Copy as name' then re-ticked 'Use ISDCF name' (#1513). + */ + string const name = _film->name (); + string::size_type const u = name.find("_"); + if (u != string::npos) { + _film->set_name (name.substr(0, u)); + } + } setup_dcp_name (); _edit_isdcf_button->Enable (_film->use_isdcf_name ()); break; -- 2.30.2