X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fbarco_alchemy_certificate_panel.cc;h=19bd18a8dc02c731118c0ae73eba682fb45e43af;hb=5063594e6836cfabed7d55f4963da9c8cf3b9f11;hp=d105b4a9cb2a6eaaa1d77ee9d80d385dc3860853;hpb=2c844e57ed5c54e65a2b4484f02907122a03361e;p=dcpomatic.git diff --git a/src/wx/barco_alchemy_certificate_panel.cc b/src/wx/barco_alchemy_certificate_panel.cc index d105b4a9c..19bd18a8d 100644 --- a/src/wx/barco_alchemy_certificate_panel.cc +++ b/src/wx/barco_alchemy_certificate_panel.cc @@ -18,15 +18,23 @@ */ + #include "barco_alchemy_certificate_panel.h" #include "download_certificate_dialog.h" #include "wx_util.h" #include "lib/internet.h" #include "lib/compose.hpp" #include "lib/config.h" +#include + using std::string; +using namespace boost::algorithm; using boost::optional; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif + BarcoAlchemyCertificatePanel::BarcoAlchemyCertificatePanel (DownloadCertificateDialog* dialog) : CredentialsDownloadCertificatePanel ( @@ -51,8 +59,9 @@ BarcoAlchemyCertificatePanel::ready_to_download () const void BarcoAlchemyCertificatePanel::do_download () { - string const serial = wx_to_std (_serial->GetValue()); - string const url = String::compose ( + string serial = wx_to_std (_serial->GetValue()); + trim(serial); + string url = String::compose ( "ftp://%1:%2@certificates.barco.com/%3xxx/%4/Barco-ICMP.%5_cert.pem", Config::instance()->barco_username().get(), Config::instance()->barco_password().get(), @@ -60,8 +69,9 @@ BarcoAlchemyCertificatePanel::do_download () serial, serial ); + trim(url); - optional error = get_from_url (url, true, false, boost::bind (&DownloadCertificatePanel::load_certificate, this, _1)); + auto error = get_from_url (url, true, false, boost::bind (&DownloadCertificatePanel::load_certificate, this, _1, _2)); if (error) { _dialog->message()->SetLabel(wxT("")); error_dialog (this, std_to_wx(*error));