Nag/warn when removing KDM decryption certificate. v2.13.137
authorCarl Hetherington <cth@carlh.net>
Tue, 26 Mar 2019 00:44:54 +0000 (00:44 +0000)
committerCarl Hetherington <cth@carlh.net>
Tue, 26 Mar 2019 00:44:54 +0000 (00:44 +0000)
src/lib/config.h
src/wx/config_dialog.cc
src/wx/config_dialog.h

index 7f8dd0cd4be183b5259009fc1cc0d6c65f4243ce..7d21964a42df051125ce084150c3171018a3041d 100644 (file)
@@ -366,7 +366,7 @@ public:
        enum Nag {
                NAG_DKDM_CONFIG,
                NAG_ENCRYPTED_METADATA,
-               NAG_REMAKE_DECRYPTION_CHAIN,
+               NAG_ALTER_DECRYPTION_CHAIN,
                NAG_BAD_SIGNER_CHAIN,
                /* Not really a nag but it's the same idea */
                NAG_INITIAL_SETUP,
index a9cf7da07ab5cf2ab3603905904d50dcecadc401..0a7e45221c83e3e9a232f6020afecd6954589af9 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2012-2018 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2012-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -332,12 +332,12 @@ CertificateChainEditor::CertificateChainEditor (
        int border,
        function<void (shared_ptr<dcp::CertificateChain>)> set,
        function<shared_ptr<const dcp::CertificateChain> (void)> get,
-       function<bool (void)> nag_remake
+       function<bool (void)> nag_alter
        )
        : wxDialog (parent, wxID_ANY, title)
        , _set (set)
        , _get (get)
-       , _nag_remake (nag_remake)
+       , _nag_alter (nag_alter)
 {
        wxFont subheading_font (*wxNORMAL_FONT);
        subheading_font.SetWeight (wxFONTWEIGHT_BOLD);
@@ -499,6 +499,11 @@ CertificateChainEditor::add_certificate ()
 void
 CertificateChainEditor::remove_certificate ()
 {
+       if (_nag_alter()) {
+               /* Cancel was clicked */
+               return;
+       }
+
        int i = _certificates->GetNextItem (-1, wxLIST_NEXT_ALL, wxLIST_STATE_SELECTED);
        if (i == -1) {
                return;
@@ -634,7 +639,7 @@ CertificateChainEditor::remake_certificates ()
                intermediate_common_name = i->subject_common_name ();
        }
 
-       if (_nag_remake()) {
+       if (_nag_alter()) {
                /* Cancel was clicked */
                return;
        }
@@ -793,7 +798,7 @@ KeysPage::decryption_advanced ()
                _panel, _("Decrypting KDMs"), _border,
                bind (&Config::set_decryption_chain, Config::instance (), _1),
                bind (&Config::decryption_chain, Config::instance ()),
-               bind (&KeysPage::nag_remake_decryption_chain, this)
+               bind (&KeysPage::nag_alter_decryption_chain, this)
                );
 
        c->ShowModal();
@@ -889,11 +894,11 @@ KeysPage::import_decryption_chain_and_key ()
 }
 
 bool
-KeysPage::nag_remake_decryption_chain ()
+KeysPage::nag_alter_decryption_chain ()
 {
        return NagDialog::maybe_nag (
                _panel,
-               Config::NAG_REMAKE_DECRYPTION_CHAIN,
+               Config::NAG_ALTER_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!"),
                true
                );
index 896b463d819d01af0c889035bc41559f90b9ef6a..ab2553e5661d16382109acf14911d34fac454237 100644 (file)
@@ -120,7 +120,7 @@ public:
                int border,
                boost::function<void (boost::shared_ptr<dcp::CertificateChain>)> set,
                boost::function<boost::shared_ptr<const dcp::CertificateChain> (void)> get,
-               boost::function<bool (void)> nag_remake
+               boost::function<bool (void)> nag_alter
                );
 
        void add_button (wxWindow* button);
@@ -151,7 +151,7 @@ private:
        wxBoxSizer* _button_sizer;
        boost::function<void (boost::shared_ptr<dcp::CertificateChain>)> _set;
        boost::function<boost::shared_ptr<const dcp::CertificateChain> (void)> _get;
-       boost::function<bool (void)> _nag_remake;
+       boost::function<bool (void)> _nag_alter;
 };
 
 class KeysPage : public StandardPage
@@ -176,7 +176,7 @@ private:
 
        void export_decryption_certificate ();
        void config_changed () {}
-       bool nag_remake_decryption_chain ();
+       bool nag_alter_decryption_chain ();
        void decryption_advanced ();
        void signing_advanced ();
        void export_decryption_chain_and_key ();