diff options
| author | Carl Hetherington <cth@carlh.net> | 2025-06-13 00:17:18 +0200 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2025-06-13 00:17:20 +0200 |
| commit | 0cc02b1a10a6d6f24e0346af1a6ec18e93dc37fa (patch) | |
| tree | 7690dd897d1b6c1d62df8deb592fba1dbc036b8e | |
| parent | 0f3b06b21a354fb35bbfbbf50cd2a4d09652fadf (diff) | |
Move check for returning to ISDCF name mode.
film_changed() is used on startup to set things up, so it's not a
reliable way to know when the user has clicked the checkbox. Move the
check into the click handler instead. This prevents film names like
Fred_Jim_Sheila being truncated to Fred on loading a project.
| -rw-r--r-- | src/wx/dcp_panel.cc | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/src/wx/dcp_panel.cc b/src/wx/dcp_panel.cc index 7a0613a5f..9d6eafe13 100644 --- a/src/wx/dcp_panel.cc +++ b/src/wx/dcp_panel.cc @@ -407,13 +407,6 @@ DCPPanel::film_changed(FilmProperty p) case FilmProperty::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(); - _film->set_name(name.substr(0, name.find("_"))); - } setup_dcp_name(); break; } @@ -709,9 +702,20 @@ DCPPanel::use_isdcf_name_toggled() return; } - _film->set_use_isdcf_name(_use_isdcf_name->GetValue()); + auto const new_value = _use_isdcf_name->GetValue(); + + _film->set_use_isdcf_name(new_value); + + if (new_value) { + /* 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(); + _film->set_name(name.substr(0, name.find("_"))); + } } + void DCPPanel::setup_dcp_name() { |
