BOOST_FOREACH.
[dcpomatic.git] / src / wx / download_certificate_dialog.cc
index bccfbb5c24067b9434f74da3926a30b54a676b8c..627223c460d77d10c8b5d086645119db47efd343 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    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 "dolby_doremi_certificate_panel.h"
+#include "barco_alchemy_certificate_panel.h"
+#include "christie_certificate_panel.h"
+#include "gdc_certificate_panel.h"
+#include "qube_certificate_panel.h"
 #include "download_certificate_dialog.h"
+#include "static_text.h"
 #include "wx_util.h"
+#include "dcpomatic_button.h"
 
 using boost::optional;
 
@@ -32,22 +38,27 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
        _notebook = new wxNotebook (this, wxID_ANY);
        sizer->Add (_notebook, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER);
 
-       _pages.push_back (new DolbyDoremiCertificatePanel (_notebook, this));
-
-       BOOST_FOREACH (DownloadCertificatePanel* i, _pages) {
-               _notebook->AddPage (i, i->name(), true);
-       }
-
-       _download = new wxButton (this, wxID_ANY, _("Download"));
+       _download = new Button (this, _("Download"));
        sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP);
 
-       _message = new wxStaticText (this, wxID_ANY, wxT (""));
+       _message = new StaticText (this, wxT (""));
        sizer->Add (_message, 0, wxALL, DCPOMATIC_SIZER_GAP);
        wxFont font = _message->GetFont();
        font.SetStyle (wxFONTSTYLE_ITALIC);
        font.SetPointSize (font.GetPointSize() - 1);
        _message->SetFont (font);
 
+       _pages.push_back (new DolbyDoremiCertificatePanel (this));
+       _pages.push_back (new BarcoAlchemyCertificatePanel (this));
+       _pages.push_back (new ChristieCertificatePanel (this));
+       _pages.push_back (new GDCCertificatePanel (this));
+       _pages.push_back (new QubeCertificatePanel (this, N_("QXI")));
+       _pages.push_back (new QubeCertificatePanel (this, N_("QXPD")));
+
+       for (auto i: _pages) {
+               _notebook->AddPage (i, i->name(), true);
+       }
+
        wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL);
        if (buttons) {
                sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder());
@@ -59,8 +70,11 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent)
        _download->Bind (wxEVT_BUTTON, boost::bind (&DownloadCertificateDialog::download, this));
        _download->Enable (false);
 
-       wxNotebookEvent ev;
-       page_changed (ev);
+       _notebook->SetSelection (0);
+
+       SetMinSize (wxSize(640, -1));
+
+       setup_sensitivity ();
 }
 
 DownloadCertificateDialog::~DownloadCertificateDialog ()
@@ -71,7 +85,7 @@ DownloadCertificateDialog::~DownloadCertificateDialog ()
 void
 DownloadCertificateDialog::download ()
 {
-       _pages[_notebook->GetSelection()]->download (_message);
+       _pages[_notebook->GetSelection()]->download ();
 }
 
 dcp::Certificate
@@ -94,7 +108,8 @@ DownloadCertificateDialog::setup_sensitivity ()
 }
 
 void
-DownloadCertificateDialog::page_changed (wxNotebookEvent &)
+DownloadCertificateDialog::page_changed (wxNotebookEvent& ev)
 {
        setup_sensitivity ();
+       ev.Skip ();
 }