diff options
| -rw-r--r-- | src/tools/dcpomatic.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/tools/dcpomatic.cc b/src/tools/dcpomatic.cc index 979672fb4..11181ae58 100644 --- a/src/tools/dcpomatic.cc +++ b/src/tools/dcpomatic.cc @@ -762,7 +762,17 @@ private: ); if (dialog.ShowModal() == wxID_OK) { - save_all_config_as_zip(wx_to_std(dialog.GetPath())); + auto const path = boost::filesystem::path(wx_to_std(dialog.GetPath())); + if (boost::filesystem::exists(path)) { + boost::system::error_code ec; + boost::filesystem::remove(path, ec); + if (ec) { + error_dialog(nullptr, _("Could not remove existing preferences file"), std_to_wx(path.string())); + return; + } + } + + save_all_config_as_zip(path); } } |
