X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fchristie_certificate_panel.cc;h=7db3fef2500303e226d1202e44cc30ad7f340369;hb=f10e025eba54b0ab4dbe1b3611071b160ca89208;hp=fa91cc2b594ae2f79deb7ded0687634686bfca10;hpb=7d293a3268c320f474d42fef15548635c3cb40b0;p=dcpomatic.git diff --git a/src/wx/christie_certificate_panel.cc b/src/wx/christie_certificate_panel.cc index fa91cc2b5..7db3fef25 100644 --- a/src/wx/christie_certificate_panel.cc +++ b/src/wx/christie_certificate_panel.cc @@ -27,9 +27,19 @@ using std::string; using boost::optional; +using boost::bind; ChristieCertificatePanel::ChristieCertificatePanel (DownloadCertificateDialog* dialog) - : DownloadCertificatePanel (dialog) + : CredentialsDownloadCertificatePanel ( + dialog, + bind(&Config::christie_username, Config::instance()), + bind(&Config::set_christie_username, Config::instance(), _1), + bind(&Config::unset_christie_username, Config::instance()), + bind(&Config::christie_password, Config::instance()), + bind(&Config::set_christie_password, Config::instance(), _1), + bind(&Config::unset_christie_password, Config::instance()) + ) + { } @@ -37,13 +47,6 @@ ChristieCertificatePanel::ChristieCertificatePanel (DownloadCertificateDialog* d void ChristieCertificatePanel::do_download () { - Config* config = Config::instance (); - if (!config->christie_username() || !config->christie_password()) { - _dialog->message()->SetLabel(wxT("")); - error_dialog (this, _("No Christie username/password configured. Add your account details to the Accounts page in Preferences.")); - return; - } - string const prefix = String::compose( "ftp://%1:%2@certificates.christiedigital.com/Certificates/", Config::instance()->christie_username().get(), @@ -57,13 +60,13 @@ ChristieCertificatePanel::do_download () optional all_errors; - optional error = get_from_url (url, true, boost::bind (&DownloadCertificatePanel::load, this, _1)); + optional error = get_from_url (url, true, false, boost::bind (&DownloadCertificatePanel::load, this, _1)); if (error) { all_errors = *error; string const url = String::compose ("%1IMB-S2/IMB-S2_%2_sha256.pem", prefix, serial); - error = get_from_url (url, true, boost::bind (&DownloadCertificatePanel::load, this, _1)); + error = get_from_url (url, true, false, boost::bind (&DownloadCertificatePanel::load, this, _1)); if (error) { *all_errors += "\n" + *error; }