X-Git-Url: https://main.carlh.net/gitweb/?p=dcpomatic.git;a=blobdiff_plain;f=src%2Fwx%2Fbarco_alchemy_certificate_panel.cc;h=47dd85e0705a03b9ce87d2cb482cb508a705a62c;hp=84048c65cf98d97b767577668d14e489e9dad93c;hb=8f12e84009d7c2685bb2eeb32665876463d4e6e5;hpb=6a92ad180163bf84aeedc5f955edc13557e6848c diff --git a/src/wx/barco_alchemy_certificate_panel.cc b/src/wx/barco_alchemy_certificate_panel.cc index 84048c65c..47dd85e07 100644 --- a/src/wx/barco_alchemy_certificate_panel.cc +++ b/src/wx/barco_alchemy_certificate_panel.cc @@ -29,7 +29,15 @@ using std::string; using boost::optional; BarcoAlchemyCertificatePanel::BarcoAlchemyCertificatePanel (DownloadCertificateDialog* dialog) - : DownloadCertificatePanel (dialog) + : CredentialsDownloadCertificatePanel ( + dialog, + boost::bind(&Config::barco_username, Config::instance()), + boost::bind(&Config::set_barco_username, Config::instance(), _1), + boost::bind(&Config::unset_barco_username, Config::instance()), + boost::bind(&Config::barco_password, Config::instance()), + boost::bind(&Config::set_barco_password, Config::instance(), _1), + boost::bind(&Config::unset_barco_password, Config::instance()) + ) { } @@ -37,19 +45,12 @@ BarcoAlchemyCertificatePanel::BarcoAlchemyCertificatePanel (DownloadCertificateD bool BarcoAlchemyCertificatePanel::ready_to_download () const { - return _serial->GetValue().Length() == 10; + return CredentialsDownloadCertificatePanel::ready_to_download() && _serial->GetValue().Length() == 10; } void BarcoAlchemyCertificatePanel::do_download () { - Config* config = Config::instance (); - if (!config->barco_username() || !config->barco_password()) { - _dialog->message()->SetLabel(wxT("")); - error_dialog (this, _("No Barco username/password configured. Add your account details to the Accounts page in Preferences.")); - return; - } - string const serial = wx_to_std (_serial->GetValue()); string const url = String::compose ( "ftp://%1:%2@certificates.barco.com/%3xxx/%4/Barco-ICMP.%5_cert.pem",