X-Git-Url: https://git.carlh.net/gitweb/?a=blobdiff_plain;f=src%2Fwx%2Frecreate_chain_dialog.cc;h=92e71af3497f1c05645e5a00144f7daed466cc7f;hb=5b72ef5e33a289dc99815b173266c1c43aa54cf2;hp=b59e99ddcf82295513fae2082affbbb9ed2466ca;hpb=6d770c4c8c79569871edc20253f29f9ea00539e6;p=dcpomatic.git diff --git a/src/wx/recreate_chain_dialog.cc b/src/wx/recreate_chain_dialog.cc index b59e99ddc..92e71af34 100644 --- a/src/wx/recreate_chain_dialog.cc +++ b/src/wx/recreate_chain_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2018 Carl Hetherington + Copyright (C) 2018-2019 Carl Hetherington This file is part of DCP-o-matic. @@ -20,26 +20,28 @@ #include "recreate_chain_dialog.h" #include "wx_util.h" +#include "static_text.h" +#include "check_box.h" #include "lib/config.h" -#include "lib/cinema_kdms.h" -#include using std::list; using std::string; - -RecreateChainDialog::RecreateChainDialog (wxWindow* parent) - : QuestionDialog (parent, _("Certificate chain"), _("Recreate signing certificates"), _("Do nothing")) +using boost::optional; +#if BOOST_VERSION >= 106100 +using namespace boost::placeholders; +#endif + +RecreateChainDialog::RecreateChainDialog (wxWindow* parent, wxString title, wxString message, wxString cancel, optional nag) + : QuestionDialog (parent, _("Certificate chain"), title, cancel) + , _nag (nag) { - wxString const message = _("The certificate chain that DCP-o-matic uses for signing DCPs and KDMs contains a small error\n" - "which will prevent DCPs from being validated correctly on some systems. Do you want to re-create\n" - "the certificate chain for signing DCPs and KDMs?"); - - _sizer->Add (new wxStaticText (this, wxID_ANY, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); - - wxCheckBox* shut_up = new wxCheckBox (this, wxID_ANY, _("Don't ask this again")); - _sizer->Add (shut_up, 0, wxALL, DCPOMATIC_DIALOG_BORDER); + _sizer->Add (new StaticText (this, message), 1, wxEXPAND | wxALL, DCPOMATIC_DIALOG_BORDER); - shut_up->Bind (wxEVT_CHECKBOX, bind (&RecreateChainDialog::shut_up, this, _1)); + if (nag) { + wxCheckBox* shut_up = new CheckBox (this, _("Don't ask this again")); + _sizer->Add (shut_up, 0, wxALL, DCPOMATIC_DIALOG_BORDER); + shut_up->Bind (wxEVT_CHECKBOX, bind (&RecreateChainDialog::shut_up, this, _1)); + } layout (); } @@ -47,6 +49,5 @@ RecreateChainDialog::RecreateChainDialog (wxWindow* parent) void RecreateChainDialog::shut_up (wxCommandEvent& ev) { - std::cout << "set nagged " << ev.IsChecked() << "\n"; - Config::instance()->set_nagged (Config::NAG_BAD_SIGNER_CHAIN, ev.IsChecked()); + Config::instance()->set_nagged(*_nag, ev.IsChecked()); }