X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fgdc_certificate_panel.cc;h=a4301087dea1980f1dcda2f8c7990214a7206fe9;hb=706f73390eb37f16b220177650ea7e70c2462150;hp=d4b82d19986102d3fc551471d1713060179044c8;hpb=d9561404372d187ea7813389ac69545de614f259;p=dcpomatic.git diff --git a/src/wx/gdc_certificate_panel.cc b/src/wx/gdc_certificate_panel.cc index d4b82d199..a4301087d 100644 --- a/src/wx/gdc_certificate_panel.cc +++ b/src/wx/gdc_certificate_panel.cc @@ -27,9 +27,18 @@ using std::string; using boost::optional; +using boost::bind; GDCCertificatePanel::GDCCertificatePanel (DownloadCertificateDialog* dialog) - : DownloadCertificatePanel (dialog) + : CredentialsDownloadCertificatePanel ( + dialog, + bind(&Config::gdc_username, Config::instance()), + bind(&Config::set_gdc_username, Config::instance(), _1), + bind(&Config::unset_gdc_username, Config::instance()), + bind(&Config::gdc_password, Config::instance()), + bind(&Config::set_gdc_password, Config::instance(), _1), + bind(&Config::unset_gdc_password, Config::instance()) + ) { } @@ -37,21 +46,14 @@ GDCCertificatePanel::GDCCertificatePanel (DownloadCertificateDialog* dialog) void GDCCertificatePanel::do_download () { - Config* config = Config::instance (); - if (!config->gdc_username() || !config->gdc_password()) { - _dialog->message()->SetLabel(wxT("")); - error_dialog (this, _("No GDC username/password configured. Add your account details to the Accounts page in Preferences.")); - return; - } - string const url = String::compose( - "ftp://%1:%2@ftp.gdc-tech.com/SHA256/A%3", + "ftp://%1:%2@ftp.gdc-tech.com/SHA256/A%3.crt.pem", Config::instance()->gdc_username().get(), Config::instance()->gdc_password().get(), wx_to_std(_serial->GetValue()) ); - 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) { _dialog->message()->SetLabel(wxT(""));