Disable sketch folder deletion

This feature was too sketchy for most users, we don't need it
This commit is contained in:
Stef Tervelde
2025-02-05 13:40:24 +01:00
parent 365d36e4c1
commit 9186b8d0cd
2 changed files with 11 additions and 3 deletions
+10 -3
View File
@@ -659,11 +659,17 @@ public class Sketch {
return;
}
if(currentIndex == 0){
JOptionPane.showMessageDialog(editor,
Language.interpolate("warn.delete.sketch_last", getName()),
Language.text("warn.delete"),
JOptionPane.ERROR_MESSAGE);
return;
}
// confirm deletion with user, yes/no
Object[] options = { Language.text("prompt.ok"), Language.text("prompt.cancel") };
String prompt = (currentIndex == 0) ?
Language.interpolate("warn.delete.sketch_folder", getName()) :
Language.interpolate("warn.delete.sketch_file", current.getPrettyName());
String prompt = Language.interpolate("warn.delete.sketch_file", current.getPrettyName());
int result = JOptionPane.showOptionDialog(editor,
prompt,
Language.text("warn.delete"),
@@ -672,6 +678,7 @@ public class Sketch {
null,
options,
options[0]);
// TODO: Remove the code to remove the entire sketch folder
if (result == JOptionPane.YES_OPTION) {
if (currentIndex == 0) { // delete the entire sketch
// need to unset all the modified flags, otherwise tries
@@ -600,6 +600,7 @@ contrib.import.errors.link = Error: The library %s has a strange looking downloa
warn.delete = Delete
warn.delete.sketch_folder = Are you sure you want to delete this sketch?\nThis will remove the entire “%s” folder.
warn.delete.sketch_last = Sorry deleting the sketch folder through Processing is not supported.
warn.delete.sketch_file = Are you sure you want to delete “%s”?
warn.cannot_change_mode.title = Cannot change mode
warn.cannot_change_mode.body = Cannot change mode,\nbecause “%s” mode is not compatible with current mode.