X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fconfig_dialog.cc;h=a81e8a65cf46b5cea0361dc94e5730f8a8166651;hb=8963f0007af1a312017b9627c18b82ec2a577591;hp=de2c11517f10eed31bf2585c63bd75cf45f33e2a;hpb=f38d5af6d01bed04445f00f2a7b508e9f931d2ee;p=dcpomatic.git diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index de2c11517..a81e8a65c 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -36,7 +36,7 @@ using std::make_shared; using boost::bind; using boost::optional; using std::shared_ptr; -using boost::function; +using std::function; #if BOOST_VERSION >= 106100 using namespace boost::placeholders; #endif @@ -695,7 +695,7 @@ KeysPage::setup () auto buttons = new wxBoxSizer (wxVERTICAL); - wxButton* export_decryption_certificate = new Button (_panel, _("Export KDM decryption certificate...")); + auto export_decryption_certificate = new Button (_panel, _("Export KDM decryption leaf certificate...")); buttons->Add (export_decryption_certificate, 0, wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP); auto export_settings = new Button (_panel, _("Export all KDM decryption settings...")); buttons->Add (export_settings, 0, wxBOTTOM, DCPOMATIC_BUTTON_STACK_GAP); @@ -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 );