From 988ed4fac88965f2fc260f55a05e2db87bb1ecb8 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Mon, 3 Apr 2017 23:41:24 +0100 Subject: Confirm overwrite of existing DCP when creating a new one. --- src/tools/dcpomatic.cc | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'src/tools') diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 92de9a1f0..f94c2ac54 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -496,6 +496,16 @@ private: } } + + /* Remove any existing DCP if the user agrees */ + boost::filesystem::path const dcp_dir = _film->dir (_film->dcp_name(), false); + if (boost::filesystem::exists (dcp_dir)) { + if (!confirm_dialog (this, wxString::Format (_("Do you want to overwrite the existing DCP %s?"), std_to_wx(dcp_dir.string()).data()))) { + return; + } + boost::filesystem::remove_all (dcp_dir); + } + try { /* It seems to make sense to auto-save metadata here, since the make DCP may last a long time, and crashes/power failures are moderately likely. -- cgit v1.2.3