Nag about deletion of DKDMs.
authorCarl Hetherington <cth@carlh.net>
Thu, 28 Mar 2019 00:12:01 +0000 (00:12 +0000)
committerCarl Hetherington <cth@carlh.net>
Fri, 10 May 2019 22:43:42 +0000 (23:43 +0100)
src/lib/config.h
src/tools/dcpomatic_kdm.cc
src/wx/wx_util.cc

index 8cc25d7377d6d132e6a8e3934260111e93215083..1d0501ce4d7487d1b61a9ec980f2bcd312c1d0de 100644 (file)
@@ -376,6 +376,7 @@ public:
                /* Not really a nag but it's the same idea */
                NAG_INITIAL_SETUP,
                NAG_IMPORT_DECRYPTION_CHAIN,
+               NAG_DELETE_DKDM,
                NAG_COUNT
        };
 
index 3b97fa2da2cb57882eb0ab7c29421ee27182e103..2b0d25836dbf4cb0e77234f09a2fe10e99ef5f1f 100644 (file)
@@ -1,5 +1,5 @@
 /*
-    Copyright (C) 2015-2017 Carl Hetherington <cth@carlh.net>
+    Copyright (C) 2015-2019 Carl Hetherington <cth@carlh.net>
 
     This file is part of DCP-o-matic.
 
@@ -33,6 +33,7 @@
 #include "wx/editable_list.h"
 #include "wx/static_text.h"
 #include "wx/dcpomatic_button.h"
+#include "wx/nag_dialog.h"
 #include "lib/config.h"
 #include "lib/util.h"
 #include "lib/screen.h"
@@ -523,6 +524,14 @@ private:
                        return;
                }
 
+               if (NagDialog::maybe_nag (
+                           this, Config::NAG_DELETE_DKDM,
+                           _("You are about to remove a DKDM.  This will make it impossible to decrypt the DCP that the DKDM was made for, and it cannot be undone.  "
+                             "Are you sure?"),
+                           true)) {
+                       return;
+               }
+
                _dkdm->Delete (dkdm_to_id (removed));
                shared_ptr<DKDMGroup> dkdms = Config::instance()->dkdms ();
                dkdms->remove (removed);
index bfc7c30690936ec405cd0833c6719030d1403d62..1a537c0875759f16cafe388a1a4f739cb46cde22 100644 (file)
@@ -158,6 +158,7 @@ message_dialog (wxWindow* parent, wxString m)
        d->Destroy ();
 }
 
+/** @return true if the user answered "yes" */
 bool
 confirm_dialog (wxWindow* parent, wxString m)
 {