more saving fixes

This commit is contained in:
benfry
2005-04-19 01:09:33 +00:00
parent 1a0578aeb2
commit c5dec94e31
2 changed files with 20 additions and 13 deletions

View File

@@ -752,7 +752,9 @@ public class Sketch {
// if the new folder already exists, then need to remove
// its contents before copying everything over
// (user will have already been warned)
Base.removeDir(newFolder);
if (newFolder.exists()) {
Base.removeDir(newFolder);
}
// in fact, you can't do this on windows because it tries
// to go into the same folder, but it happens on osx a lot.
@@ -774,7 +776,9 @@ public class Sketch {
code[0].name = newName;
// write the contents to the renamed file
// (this may be resaved if the code is modified)
code[0].save();
code[0].modified = true;
//code[0].save();
//System.out.println("modified is " + modified);
// change the other paths
String oldName = name;
@@ -1968,7 +1972,9 @@ public class Sketch {
} else {
// check to see if each modified code file can be written to
for (int i = 0; i < codeCount; i++) {
if (code[i].modified && !code[i].file.canWrite()) {
if (code[i].modified &&
!code[i].file.canWrite() &&
code[i].file.exists()) {
//System.err.println("found a read-only file " + code[i].file);
return true;
}

View File

@@ -30,6 +30,17 @@ first, it asks you if you want to save but mentions the pre-rename
name. But I hit yes, quit, came back in, and all seemed right in the
world.
X "save as" not actually saving properly
File>New
edit file...
File>Save As
File>Open some other file
File>Open original file
file is empty.
the only way to make File>Save As actually save new files, as far as i
can tell, is to Save As once, make at least one change, then Save.
pending
_ rename video.Camera to video.Video ? Capture ?
_ VideoInput VideoOutput, SoundInput, SoundOutput or AudioInput/AudioOutput
@@ -61,16 +72,6 @@ unhide "a_2"
unhide "a"
where did "a_2" go ?
(74) "save as" not actually saving properly
File>New
edit file...
File>Save As
File>Open some other file
File>Open original file
file is empty.
the only way to make File>Save As actually save new files, as far as i
can tell, is to Save As once, make at least one change, then Save.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .