From ccc07eebc492d74c351c235584fd708c46b5b656 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 24 Apr 2013 22:30:05 +0100 Subject: Fix #124 (allow use of existing directories for new films). --- src/tools/dvdomatic.cc | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) (limited to 'src/tools') diff --git a/src/tools/dvdomatic.cc b/src/tools/dvdomatic.cc index 2a995bee8..b161ac7e3 100644 --- a/src/tools/dvdomatic.cc +++ b/src/tools/dvdomatic.cc @@ -301,9 +301,17 @@ private: if (r == wxID_OK) { - if (boost::filesystem::exists (d->get_path())) { - error_dialog (this, std_to_wx (String::compose (wx_to_std (_("The directory %1 already exists.")), d->get_path().c_str()))); - return; + if (boost::filesystem::exists (d->get_path()) && !boost::filesystem::is_empty(d->get_path())) { + if (!confirm_dialog ( + this, + std_to_wx ( + String::compose (wx_to_std (_("The directory %1 already exists and is not empty. " + "Are you sure you want to use it?")), + d->get_path().c_str()) + ) + )) { + return; + } } maybe_save_then_delete_film (); -- cgit v1.2.3