diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index d516ae11010..06de2495db1 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -1156,7 +1156,35 @@ define(function (require, exports, module) { function handleFileDelete() { var entry = ProjectManager.getSelectedItem(); - ProjectManager.deleteItem(entry); + if (entry.isDirectory) { + Dialogs.showModalDialog( + DefaultDialogs.DIALOG_ID_EXT_DELETED, + Strings.CONFIRM_FOLDER_DELETE_TITLE, + StringUtils.format( + Strings.CONFIRM_FOLDER_DELETE, + StringUtils.breakableUrl(entry.name) + ), + [ + { + className : Dialogs.DIALOG_BTN_CLASS_NORMAL, + id : Dialogs.DIALOG_BTN_CANCEL, + text : Strings.CANCEL + }, + { + className : Dialogs.DIALOG_BTN_CLASS_PRIMARY, + id : Dialogs.DIALOG_BTN_OK, + text : Strings.DELETE + } + ] + ) + .done(function (id) { + if (id === Dialogs.DIALOG_BTN_OK) { + ProjectManager.deleteItem(entry); + } + }); + } else { + ProjectManager.deleteItem(entry); + } } /** Show the selected sidebar (tree or working set) item in Finder/Explorer */ diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index befccff7048..30d3019b39d 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -103,6 +103,8 @@ define({ "SAVE_CLOSE_MESSAGE" : "Do you want to save the changes you made in the document {0}?", "SAVE_CLOSE_MULTI_MESSAGE" : "Do you want to save your changes to the following files?", "EXT_MODIFIED_TITLE" : "External Changes", + "CONFIRM_FOLDER_DELETE_TITLE" : "Confirm Delete", + "CONFIRM_FOLDER_DELETE" : "Are you sure you want to delete the folder {0}?", "FILE_DELETED_TITLE" : "File Deleted", "EXT_MODIFIED_MESSAGE" : "{0} has been modified on disk, but also has unsaved changes in {APP_NAME}.

Which version do you want to keep?", "EXT_DELETED_MESSAGE" : "{0} has been deleted on disk, but has unsaved changes in {APP_NAME}.

Do you want to keep your changes?", @@ -278,6 +280,7 @@ define({ "DONT_SAVE" : "Don't Save", "SAVE" : "Save", "CANCEL" : "Cancel", + "DELETE" : "Delete", "RELOAD_FROM_DISK" : "Reload from Disk", "KEEP_CHANGES_IN_EDITOR" : "Keep Changes in Editor", "CLOSE_DONT_SAVE" : "Close (Don't Save)",