diff options
| author | Carl Hetherington <cth@carlh.net> | 2021-02-06 20:41:48 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2021-02-06 20:45:47 +0100 |
| commit | b43fa17ece8aacb7cbe85d62f055a50a6858ce0d (patch) | |
| tree | b88c3a92454975853311843c7ea550de43b70143 | |
| parent | cc9ffe3d2206021acf96d14e714a6fa23f8912f2 (diff) | |
Include creator/issuer in default name of exported KDM decryption key (#1888).
| -rw-r--r-- | src/wx/config_dialog.cc | 15 |
1 files 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 ); |
