+ layout ();
+
+ _file->Bind (wxEVT_BUTTON, bind(&TrustedDeviceDialog::load_certificate, this));
+ }
+
+ void load_certificate ()
+ {
+ wxFileDialog* d = new wxFileDialog (this, _("Trusted Device certificate"));
+ d->ShowModal ();
+ 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())));
+ }
+ }
+
+ void set (TrustedDevice t)
+ {
+ _certificate = t.certificate ();
+ _thumbprint->SetValue (std_to_wx(t.thumbprint()));