X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2Fwx%2Fdownload_certificate_dialog.cc;h=ec9f6dade09bf3c8f6d280dad46d5d6fbe92e364;hb=9001a63be211fd8e97431f8fc07c66af01554f5a;hp=0561d63cb22e7f05a6d0d0d0c013cbe36e8a120b;hpb=5acc1fe1a98bbefbc3c3750f3e681b00642e8eee;p=dcpomatic.git diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc index 0561d63cb..ec9f6dade 100644 --- a/src/wx/download_certificate_dialog.cc +++ b/src/wx/download_certificate_dialog.cc @@ -1,25 +1,32 @@ /* - Copyright (C) 2014-2015 Carl Hetherington + Copyright (C) 2014-2018 Carl Hetherington - This program is free software; you can redistribute it and/or modify + This file is part of DCP-o-matic. + + DCP-o-matic is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. - This program is distributed in the hope that it will be useful, + DCP-o-matic is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. + along with DCP-o-matic. If not, see . */ #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; @@ -31,20 +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)); - _setup.push_back (false); - _notebook->AddPage (_pages.back(), _("Dolby / Doremi"), 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"))); + + BOOST_FOREACH (DownloadCertificatePanel* i, _pages) { + _notebook->AddPage (i, i->name(), true); + } + wxSizer* buttons = CreateSeparatedButtonSizer (wxOK | wxCANCEL); if (buttons) { sizer->Add (buttons, wxSizerFlags().Expand().DoubleBorder()); @@ -53,11 +67,14 @@ 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); + + SetMinSize (wxSize(640, -1)); + + setup_sensitivity (); } DownloadCertificateDialog::~DownloadCertificateDialog () @@ -68,7 +85,7 @@ DownloadCertificateDialog::~DownloadCertificateDialog () void DownloadCertificateDialog::download () { - _pages[_notebook->GetSelection()]->download (_message); + _pages[_notebook->GetSelection()]->download (); } dcp::Certificate @@ -88,17 +105,11 @@ DownloadCertificateDialog::setup_sensitivity () if (ok) { ok->Enable (static_cast(p->certificate ())); } - } void -DownloadCertificateDialog::page_changed (wxNotebookEvent &) +DownloadCertificateDialog::page_changed (wxNotebookEvent& ev) { - int const n = _notebook->GetSelection(); - if (!_setup[n]) { - _pages[n]->setup (); - _setup[n] = true; - } - setup_sensitivity (); + ev.Skip (); }