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())
+ )
+
{
}
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(),
optional<string> all_errors;
- optional<string> error = get_from_url (url, true, boost::bind (&DownloadCertificatePanel::load, this, _1));
+ optional<string> error = get_from_url (url, true, false, boost::bind(&DownloadCertificatePanel::load_certificate_from_chain, 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_certificate_from_chain, this, _1));
if (error) {
*all_errors += "\n" + *error;
}