virtual ~DKDMBase () {}
virtual std::string name () const = 0;
virtual void as_xml (xmlpp::Element *) const = 0;
+ /** @return true if this thing is, or contains, any actual DKDM */
+ virtual bool contains_dkdm() const = 0;
static std::shared_ptr<DKDMBase> read (cxml::ConstNodePtr node);
std::string name () const override;
void as_xml (xmlpp::Element *) const override;
+ bool contains_dkdm() const override {
+ return true;
+ }
dcp::EncryptedKDM dkdm () const {
return _dkdm;
void as_xml (xmlpp::Element *) const override;
+ bool contains_dkdm() const override;
+
std::list<std::shared_ptr<DKDMBase>> children () const {
return _children;
}
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;
+ if (removed->contains_dkdm()) {
+ 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));