From b43fa17ece8aacb7cbe85d62f055a50a6858ce0d Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Sat, 6 Feb 2021 20:41:48 +0100 Subject: [PATCH] Include creator/issuer in default name of exported KDM decryption key (#1888). --- src/wx/config_dialog.cc | 15 +++++++++++++-- 1 file changed, 13 insertions(+), 2 deletions(-) diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index d9563f1b6..576e979e9 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -838,8 +838,19 @@ KeysPage::nag_alter_decryption_chain () void KeysPage::export_decryption_certificate () { - wxFileDialog* d = new wxFileDialog ( - _panel, _("Select Certificate File"), wxEmptyString, _("dcpomatic_kdm_decryption_cert.pem"), wxT ("PEM files (*.pem)|*.pem"), + auto config = Config::instance(); + wxString default_name = "dcpomatic"; + if (!config->dcp_creator().empty()) { + default_name += "_" + std_to_wx(careful_string_filter(config->dcp_creator())); + } + if (!config->dcp_issuer().empty()) { + default_name += "_" + std_to_wx(careful_string_filter(config->dcp_issuer())); + } + /// TRANSLATORS: this is the suffix of the defautl filename used when exporting KDM decryption leaf certificates + default_name += _("_kdm_decryption_cert.pem"); + + auto d = new wxFileDialog ( + _panel, _("Select Certificate File"), wxEmptyString, default_name, wxT("PEM files (*.pem)|*.pem"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); -- 2.30.2