diff --git a/gtk2_ardour/save_as_dialog.cc b/gtk2_ardour/save_as_dialog.cc index f696d131eb..2f9c7c517f 100644 --- a/gtk2_ardour/save_as_dialog.cc +++ b/gtk2_ardour/save_as_dialog.cc @@ -105,9 +105,19 @@ SaveAsDialog::no_include_toggled () void SaveAsDialog::name_entry_changed () { - if (!new_name_entry.get_text().empty()) { - set_response_sensitive (RESPONSE_OK); + if (new_name_entry.get_text().empty()) { + set_response_sensitive (RESPONSE_OK, false); + return; } + + std::string dir = Glib::build_filename (new_parent_folder(), new_name_entry.get_text()); + + if (Glib::file_test (dir, Glib::FILE_TEST_EXISTS)) { + set_response_sensitive (RESPONSE_OK, false); + return; + } + + set_response_sensitive (RESPONSE_OK); } string