mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
loading prev save and restore too? Decisions
This commit is contained in:
@@ -55,7 +55,7 @@ public class AutoSaveUtil {
|
||||
|
||||
public void init(){
|
||||
if(saveTime < 1000) return;
|
||||
saveTime = 10 * 1000;
|
||||
saveTime = 10 * 1000; //TODO: remove
|
||||
timer = new Timer();
|
||||
timer.schedule(new SaveTask(), saveTime, saveTime);
|
||||
isSaving = false;
|
||||
@@ -64,7 +64,7 @@ public class AutoSaveUtil {
|
||||
public void stop(){
|
||||
while(isSaving); // save operation mustn't be interrupted
|
||||
if(timer != null) timer.cancel();
|
||||
//Base.removeDir(autosaveDir);
|
||||
Base.removeDir(autosaveDir);
|
||||
}
|
||||
|
||||
private boolean saveSketch() throws IOException{
|
||||
@@ -216,7 +216,7 @@ public class AutoSaveUtil {
|
||||
public void run() {
|
||||
try {
|
||||
saveSketch();
|
||||
ExperimentalMode.log("Saved " + editor.getSketch().getMainFilePath());
|
||||
ExperimentalMode.log("Backup Saved " + editor.getSketch().getMainFilePath());
|
||||
} catch (IOException e) {
|
||||
// TODO Auto-generated catch block
|
||||
e.printStackTrace();
|
||||
|
||||
@@ -245,8 +245,7 @@ public class DebugEditor extends JavaEditor implements ActionListener {
|
||||
ta.setECSandThemeforTextArea(errorCheckerService, dmode);
|
||||
addXQModeUI();
|
||||
debugToolbarEnabled = new AtomicBoolean(false);
|
||||
log("Sketch Path: " + path);
|
||||
loadAutoSaver();
|
||||
log("Sketch Path: " + path);
|
||||
}
|
||||
|
||||
private void addXQModeUI(){
|
||||
@@ -735,6 +734,10 @@ public class DebugEditor extends JavaEditor implements ActionListener {
|
||||
clearBreakpointedLines(); // force clear breakpoint highlights
|
||||
variableInspector().reset(); // clear contents of variable inspector
|
||||
}
|
||||
if(autosaver != null)
|
||||
autosaver.stop();
|
||||
loadAutoSaver();
|
||||
//System.out.println("LOADDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD");
|
||||
return didOpen;
|
||||
}
|
||||
|
||||
@@ -884,9 +887,11 @@ public class DebugEditor extends JavaEditor implements ActionListener {
|
||||
if(response == JOptionPane.YES_OPTION){
|
||||
handleOpenInternal(pastSave.getAbsolutePath());
|
||||
//log(getSketch().getMainFilePath());
|
||||
autosaver = new AutoSaveUtil(this, 5);
|
||||
return;
|
||||
}
|
||||
else{
|
||||
autosaver.init();
|
||||
}
|
||||
autosaver.init();
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user