summaryrefslogtreecommitdiff
path: root/src/wx
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-03-26 00:44:54 +0000
committerCarl Hetherington <cth@carlh.net>2019-03-26 00:44:54 +0000
commit72d1f6694f032a6044a4b14ee9ad9cba2b9756f3 (patch)
tree0d233cc9a84b291166659fdcb0dc0825c579fb39 /src/wx
parentcfd3b08c3f5b0fbe145aa94bdcec1166f5f76b90 (diff)
Nag/warn when removing KDM decryption certificate.v2.13.137
Diffstat (limited to 'src/wx')
-rw-r--r--src/wx/config_dialog.cc19
-rw-r--r--src/wx/config_dialog.h6
2 files changed, 15 insertions, 10 deletions
diff --git a/src/wx/config_dialog.cc b/src/wx/config_dialog.cc
index a9cf7da07..0a7e45221 100644
--- a/src/wx/config_dialog.cc
+++ b/src/wx/config_dialog.cc
@@ -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
);
diff --git a/src/wx/config_dialog.h b/src/wx/config_dialog.h
index 896b463d8..ab2553e56 100644
--- a/src/wx/config_dialog.h
+++ b/src/wx/config_dialog.h
@@ -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 ();