diff options
| author | Carl Hetherington <cth@carlh.net> | 2017-04-03 23:41:24 +0100 |
|---|---|---|
| committer | Carl Hetherington <cth@carlh.net> | 2017-04-03 23:41:24 +0100 |
| commit | 988ed4fac88965f2fc260f55a05e2db87bb1ecb8 (patch) | |
| tree | 4b0899703cfbcca3b2f9c880446aa570dddb73c5 /src/tools | |
| parent | 77da11b5e09820f8f5babac6d17ff35c0098c96e (diff) | |
Confirm overwrite of existing DCP when creating a new one.
Diffstat (limited to 'src/tools')
| -rw-r--r-- | src/tools/dcpomatic.cc | 10 |
1 files changed, 10 insertions, 0 deletions
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. |
