X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fconfig_dialog.cc;h=53c67d101d8e611dca2c101fbafe576d7c696686;hb=73ece0c95ddd5c0d7fd37931ccdc589f261d80a9;hp=d9563f1b670c2620e425b6f28f8850326b621329;hpb=cc9ffe3d2206021acf96d14e714a6fa23f8912f2;p=dcpomatic.git diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index d9563f1b6..53c67d101 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 @@ -477,7 +477,7 @@ void CertificateChainEditor::export_chain () { auto d = new wxFileDialog ( - this, _("Select Chain File"), wxEmptyString, _("certificate_chain.pem"), wxT("PEM files (*.pem)|*.pem"), + this, _("Select Chain File"), wxEmptyString, wxT("certificate_chain.pem"), wxT("PEM files (*.pem)|*.pem"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); @@ -652,7 +652,7 @@ CertificateChainEditor::export_private_key () } auto d = new wxFileDialog ( - this, _("Select Key File"), wxEmptyString, _("private_key.pem"), wxT ("PEM files (*.pem)|*.pem"), + this, _("Select Key File"), wxEmptyString, wxT("private_key.pem"), wxT("PEM files (*.pem)|*.pem"), wxFD_SAVE | wxFD_OVERWRITE_PROMPT ); @@ -690,7 +690,7 @@ KeysPage::setup () { auto m = new StaticText (_panel, _("Decrypting KDMs")); m->SetFont (subheading_font); - sizer->Add (m, 0, wxALL, _border); + sizer->Add (m, 0, wxALL | wxEXPAND, _border); } auto buttons = new wxBoxSizer (wxVERTICAL); @@ -714,7 +714,7 @@ KeysPage::setup () { auto m = new StaticText (_panel, _("Signing DCPs and KDMs")); m->SetFont (subheading_font); - sizer->Add (m, 0, wxALL, _border); + sizer->Add (m, 0, wxALL | wxEXPAND, _border); } auto signing_advanced = new Button (_panel, _("Advanced...")); @@ -838,8 +838,18 @@ 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())); + } + default_name += wxT("_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 ); @@ -1071,7 +1081,7 @@ LocationsPage::GetName () const wxBitmap LocationsPage::GetLargeIcon () const { - return wxBitmap ("locations", wxBITMAP_TYPE_PNG_RESOURCE); + return wxBitmap(bitmap_path("locations"), wxBITMAP_TYPE_PNG); } #endif