+ wxTextCtrl* _thumbprint;
+ wxButton* _file;
+ boost::optional<dcp::Certificate> _certificate;
+};
+
+
+ScreenDialog::ScreenDialog (
+ wxWindow* parent,
+ wxString title,
+ string name,
+ string notes,
+ optional<dcp::Certificate> recipient,
+ optional<string> recipient_file,
+ vector<TrustedDevice> trusted_devices
+ )
+ : wxDialog (parent, wxID_ANY, title)
+ , _recipient (recipient)
+ , _trusted_devices (trusted_devices)
+{
+ auto overall_sizer = new wxBoxSizer (wxVERTICAL);
+ SetSizer (overall_sizer);
+
+ _sizer = new wxGridBagSizer (DCPOMATIC_SIZER_X_GAP, DCPOMATIC_SIZER_Y_GAP);
+ int r = 0;
+
+ wxFont subheading_font(*wxNORMAL_FONT);
+ subheading_font.SetWeight(wxFONTWEIGHT_BOLD);
+
+ auto subheading = new StaticText(this, _("Details"));
+ subheading->SetFont(subheading_font);
+ _sizer->Add(subheading, wxGBPosition(r, 0), wxGBSpan(1, 2));
+ ++r;
+
+ add_label_to_sizer(_sizer, this, _("Name"), true, wxGBPosition(r, 0), wxDefaultSpan, true);
+ _name = new wxTextCtrl (this, wxID_ANY, std_to_wx (name), wxDefaultPosition, wxSize (320, -1));
+ _sizer->Add (_name, wxGBPosition (r, 1));
+ ++r;
+
+ add_label_to_sizer(_sizer, this, _("Notes"), true, wxGBPosition(r, 0), wxDefaultSpan, true);
+ _notes = new wxTextCtrl (this, wxID_ANY, std_to_wx(notes), wxDefaultPosition, wxSize(320, -1));
+ _sizer->Add (_notes, wxGBPosition(r, 1));
+ ++r;
+
+ subheading = new StaticText(this, _("Recipient"));
+ subheading->SetFont(subheading_font);
+ _sizer->Add(subheading, wxGBPosition(r, 0), wxGBSpan(1, 2), wxTOP, DCPOMATIC_SUBHEADING_TOP_PAD);
+ ++r;
+
+ _get_recipient_from_file = new Button (this, _("Get from file..."));
+ _download_recipient = new Button (this, _("Download..."));
+ auto s = new wxBoxSizer (wxHORIZONTAL);
+ s->Add (_get_recipient_from_file, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP);
+ s->Add (_download_recipient, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP);
+ _sizer->Add(s, wxGBPosition(r, 0), wxGBSpan(1, 2));
+ ++r;
+
+ auto add_certificate_detail = [&r, this](wxString name, wxStaticText** value, wxSize size = wxDefaultSize) {
+ add_label_to_sizer(_sizer, this, name, true, wxGBPosition(r, 0), wxDefaultSpan, true);
+ *value = new StaticText(this, wxT (""), wxDefaultPosition, size);
+ _sizer->Add(*value, wxGBPosition(r, 1));
+ ++r;
+ };
+
+ wxClientDC dc (this);
+ wxFont teletype_font = _name->GetFont();
+ teletype_font.SetFamily(wxFONTFAMILY_TELETYPE);
+ dc.SetFont(teletype_font);
+ wxSize size = dc.GetTextExtent (wxT("1234567890123456789012345678"));
+ size.SetHeight (-1);
+
+ add_certificate_detail(_("Thumbprint"), &_recipient_thumbprint, size);
+ _recipient_thumbprint->SetFont(teletype_font);
+
+ add_label_to_sizer(_sizer, this, _("Filename"), true, wxGBPosition(r, 0), wxDefaultSpan, true);
+ _recipient_file = new wxStaticText(this, wxID_ANY, wxT(""), wxDefaultPosition, wxSize(600, -1), wxST_ELLIPSIZE_MIDDLE | wxST_NO_AUTORESIZE);
+ set_recipient_file(recipient_file.get_value_or(""));
+ _sizer->Add (_recipient_file, wxGBPosition(r, 1), wxDefaultSpan, wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_Y_GAP);
+ ++r;
+
+ add_certificate_detail(_("Subject common name"), &_subject_common_name);
+ add_certificate_detail(_("Subject organization name"), &_subject_organization_name);
+ add_certificate_detail(_("Issuer common name"), &_issuer_common_name);
+ add_certificate_detail(_("Issuer organization name"), &_issuer_organization_name);
+ add_certificate_detail(_("Not valid before"), &_not_valid_before);
+ add_certificate_detail(_("Not valid after"), &_not_valid_after);