X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fdownload_certificate_dialog.cc;h=21a675ac70c0b74ae7d886d4e9c2a2d7ccd86470;hb=9c1bb2e5ca7c80c4e26b1b2e41159aa171360a94;hp=955f25049d5ff7419dbe093c2b3b60ff1f83791a;hpb=3828baf56467224f5d44049bf1e7a7ed11f43a05;p=dcpomatic.git diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc index 955f25049..21a675ac7 100644 --- a/src/wx/download_certificate_dialog.cc +++ b/src/wx/download_certificate_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington This file is part of DCP-o-matic. @@ -19,7 +19,11 @@ */ #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 "static_text.h" #include "wx_util.h" using boost::optional; @@ -32,20 +36,25 @@ 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)); - _setup.push_back (false); - _notebook->AddPage (_pages.back(), _("Dolby / Doremi"), true); - _download = new wxButton (this, wxID_ANY, _("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)); + + BOOST_FOREACH (DownloadCertificatePanel* i, _pages) { + _notebook->AddPage (i, i->name(), true); + } + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); if (buttons) { sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); @@ -54,11 +63,12 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent) SetSizerAndFit (sizer); _notebook->Bind (wxEVT_NOTEBOOK_PAGE_CHANGED, &DownloadCertificateDialog::page_changed, this); - _download->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DownloadCertificateDialog::download, this)); + _download->Bind (wxEVT_BUTTON, boost::bind (&DownloadCertificateDialog::download, this)); _download->Enable (false); - wxNotebookEvent ev; - page_changed (ev); + _notebook->SetSelection (0); + + setup_sensitivity (); } DownloadCertificateDialog::~DownloadCertificateDialog () @@ -69,7 +79,7 @@ DownloadCertificateDialog::~DownloadCertificateDialog () void DownloadCertificateDialog::download () { - _pages[_notebook->GetSelection()]->download (_message); + _pages[_notebook->GetSelection()]->download (); } dcp::Certificate @@ -89,17 +99,10 @@ DownloadCertificateDialog::setup_sensitivity () if (ok) { ok->Enable (static_cast(p->certificate ())); } - } void DownloadCertificateDialog::page_changed (wxNotebookEvent &) { - int const n = _notebook->GetSelection(); - if (!_setup[n]) { - _pages[n]->setup (); - _setup[n] = true; - } - setup_sensitivity (); }