X-Git-Url: https://main.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Fdownload_certificate_dialog.cc;h=e18723a4a08213a4e59e42c0431b592a8393e5ba;hb=c94d763e07d9e7b029091e1ea64ba4f7758b3d5b;hp=31f6a7b6aa7c4cf5d0d5700183b1ee7cebaf6155;hpb=f0f743c396ecc0684d52a11a6660792a63eaf844;p=dcpomatic.git diff --git a/src/wx/download_certificate_dialog.cc b/src/wx/download_certificate_dialog.cc index 31f6a7b6a..e18723a4a 100644 --- a/src/wx/download_certificate_dialog.cc +++ b/src/wx/download_certificate_dialog.cc @@ -1,24 +1,24 @@ /* Copyright (C) 2014-2015 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 "doremi_certificate_panel.h" -#include "dolby_certificate_panel.h" +#include "dolby_doremi_certificate_panel.h" #include "download_certificate_dialog.h" #include "wx_util.h" @@ -32,12 +32,9 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent) _notebook = new wxNotebook (this, wxID_ANY); sizer->Add (_notebook, 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); - _pages.push_back (new DoremiCertificatePanel (_notebook, this)); - _setup.push_back (false); - _notebook->AddPage (_pages.back(), _("Doremi"), true); - _pages.push_back (new DolbyCertificatePanel (_notebook, this)); + _pages.push_back (new DolbyDoremiCertificatePanel (_notebook, this)); _setup.push_back (false); - _notebook->AddPage (_pages.back(), _("Dolby"), false); + _notebook->AddPage (_pages.back(), _("Dolby / Doremi"), true); _download = new wxButton (this, wxID_ANY, _("Download")); sizer->Add (_download, 0, wxEXPAND | wxALL, DCPOMATIC_SIZER_GAP); @@ -56,11 +53,17 @@ DownloadCertificateDialog::DownloadCertificateDialog (wxWindow* parent) SetSizerAndFit (sizer); - _notebook->Bind (wxEVT_NOTEBOOK_PAGE_CHANGED, boost::bind (&DownloadCertificateDialog::page_changed, this)); - _download->Bind (wxEVT_COMMAND_BUTTON_CLICKED, boost::bind (&DownloadCertificateDialog::download, this)); + _notebook->Bind (wxEVT_NOTEBOOK_PAGE_CHANGED, &DownloadCertificateDialog::page_changed, this); + _download->Bind (wxEVT_BUTTON, boost::bind (&DownloadCertificateDialog::download, this)); _download->Enable (false); - page_changed (); + wxNotebookEvent ev; + page_changed (ev); +} + +DownloadCertificateDialog::~DownloadCertificateDialog () +{ + _notebook->Unbind (wxEVT_NOTEBOOK_PAGE_CHANGED, &DownloadCertificateDialog::page_changed, this); } void @@ -90,7 +93,7 @@ DownloadCertificateDialog::setup_sensitivity () } void -DownloadCertificateDialog::page_changed () +DownloadCertificateDialog::page_changed (wxNotebookEvent &) { int const n = _notebook->GetSelection(); if (!_setup[n]) {