From: Carl Hetherington Date: Sun, 15 Nov 2015 19:22:16 +0000 (+0000) Subject: Some renaming of certificate -> recipient. X-Git-Tag: v2.5.4~10 X-Git-Url: https://git.carlh.net/gitweb/?p=dcpomatic.git;a=commitdiff_plain;h=f6caaae7747ed481fbaddcaa6afcfdefbbfc545a Some renaming of certificate -> recipient. --- diff --git a/src/wx/screen_dialog.cc b/src/wx/screen_dialog.cc index 9857c9c17..36e093ab8 100644 --- a/src/wx/screen_dialog.cc +++ b/src/wx/screen_dialog.cc @@ -31,31 +31,31 @@ using std::string; using std::cout; using boost::optional; -ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, optional certificate) +ScreenDialog::ScreenDialog (wxWindow* parent, string title, string name, optional recipient) : TableDialog (parent, std_to_wx (title), 2, 1, true) - , _certificate (certificate) + , _recipient (recipient) { add (_("Name"), true); _name = add (new wxTextCtrl (this, wxID_ANY, std_to_wx (name), wxDefaultPosition, wxSize (320, -1))); - add (_("Certificate"), true); + add (_("Recipient certificate"), true); wxBoxSizer* s = new wxBoxSizer (wxHORIZONTAL); - _certificate_thumbprint = new wxStaticText (this, wxID_ANY, wxT ("")); - wxFont font = _certificate_thumbprint->GetFont (); + _recipient_thumbprint = new wxStaticText (this, wxID_ANY, wxT ("")); + wxFont font = _recipient_thumbprint->GetFont (); font.SetFamily (wxFONTFAMILY_TELETYPE); - _certificate_thumbprint->SetFont (font); - if (certificate) { - _certificate_thumbprint->SetLabel (std_to_wx (certificate->thumbprint ())); + _recipient_thumbprint->SetFont (font); + if (recipient) { + _recipient_thumbprint->SetLabel (std_to_wx (recipient->thumbprint ())); } - _load_certificate = new wxButton (this, wxID_ANY, _("Load from file...")); - _download_certificate = new wxButton (this, wxID_ANY, _("Download...")); - s->Add (_certificate_thumbprint, 1, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP); - s->Add (_load_certificate, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP); - s->Add (_download_certificate, 0, wxLEFT | wxRIGHT | wxEXPAND, DCPOMATIC_SIZER_X_GAP); + _get_recipient_from_file = new wxButton (this, wxID_ANY, _("Get from file...")); + _download_recipient = new wxButton (this, wxID_ANY, _("Download...")); + s->Add (_recipient_thumbprint, 1, wxLEFT | wxRIGHT | wxALIGN_CENTER_VERTICAL, DCPOMATIC_SIZER_X_GAP); + 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); add (s); - _load_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::select_certificate, this)); - _download_certificate->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::download_certificate, this)); + _get_recipient_from_file->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::get_recipient_from_file, this)); + _download_recipient->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&ScreenDialog::download_recipient, this)); setup_sensitivity (); layout (); @@ -68,28 +68,28 @@ ScreenDialog::name () const } optional -ScreenDialog::certificate () const +ScreenDialog::recipient () const { - return _certificate; + return _recipient; } void -ScreenDialog::load_certificate (boost::filesystem::path file) +ScreenDialog::load_recipient (boost::filesystem::path file) { try { - _certificate = dcp::Certificate (dcp::file_to_string (file)); - _certificate_thumbprint->SetLabel (std_to_wx (_certificate->thumbprint ())); + _recipient = dcp::Certificate (dcp::file_to_string (file)); + _recipient_thumbprint->SetLabel (std_to_wx (_recipient->thumbprint ())); } catch (dcp::MiscError& e) { error_dialog (this, wxString::Format (_("Could not read certificate file (%s)"), std_to_wx(e.what()).data())); } } void -ScreenDialog::select_certificate () +ScreenDialog::get_recipient_from_file () { wxFileDialog* d = new wxFileDialog (this, _("Select Certificate File")); if (d->ShowModal () == wxID_OK) { - load_certificate (boost::filesystem::path (wx_to_std (d->GetPath ()))); + load_recipient (boost::filesystem::path (wx_to_std (d->GetPath ()))); } d->Destroy (); @@ -97,12 +97,12 @@ ScreenDialog::select_certificate () } void -ScreenDialog::download_certificate () +ScreenDialog::download_recipient () { DownloadCertificateDialog* d = new DownloadCertificateDialog (this); if (d->ShowModal() == wxID_OK) { - _certificate = d->certificate (); - _certificate_thumbprint->SetLabel (std_to_wx (_certificate->thumbprint ())); + _recipient = d->certificate (); + _recipient_thumbprint->SetLabel (std_to_wx (_recipient->thumbprint ())); } d->Destroy (); setup_sensitivity (); @@ -113,6 +113,6 @@ ScreenDialog::setup_sensitivity () { wxButton* ok = dynamic_cast (FindWindowById (wxID_OK, this)); if (ok) { - ok->Enable (static_cast(_certificate)); + ok->Enable (static_cast(_recipient)); } } diff --git a/src/wx/screen_dialog.h b/src/wx/screen_dialog.h index 1110bc992..7e03b160d 100644 --- a/src/wx/screen_dialog.h +++ b/src/wx/screen_dialog.h @@ -31,18 +31,18 @@ public: ScreenDialog (wxWindow *, std::string, std::string name = "", boost::optional c = boost::optional ()); std::string name () const; - boost::optional certificate () const; + boost::optional recipient () const; private: - void select_certificate (); - void load_certificate (boost::filesystem::path); - void download_certificate (); + void get_recipient_from_file (); + void load_recipient (boost::filesystem::path); + void download_recipient (); void setup_sensitivity (); wxTextCtrl* _name; - wxStaticText* _certificate_thumbprint; - wxButton* _load_certificate; - wxButton* _download_certificate; + wxStaticText* _recipient_thumbprint; + wxButton* _get_recipient_from_file; + wxButton* _download_recipient; - boost::optional _certificate; + boost::optional _recipient; }; diff --git a/src/wx/screens_panel.cc b/src/wx/screens_panel.cc index 2d47b65b5..a8138a893 100644 --- a/src/wx/screens_panel.cc +++ b/src/wx/screens_panel.cc @@ -226,7 +226,7 @@ ScreensPanel::add_screen_clicked () return; } - shared_ptr s (new Screen (d->name(), d->certificate())); + shared_ptr s (new Screen (d->name(), d->recipient())); c->add_screen (s); add_screen (c, s); @@ -247,7 +247,7 @@ ScreensPanel::edit_screen_clicked () ScreenDialog* d = new ScreenDialog (this, "Edit screen", s.second->name, s.second->recipient); if (d->ShowModal () == wxID_OK) { s.second->name = d->name (); - s.second->recipient = d->certificate (); + s.second->recipient = d->recipient (); _targets->SetItemText (s.first, std_to_wx (d->name())); Config::instance()->changed (); }