From f8acc34bcb4401184064598353d6c54df3cab1f9 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 15 Aug 2018 02:08:05 +0100 Subject: More rearrangement and add Barco Alchemy. --- src/lib/config.cc | 12 +++++++++++ src/lib/config.h | 26 +++++++++++++++++++++++ src/lib/internet.cc | 53 ++++++++++++++++++++++++++++++++++------------ src/lib/internet.h | 1 + src/lib/scoped_temporary.h | 5 +++-- 5 files changed, 81 insertions(+), 16 deletions(-) (limited to 'src/lib') diff --git a/src/lib/config.cc b/src/lib/config.cc index 7e2cdabf6..792ce5619 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -156,6 +156,8 @@ Config::set_defaults () for (int i = 0; i < NOTIFICATION_COUNT; ++i) { _notification[i] = false; } + _barco_username = optional(); + _barco_password = optional(); _allowed_dcp_frame_rates.clear (); _allowed_dcp_frame_rates.push_back (24); @@ -463,6 +465,9 @@ try } } + _barco_username = f.optional_string_child("BarcoUsername"); + _barco_password = f.optional_string_child("BarcoPassword"); + /* Replace any cinemas from config.xml with those from the configured file */ if (boost::filesystem::exists (_cinemas_file)) { cxml::Document f ("Cinemas"); @@ -806,6 +811,13 @@ Config::write_config () const e->add_child_text (_notification[i] ? "1" : "0"); } + if (_barco_username) { + root->add_child("BarcoUsername")->add_child_text(*_barco_username); + } + if (_barco_password) { + root->add_child("BarcoPassword")->add_child_text(*_barco_password); + } + try { doc.write_to_file_formatted(config_file().string()); } catch (xmlpp::exception& e) { diff --git a/src/lib/config.h b/src/lib/config.h index dbe6a9c21..8bf766c02 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -423,6 +423,14 @@ public: return _notification[n]; } + boost::optional barco_username () const { + return _barco_username; + } + + boost::optional barco_password () const { + return _barco_password; + } + /* SET (mostly) */ void set_master_encoding_threads (int n) { @@ -769,6 +777,22 @@ public: maybe_set (_notification[n], v); } + void set_barco_username (std::string u) { + maybe_set (_barco_username, u); + } + + void unset_barco_username () { + maybe_set (_barco_username, boost::optional()); + } + + void set_barco_password (std::string p) { + maybe_set (_barco_password, p); + } + + void unset_barco_password () { + maybe_set (_barco_password, boost::optional()); + } + void changed (Property p = OTHER); boost::signals2::signal Changed; /** Emitted if read() failed on an existing Config file. There is nothing @@ -944,6 +968,8 @@ private: boost::optional _decode_reduction; bool _default_notify; bool _notification[NOTIFICATION_COUNT]; + boost::optional _barco_username; + boost::optional _barco_password; static int const _current_version; diff --git a/src/lib/internet.cc b/src/lib/internet.cc index c1bb5e88f..846dbf7ca 100644 --- a/src/lib/internet.cc +++ b/src/lib/internet.cc @@ -38,27 +38,23 @@ using boost::optional; using boost::function; using boost::algorithm::trim; + static size_t -get_from_zip_url_data (void* buffer, size_t size, size_t nmemb, void* stream) +get_from_url_data (void* buffer, size_t size, size_t nmemb, void* stream) { FILE* f = reinterpret_cast (stream); return fwrite (buffer, size, nmemb, f); } -/** @param url URL of ZIP file. - * @param file Filename within ZIP file. - * @param load Function passed a (temporary) filesystem path of the unpacked file. - */ +static optional -get_from_zip_url (string url, string file, bool pasv, function load) +get_from_url (string url, bool pasv, ScopedTemporary& temp) { - /* Download the ZIP file to temp_zip */ CURL* curl = curl_easy_init (); - curl_easy_setopt (curl, CURLOPT_URL, url.c_str ()); + curl_easy_setopt (curl, CURLOPT_URL, url.c_str()); - ScopedTemporary temp_zip; - FILE* f = temp_zip.open ("wb"); - curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, get_from_zip_url_data); + FILE* f = temp.open ("w"); + curl_easy_setopt (curl, CURLOPT_WRITEFUNCTION, get_from_url_data); curl_easy_setopt (curl, CURLOPT_WRITEDATA, f); curl_easy_setopt (curl, CURLOPT_FTP_USE_EPSV, 0); curl_easy_setopt (curl, CURLOPT_FTP_USE_EPRT, 0); @@ -71,10 +67,39 @@ get_from_zip_url (string url, string file, bool pasv, function(); +} + +optional +get_from_url (string url, bool pasv, function load) +{ + ScopedTemporary temp; + optional e = get_from_url (url, pasv, temp); + if (e) { + return e; + } + load (temp.file()); + return optional(); +} + +/** @param url URL of ZIP file. + * @param file Filename within ZIP file. + * @param load Function passed a (temporary) filesystem path of the unpacked file. + */ +optional +get_from_zip_url (string url, string file, bool pasv, function load) +{ + /* Download the ZIP file to temp_zip */ + ScopedTemporary temp_zip; + optional e = get_from_url (url, pasv, temp_zip); + if (e) { + return e; } /* Open the ZIP file and read `file' out of it */ @@ -110,7 +135,7 @@ get_from_zip_url (string url, string file, bool pasv, function #include +boost::optional get_from_url (std::string url, bool pasv, boost::function load); boost::optional get_from_zip_url (std::string url, std::string file, bool pasv, boost::function load); diff --git a/src/lib/scoped_temporary.h b/src/lib/scoped_temporary.h index 87c8e387f..986f565a0 100644 --- a/src/lib/scoped_temporary.h +++ b/src/lib/scoped_temporary.h @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2014 Carl Hetherington + Copyright (C) 2012-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -19,12 +19,13 @@ */ #include +#include #include /** @class ScopedTemporary * @brief A temporary file which is deleted when the ScopedTemporary object goes out of scope. */ -class ScopedTemporary +class ScopedTemporary : public boost::noncopyable { public: ScopedTemporary (); -- cgit v1.2.3 From 89abe02431bd8d885197883a3ffafdc8d836dce4 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 15 Aug 2018 02:24:26 +0100 Subject: Christie support. --- src/lib/config.cc | 11 +++++ src/lib/config.h | 26 +++++++++++ src/wx/christie_certificate_panel.cc | 87 +++++++++++++++++++++++++++++++++++ src/wx/christie_certificate_panel.h | 30 ++++++++++++ src/wx/download_certificate_dialog.cc | 2 + src/wx/full_config_dialog.cc | 34 ++++++++++++++ src/wx/wscript | 1 + 7 files changed, 191 insertions(+) create mode 100644 src/wx/christie_certificate_panel.cc create mode 100644 src/wx/christie_certificate_panel.h (limited to 'src/lib') diff --git a/src/lib/config.cc b/src/lib/config.cc index 792ce5619..28af9b303 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -158,6 +158,8 @@ Config::set_defaults () } _barco_username = optional(); _barco_password = optional(); + _christie_username = optional(); + _christie_password = optional(); _allowed_dcp_frame_rates.clear (); _allowed_dcp_frame_rates.push_back (24); @@ -467,6 +469,8 @@ try _barco_username = f.optional_string_child("BarcoUsername"); _barco_password = f.optional_string_child("BarcoPassword"); + _christie_username = f.optional_string_child("ChristieUsername"); + _christie_password = f.optional_string_child("ChristiePassword"); /* Replace any cinemas from config.xml with those from the configured file */ if (boost::filesystem::exists (_cinemas_file)) { @@ -818,6 +822,13 @@ Config::write_config () const root->add_child("BarcoPassword")->add_child_text(*_barco_password); } + if (_christie_username) { + root->add_child("ChristieUsername")->add_child_text(*_christie_username); + } + if (_christie_password) { + root->add_child("ChristiePassword")->add_child_text(*_christie_password); + } + try { doc.write_to_file_formatted(config_file().string()); } catch (xmlpp::exception& e) { diff --git a/src/lib/config.h b/src/lib/config.h index 8bf766c02..b710f537d 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -431,6 +431,14 @@ public: return _barco_password; } + boost::optional christie_username () const { + return _christie_username; + } + + boost::optional christie_password () const { + return _christie_password; + } + /* SET (mostly) */ void set_master_encoding_threads (int n) { @@ -793,6 +801,22 @@ public: maybe_set (_barco_password, boost::optional()); } + void set_christie_username (std::string u) { + maybe_set (_christie_username, u); + } + + void unset_christie_username () { + maybe_set (_christie_username, boost::optional()); + } + + void set_christie_password (std::string p) { + maybe_set (_christie_password, p); + } + + void unset_christie_password () { + maybe_set (_christie_password, boost::optional()); + } + void changed (Property p = OTHER); boost::signals2::signal Changed; /** Emitted if read() failed on an existing Config file. There is nothing @@ -970,6 +994,8 @@ private: bool _notification[NOTIFICATION_COUNT]; boost::optional _barco_username; boost::optional _barco_password; + boost::optional _christie_username; + boost::optional _christie_password; static int const _current_version; diff --git a/src/wx/christie_certificate_panel.cc b/src/wx/christie_certificate_panel.cc new file mode 100644 index 000000000..53d815bf7 --- /dev/null +++ b/src/wx/christie_certificate_panel.cc @@ -0,0 +1,87 @@ +/* + Copyright (C) 2018 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + +#include "christie_certificate_panel.h" +#include "download_certificate_dialog.h" +#include "wx_util.h" +#include "lib/internet.h" +#include "lib/compose.hpp" +#include "lib/config.h" + +using std::string; +using boost::optional; + +ChristieCertificatePanel::ChristieCertificatePanel (DownloadCertificateDialog* dialog) + : DownloadCertificatePanel (dialog) +{ + +} + +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 serial = wx_to_std (_serial->GetValue()); + string const url = String::compose ( + "ftp://%1:%2@certificates.christiedigital.com/Certificates/F-IMB/F-IMB_000000%3_sha256.pem", + Config::instance()->christie_username().get(), + Config::instance()->christie_password().get(), + serial + ); + + optional all_errors; + + optional error = get_from_url (url, true, boost::bind (&DownloadCertificatePanel::load, this, _1)); + if (error) { + all_errors = *error; + + string const url = String::compose ( + "ftp://%1:%2@certificates.christiedigital.com/Certificates/F-IMB/F-IMB_000000%3_sha256.pem", + Config::instance()->christie_username().get(), + Config::instance()->christie_password().get(), + serial + ); + + error = get_from_url (url, true, boost::bind (&DownloadCertificatePanel::load, this, _1)); + if (error) { + *all_errors += "\n" + *error; + } + } + + if (all_errors) { + _dialog->message()->SetLabel(wxT("")); + error_dialog (this, std_to_wx(*all_errors)); + } else { + _dialog->message()->SetLabel (_("Certificate downloaded")); + _dialog->setup_sensitivity (); + } +} + +wxString +ChristieCertificatePanel::name () const +{ + return _("Christie"); +} diff --git a/src/wx/christie_certificate_panel.h b/src/wx/christie_certificate_panel.h new file mode 100644 index 000000000..0c9a64d46 --- /dev/null +++ b/src/wx/christie_certificate_panel.h @@ -0,0 +1,30 @@ +/* + Copyright (C) 2018 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + +#include "download_certificate_panel.h" + +class ChristieCertificatePanel : public DownloadCertificatePanel +{ +public: + ChristieCertificatePanel (DownloadCertificateDialog* dialog); + + void do_download (); + wxString name () const; +}; diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc index 6ca605f56..dfafee36c 100644 --- a/src/wx/download_certificate_dialog.cc +++ b/src/wx/download_certificate_dialog.cc @@ -20,6 +20,7 @@ #include "dolby_doremi_certificate_panel.h" #include "barco_alchemy_certificate_panel.h" +#include "christie_certificate_panel.h" #include "download_certificate_dialog.h" #include "wx_util.h" @@ -45,6 +46,7 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent) _pages.push_back (new DolbyDoremiCertificatePanel (this)); _pages.push_back (new BarcoAlchemyCertificatePanel (this)); + _pages.push_back (new ChristieCertificatePanel (this)); BOOST_FOREACH (DownloadCertificatePanel* i, _pages) { _notebook->AddPage (i, i->name(), true); diff --git a/src/wx/full_config_dialog.cc b/src/wx/full_config_dialog.cc index bf26519e1..d21c8a2c1 100644 --- a/src/wx/full_config_dialog.cc +++ b/src/wx/full_config_dialog.cc @@ -943,8 +943,18 @@ public: _barco_password = new wxTextCtrl (_panel, wxID_ANY); table->Add (_barco_password, 1, wxEXPAND | wxALL); + add_label_to_sizer (table, _panel, _("certificates.christiedigital.com username"), true); + _christie_username = new wxTextCtrl (_panel, wxID_ANY); + table->Add (_christie_username, 1, wxEXPAND | wxALL); + + add_label_to_sizer (table, _panel, _("certificates.christiedigital.com password"), true); + _christie_password = new wxTextCtrl (_panel, wxID_ANY); + table->Add (_christie_password, 1, wxEXPAND | wxALL); + _barco_username->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::barco_username_changed, this)); _barco_password->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::barco_password_changed, this)); + _christie_username->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::christie_username_changed, this)); + _christie_password->Bind (wxEVT_TEXT, boost::bind(&AccountsPage::christie_password_changed, this)); } void config_changed () @@ -953,6 +963,8 @@ public: checked_set (_barco_username, config->barco_username().get_value_or("")); checked_set (_barco_password, config->barco_password().get_value_or("")); + checked_set (_christie_username, config->christie_username().get_value_or("")); + checked_set (_christie_password, config->christie_password().get_value_or("")); } void barco_username_changed () @@ -975,9 +987,31 @@ public: } } + void christie_username_changed () + { + wxString const s = _christie_username->GetValue(); + if (!s.IsEmpty()) { + Config::instance()->set_christie_username (wx_to_std(s)); + } else { + Config::instance()->unset_christie_username (); + } + } + + void christie_password_changed () + { + wxString const s = _christie_password->GetValue(); + if (!s.IsEmpty()) { + Config::instance()->set_christie_password (wx_to_std(s)); + } else { + Config::instance()->unset_christie_password (); + } + } + private: wxTextCtrl* _barco_username; wxTextCtrl* _barco_password; + wxTextCtrl* _christie_username; + wxTextCtrl* _christie_password; }; diff --git a/src/wx/wscript b/src/wx/wscript index 39617b840..560bfc1ab 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -36,6 +36,7 @@ sources = """ subtitle_appearance_dialog.cc text_panel.cc text_view.cc + christie_certificate_panel.cc cinema_dialog.cc colour_conversion_editor.cc config_dialog.cc -- cgit v1.2.3 From 998b2eea5640cda23950ff6c5e24bd1f9ccb160f Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 15 Aug 2018 10:51:16 +0100 Subject: Add GDC and accounts icon. --- graphics/src/accounts.svg | 179 ++++++++++++++++++++++++++++++++++ graphics/update | 2 +- src/lib/config.cc | 11 +++ src/lib/config.h | 26 +++++ src/wx/download_certificate_dialog.cc | 2 + src/wx/gdc_certificate_panel.cc | 69 +++++++++++++ src/wx/gdc_certificate_panel.h | 30 ++++++ src/wx/wscript | 1 + 8 files changed, 319 insertions(+), 1 deletion(-) create mode 100644 graphics/src/accounts.svg create mode 100644 src/wx/gdc_certificate_panel.cc create mode 100644 src/wx/gdc_certificate_panel.h (limited to 'src/lib') diff --git a/graphics/src/accounts.svg b/graphics/src/accounts.svg new file mode 100644 index 000000000..920051848 --- /dev/null +++ b/graphics/src/accounts.svg @@ -0,0 +1,179 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + Openclipart + + + + 2010-03-29T08:04:16 + "E-mail" icon from <a href="http://tango.freedesktop.org/Tango_Desktop_Project"> Tango Project </a> +\n<br><br> +\nSince version 0.8.90 Tango Project icons are Public Domain: <a href="http://tango.freedesktop.org/Frequently_Asked_Questions#Terms_of_Use.3F"> Tango Project FAQ </a> + https://openclipart.org/detail/35215/tango-internet-mail-by-warszawianka + + + warszawianka + + + + + email + envelope + externalsource + icon + letter + tango + + + + + + + + + + + diff --git a/graphics/update b/graphics/update index 9815cf9a7..51336745e 100755 --- a/graphics/update +++ b/graphics/update @@ -55,7 +55,7 @@ else # OS X preferences icons # servers.png does not have an SVG version mkdir -p osx/preferences - for i in colour_conversions defaults email kdm_email cover_sheet keys tms notifications; do + for i in colour_conversions defaults email kdm_email cover_sheet keys tms notifications accounts; do $INKSCAPE osx/preferences/$i.png src/$i.svg -w 32 -h 32 done diff --git a/src/lib/config.cc b/src/lib/config.cc index 28af9b303..76c70ed5d 100644 --- a/src/lib/config.cc +++ b/src/lib/config.cc @@ -160,6 +160,8 @@ Config::set_defaults () _barco_password = optional(); _christie_username = optional(); _christie_password = optional(); + _gdc_username = optional(); + _gdc_password = optional(); _allowed_dcp_frame_rates.clear (); _allowed_dcp_frame_rates.push_back (24); @@ -471,6 +473,8 @@ try _barco_password = f.optional_string_child("BarcoPassword"); _christie_username = f.optional_string_child("ChristieUsername"); _christie_password = f.optional_string_child("ChristiePassword"); + _gdc_username = f.optional_string_child("GDCUsername"); + _gdc_password = f.optional_string_child("GDCPassword"); /* Replace any cinemas from config.xml with those from the configured file */ if (boost::filesystem::exists (_cinemas_file)) { @@ -829,6 +833,13 @@ Config::write_config () const root->add_child("ChristiePassword")->add_child_text(*_christie_password); } + if (_gdc_username) { + root->add_child("GDCUsername")->add_child_text(*_gdc_username); + } + if (_gdc_password) { + root->add_child("GDCPassword")->add_child_text(*_gdc_password); + } + try { doc.write_to_file_formatted(config_file().string()); } catch (xmlpp::exception& e) { diff --git a/src/lib/config.h b/src/lib/config.h index b710f537d..0be3b20b9 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -439,6 +439,14 @@ public: return _christie_password; } + boost::optional gdc_username () const { + return _gdc_username; + } + + boost::optional gdc_password () const { + return _gdc_password; + } + /* SET (mostly) */ void set_master_encoding_threads (int n) { @@ -817,6 +825,22 @@ public: maybe_set (_christie_password, boost::optional()); } + void set_gdc_username (std::string u) { + maybe_set (_gdc_username, u); + } + + void unset_gdc_username () { + maybe_set (_gdc_username, boost::optional()); + } + + void set_gdc_password (std::string p) { + maybe_set (_gdc_password, p); + } + + void unset_gdc_password () { + maybe_set (_gdc_password, boost::optional()); + } + void changed (Property p = OTHER); boost::signals2::signal Changed; /** Emitted if read() failed on an existing Config file. There is nothing @@ -996,6 +1020,8 @@ private: boost::optional _barco_password; boost::optional _christie_username; boost::optional _christie_password; + boost::optional _gdc_username; + boost::optional _gdc_password; static int const _current_version; diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc index dfafee36c..a12097001 100644 --- a/src/wx/download_certificate_dialog.cc +++ b/src/wx/download_certificate_dialog.cc @@ -21,6 +21,7 @@ #include "dolby_doremi_certificate_panel.h" #include "barco_alchemy_certificate_panel.h" #include "christie_certificate_panel.h" +#include "gdc_certificate_panel.h" #include "download_certificate_dialog.h" #include "wx_util.h" @@ -47,6 +48,7 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent) _pages.push_back (new DolbyDoremiCertificatePanel (this)); _pages.push_back (new BarcoAlchemyCertificatePanel (this)); _pages.push_back (new ChristieCertificatePanel (this)); + _pages.push_back (new GDCCertificatePanel (this)); BOOST_FOREACH (DownloadCertificatePanel* i, _pages) { _notebook->AddPage (i, i->name(), true); diff --git a/src/wx/gdc_certificate_panel.cc b/src/wx/gdc_certificate_panel.cc new file mode 100644 index 000000000..b4352dff4 --- /dev/null +++ b/src/wx/gdc_certificate_panel.cc @@ -0,0 +1,69 @@ +/* + Copyright (C) 2018 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + +#include "gdc_certificate_panel.h" +#include "download_certificate_dialog.h" +#include "wx_util.h" +#include "lib/internet.h" +#include "lib/compose.hpp" +#include "lib/config.h" + +using std::string; +using boost::optional; + +GDCCertificatePanel::GDCCertificatePanel (DownloadCertificateDialog* dialog) + : DownloadCertificatePanel (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", + Config::instance()->gdc_username().get(), + Config::instance()->gdc_password().get(), + serial + ); + + optional error = get_from_url (url, true, boost::bind (&DownloadCertificatePanel::load, this, _1)); + + if (error) { + _dialog->message()->SetLabel(wxT("")); + error_dialog (this, std_to_wx(*error)); + } else { + _dialog->message()->SetLabel (_("Certificate downloaded")); + _dialog->setup_sensitivity (); + } +} + +wxString +GDCCertificatePanel::name () const +{ + return _("GDC"); +} diff --git a/src/wx/gdc_certificate_panel.h b/src/wx/gdc_certificate_panel.h new file mode 100644 index 000000000..18a78e586 --- /dev/null +++ b/src/wx/gdc_certificate_panel.h @@ -0,0 +1,30 @@ +/* + Copyright (C) 2018 Carl Hetherington + + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation; either version 2 of the License, or + (at your option) any later version. + + DCP-o-matic is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with DCP-o-matic. If not, see . + +*/ + +#include "download_certificate_panel.h" + +class GDCCertificatePanel : public DownloadCertificatePanel +{ +public: + GDCCertificatePanel (DownloadCertificateDialog* dialog); + + void do_download (); + wxString name () const; +}; diff --git a/src/wx/wscript b/src/wx/wscript index 560bfc1ab..d50286bf4 100644 --- a/src/wx/wscript +++ b/src/wx/wscript @@ -68,6 +68,7 @@ sources = """ font_files_dialog.cc full_config_dialog.cc gain_calculator_dialog.cc + gdc_certificate_panel.cc hints_dialog.cc job_view.cc job_view_dialog.cc -- cgit v1.2.3