diff --git a/app/PdeSketch.java b/app/PdeSketch.java index 746cb94d7..b2d6a09ce 100644 --- a/app/PdeSketch.java +++ b/app/PdeSketch.java @@ -424,6 +424,16 @@ public class PdeSketch { if (!dataFolder.exists()) dataFolder.mkdirs(); destFile = new File(dataFolder, filename); } + + // make sure they aren't the same file + if (sourceFile.equals(destFile)) { + PdeBase.showWarning("You can't fool me", + "This file has already been copied to the\n" + + "location where you're trying to add it.\n" + + "I ain't not doin nuthin'.", null); + return; + } + try { PdeBase.copyFile(sourceFile, destFile); } catch (IOException e) { @@ -1263,14 +1273,6 @@ public class PdeSketch { } - /** - * Returns the path to the sketch folder. - * Used by PdeEditor.handleSaveAs() - */ - //public String getPath() { - //return sketchFolder.getPath(); - //} - /** * Returns path to the main .pde file for this sketch. */ diff --git a/todo.txt b/todo.txt index 83786b62d..409f4d604 100644 --- a/todo.txt +++ b/todo.txt @@ -26,6 +26,11 @@ X start working on "save as" 040622 monday X finish "save as" +X adding files to data folder that are already in the data folder +X makes the file zero, because of internal error +X added something to check to make sure they weren't the same +X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1076358515 + _ after using sketchbook menu as popup, disappears from file menu _ re-implement history _ write sketchbook.clean() @@ -44,10 +49,6 @@ _ comments -> embedding in applet text? (ala javadoc) _ would this help casey with the examples? -_ adding files to data folder that are already in the data folder -_ makes the file zero, because of internal error -_ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1076358515 - discuss with casey _ is the sketch folder something that is never seen by the user?