Display the filename / URL that a screen certificate was obtained from (#1894).
[dcpomatic.git] / src / wx / download_certificate_panel.cc
index c30b050081db913327807ff6ec36ae66fa075892..b3de4ca2c427e16aa8981dd78ff13432073adae7 100644 (file)
@@ -58,10 +58,11 @@ DownloadCertificatePanel::DownloadCertificatePanel (DownloadCertificateDialog* d
 
 
 optional<string>
-DownloadCertificatePanel::load_certificate (boost::filesystem::path file)
+DownloadCertificatePanel::load_certificate (boost::filesystem::path file, string url)
 {
        try {
                _certificate = dcp::Certificate (dcp::file_to_string(file));
+               _url = url;
        } catch (dcp::MiscError& e) {
                return String::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
        }
@@ -70,10 +71,11 @@ DownloadCertificatePanel::load_certificate (boost::filesystem::path file)
 
 
 optional<string>
-DownloadCertificatePanel::load_certificate_from_chain (boost::filesystem::path file)
+DownloadCertificatePanel::load_certificate_from_chain (boost::filesystem::path file, string url)
 {
        try {
                _certificate = dcp::CertificateChain (dcp::file_to_string(file)).leaf();
+               _url = url;
        } catch (dcp::MiscError& e) {
                return String::compose(wx_to_std(_("Could not read certificate file (%1)")), e.what());
        }
@@ -88,6 +90,14 @@ DownloadCertificatePanel::certificate () const
 
 }
 
+
+optional<string>
+DownloadCertificatePanel::url () const
+{
+       return _url;
+
+}
+
 void
 DownloadCertificatePanel::download ()
 {