don't allow "add files to sketch" to overwrite old files

This commit is contained in:
benfry
2004-06-21 16:49:08 +00:00
parent fe7db2e58d
commit e235951035
2 changed files with 15 additions and 12 deletions

View File

@@ -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.
*/

View File

@@ -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?