From fe8c88be09e7927997add14980def447751f9ee8 Mon Sep 17 00:00:00 2001 From: Greg Palmer Date: Thu, 18 Jul 2013 21:45:00 -0700 Subject: [PATCH 1/6] Add CONFIRM_FOLDER_DELETE to strings --- src/nls/root/strings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index a9219a349a9..69011977a1c 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -103,6 +103,7 @@ 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" : "Are you sure you want to delete the folder?", "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?", From 724d89dc7d1ad0da6623fd96420fed4d01ae2190 Mon Sep 17 00:00:00 2001 From: Greg Palmer Date: Thu, 18 Jul 2013 22:32:39 -0700 Subject: [PATCH 2/6] Add CONFIRM_FOLDER_DELETE_TITLE to strings --- src/nls/root/strings.js | 1 + 1 file changed, 1 insertion(+) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index 69011977a1c..d7e71c11ab8 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -103,6 +103,7 @@ 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?", "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?", From 37ffb17640c1774bb8eccd0b27812f92a2217eaf Mon Sep 17 00:00:00 2001 From: Greg Palmer Date: Thu, 18 Jul 2013 22:33:40 -0700 Subject: [PATCH 3/6] Confirm folder delete modal fixes #4446 --- src/document/DocumentCommandHandlers.js | 32 ++++++++++++++++++++++++- 1 file changed, 31 insertions(+), 1 deletion(-) diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 351957ba47d..4f090c7145b 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -1150,7 +1150,37 @@ 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.OK + } + ] + ) + .done(function (id) { + if (id === Dialogs.DIALOG_BTN_CANCEL) { + return; + } else 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 */ From c77d55ddec545cef587028c2ac4a1a9ffabb0fa9 Mon Sep 17 00:00:00 2001 From: Greg Palmer Date: Thu, 18 Jul 2013 23:59:51 -0700 Subject: [PATCH 4/6] Add folder name template to CONFIRM_FOLDER_DELETE --- src/nls/root/strings.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index d7e71c11ab8..282723ce7b9 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -104,7 +104,7 @@ define({ "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?", + "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?", From da97d1d1cbe2c0b52e2917ec3ad97cac2c2c351c Mon Sep 17 00:00:00 2001 From: Greg Palmer Date: Fri, 19 Jul 2013 00:04:02 -0700 Subject: [PATCH 5/6] Update from 'OK' to 'Delete' button text --- src/document/DocumentCommandHandlers.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 4f090c7145b..98fac7e3b09 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -1167,14 +1167,12 @@ define(function (require, exports, module) { { className : Dialogs.DIALOG_BTN_CLASS_PRIMARY, id : Dialogs.DIALOG_BTN_OK, - text : Strings.OK + text : Strings.CMD_FILE_DELETE } ] ) .done(function (id) { - if (id === Dialogs.DIALOG_BTN_CANCEL) { - return; - } else if (id === Dialogs.DIALOG_BTN_OK) { + if (id === Dialogs.DIALOG_BTN_OK) { ProjectManager.deleteItem(entry); } }); From ba97c12cb208a687c7b40ffab603d67865fbbb2a Mon Sep 17 00:00:00 2001 From: Greg Palmer Date: Sat, 20 Jul 2013 10:22:10 -0700 Subject: [PATCH 6/6] Update button text to new DELETE string --- src/document/DocumentCommandHandlers.js | 2 +- src/nls/root/strings.js | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/src/document/DocumentCommandHandlers.js b/src/document/DocumentCommandHandlers.js index 98fac7e3b09..d514244e37d 100644 --- a/src/document/DocumentCommandHandlers.js +++ b/src/document/DocumentCommandHandlers.js @@ -1167,7 +1167,7 @@ define(function (require, exports, module) { { className : Dialogs.DIALOG_BTN_CLASS_PRIMARY, id : Dialogs.DIALOG_BTN_OK, - text : Strings.CMD_FILE_DELETE + text : Strings.DELETE } ] ) diff --git a/src/nls/root/strings.js b/src/nls/root/strings.js index a0745ee853d..08609659d4b 100644 --- a/src/nls/root/strings.js +++ b/src/nls/root/strings.js @@ -280,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)",