diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-05-25 10:23:13 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-05-25 10:23:13 +0100 |
| commit | f77ac3e26fc89e33d88f1f932a3f3f3bda329d75 (patch) | |
| tree | 82bb0bd323ea3398d78191a5e87f9699ae98388e /src | |
| parent | c180f317d5a8b27dd191c1f2228ceb6fc4039393 (diff) | |
Nag about potential problems when remaking the decryption chain.
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/config.h | 1 | ||||
| -rw-r--r-- | src/wx/config_dialog.cc | 32 |
2 files changed, 29 insertions, 4 deletions
diff --git a/src/lib/config.h b/src/lib/config.h index 44708a24f..970810a77 100644 --- a/src/lib/config.h +++ b/src/lib/config.h @@ -321,6 +321,7 @@ public: enum Nag { NAG_DKDM_CONFIG, NAG_ENCRYPTED_METADATA, + NAG_REMAKE_DECRYPTION_CHAIN, NAG_COUNT }; diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc index 7d999e14b..a62164896 100644 --- a/src/wx/config_dialog.cc +++ b/src/wx/config_dialog.cc @@ -1,5 +1,5 @@ /* - Copyright (C) 2012-2016 Carl Hetherington <cth@carlh.net> + Copyright (C) 2012-2017 Carl Hetherington <cth@carlh.net> This file is part of DCP-o-matic. @@ -33,6 +33,7 @@ #include "make_chain_dialog.h" #include "email_dialog.h" #include "name_format_editor.h" +#include "nag_dialog.h" #include "lib/config.h" #include "lib/ratio.h" #include "lib/filter.h" @@ -66,6 +67,13 @@ using boost::function; using boost::optional; using dcp::locale_convert; +static +void +do_nothing () +{ + +} + class Page { public: @@ -793,11 +801,13 @@ public: wxString title, int border, function<void (shared_ptr<dcp::CertificateChain>)> set, - function<shared_ptr<const dcp::CertificateChain> (void)> get + function<shared_ptr<const dcp::CertificateChain> (void)> get, + function<void (void)> nag_remake ) : wxPanel (parent) , _set (set) , _get (get) + , _nag_remake (nag_remake) { wxFont subheading_font (*wxNORMAL_FONT); subheading_font.SetWeight (wxFONTWEIGHT_BOLD); @@ -1026,6 +1036,8 @@ private: intermediate_common_name = i->subject_common_name (); } + _nag_remake (); + MakeChainDialog* d = new MakeChainDialog ( this, subject_organization_name, @@ -1133,6 +1145,7 @@ private: shared_ptr<dcp::CertificateChain> _chain; boost::function<void (shared_ptr<dcp::CertificateChain>)> _set; boost::function<shared_ptr<const dcp::CertificateChain> (void)> _get; + boost::function<void (void)> _nag_remake; }; class KeysPage : public StandardPage @@ -1161,7 +1174,8 @@ private: _signer = new CertificateChainEditor ( _panel, _("Signing DCPs and KDMs"), _border, boost::bind (&Config::set_signer_chain, Config::instance (), _1), - boost::bind (&Config::signer_chain, Config::instance ()) + boost::bind (&Config::signer_chain, Config::instance ()), + boost::bind (&do_nothing) ); _panel->GetSizer()->Add (_signer); @@ -1169,7 +1183,8 @@ private: _decryption = new CertificateChainEditor ( _panel, _("Decrypting KDMs"), _border, boost::bind (&Config::set_decryption_chain, Config::instance (), _1), - boost::bind (&Config::decryption_chain, Config::instance ()) + boost::bind (&Config::decryption_chain, Config::instance ()), + boost::bind (&KeysPage::nag_remake_decryption_chain, this) ); _panel->GetSizer()->Add (_decryption); @@ -1229,6 +1244,15 @@ private: _decryption->config_changed (); } + void nag_remake_decryption_chain () + { + NagDialog::maybe_nag ( + _panel, + Config::NAG_REMAKE_DECRYPTION_CHAIN, + _("If you continue with this operation you will no longer be able to use any DKDMs that you have created. Also, any KDMs that have been sent to you will become useless. Proceed with caution!") + ); + } + CertificateChainEditor* _signer; CertificateChainEditor* _decryption; wxButton* _export_decryption_certificate; |
