layout ();
}
-void
-DolbyDoremiCertificatePanel::download (wxStaticText* message)
-{
- message->SetLabel (_("Downloading certificate"));
-
- /* Hack: without this the SetLabel() above has no visible effect */
- wxMilliSleep (200);
-
- signal_manager->when_idle (boost::bind (&DolbyDoremiCertificatePanel::finish_download, this, wx_to_std (_serial->GetValue ()), message));
-}
-
static void
try_dcp2000 (list<string>& urls, list<string>& files, string prefix, string serial)
{
}
void
-DolbyDoremiCertificatePanel::finish_download (string serial, wxStaticText* message)
+DolbyDoremiCertificatePanel::do_download (wxStaticText* message)
{
/* Try dcp2000, imb and ims prefixes (see mantis #375) */
string const prefix = "ftp://anonymous@ftp.cinema.dolby.com/Certificates/";
list<string> urls;
list<string> files;
+ string const serial = wx_to_std (_serial->GetValue());
bool starts_with_digit = false;
optional<char> starting_char;
{
return !_serial->IsEmpty ();
}
+
+wxString
+DolbyDoremiCertificatePanel::name () const
+{
+ return _("Dolby / Doremi");
+}
DolbyDoremiCertificatePanel (wxWindow* parent, DownloadCertificateDialog* dialog);
bool ready_to_download () const;
- void download (wxStaticText* message);
+ void do_download (wxStaticText* message);
+ wxString name () const;
private:
void finish_download (std::string serial, wxStaticText* message);
_pages.push_back (new DolbyDoremiCertificatePanel (_notebook, this));
_setup.push_back (false);
- _notebook->AddPage (_pages.back(), _("Dolby / Doremi"), true);
+
+ BOOST_FOREACH (DownloadCertificatePanel* i, _pages) {
+ _notebook->AddPage (i, i->name(), true);
+ }
_download = new wxButton (this, wxID_ANY, _("Download"));
sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
/*
- Copyright (C) 2014-2015 Carl Hetherington <cth@carlh.net>
+ Copyright (C) 2014-2018 Carl Hetherington <cth@carlh.net>
This file is part of DCP-o-matic.
#include "wx_util.h"
#include "download_certificate_panel.h"
+#include "lib/signal_manager.h"
#include <dcp/util.h>
#include <dcp/exceptions.h>
#include <boost/bind.hpp>
{
return _certificate;
}
+
+void
+DownloadCertificatePanel::download (wxStaticText* message)
+{
+ message->SetLabel (_("Downloading certificate"));
+
+ /* Hack: without this the SetLabel() above has no visible effect */
+ wxMilliSleep (200);
+
+ signal_manager->when_idle (boost::bind (&DownloadCertificatePanel::do_download, this, message));
+}
/* Do any setup that may take a noticeable amount of time */
virtual void setup () {}
virtual bool ready_to_download () const = 0;
- virtual void download (wxStaticText* message) = 0;
+ virtual void do_download (wxStaticText* message) = 0;
+ virtual wxString name () const = 0;
+ void download (wxStaticText* message);
void load (boost::filesystem::path);
boost::optional<dcp::Certificate> certificate () const;