/*
- Copyright (C) 2014 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2021 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
*/
+
#ifndef DCPOMATIC_DOWNLOAD_CERTIFICATE_PANEL_H
#define DCPOMATIC_DOWNLOAD_CERTIFICATE_PANEL_H
+
+#include "lib/warnings.h"
#include <dcp/certificate.h>
+DCPOMATIC_DISABLE_WARNINGS
#include <wx/wx.h>
+DCPOMATIC_ENABLE_WARNINGS
#include <boost/optional.hpp>
+
class DownloadCertificateDialog;
+
class DownloadCertificatePanel : public wxPanel
{
public:
- DownloadCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog);
+ DownloadCertificatePanel (DownloadCertificateDialog* dialog);
- virtual bool ready_to_download () const = 0;
- virtual void do_download (wxStaticText* message) = 0;
+ virtual void do_download () = 0;
virtual wxString name () const = 0;
+ virtual bool ready_to_download () const;
- void download (wxStaticText* message);
- void load (boost::filesystem::path);
+ void download ();
+ boost::optional<std::string> load_certificate (boost::filesystem::path);
+ boost::optional<std::string> load_certificate_from_chain (boost::filesystem::path);
boost::optional<dcp::Certificate> certificate () const;
protected:
- void layout ();
-
DownloadCertificateDialog* _dialog;
wxFlexGridSizer* _table;
+ wxTextCtrl* _serial;
+ wxSizer* _overall_sizer;
private:
- wxSizer* _overall_sizer;
boost::optional<dcp::Certificate> _certificate;
};
+
#endif