- auto d = new wxFileDialog (this, _("Trusted Device certificate"));
- if (d->ShowModal() == wxID_OK) {
- try {
- _certificate = dcp::Certificate(dcp::file_to_string(wx_to_std(d->GetPath())));
- _thumbprint->SetValue (std_to_wx(_certificate->thumbprint()));
- } catch (dcp::MiscError& e) {
- error_dialog (this, wxString::Format(_("Could not load certficate (%s)"), std_to_wx(e.what())));
- }
+ auto dialog = make_wx<FileDialog>(this, _("Trusted Device certificate"), wxEmptyString, wxFD_DEFAULT_STYLE, "SelectCertificatePath");
+ if (!dialog->show()) {
+ return;
+ }
+
+ try {
+ _certificate = dcp::Certificate(dcp::file_to_string(dialog->paths()[0]));
+ _thumbprint->SetValue (std_to_wx(_certificate->thumbprint()));
+ } catch (dcp::MiscError& e) {
+ error_dialog(this, wxString::Format(_("Could not load certificate (%s)"), std_to_wx(e.what())));