From 7ba3944f29e14544049ee885d749d933282ec7c8 Mon Sep 17 00:00:00 2001 From: Manindra Moharana Date: Wed, 19 Mar 2014 13:50:50 +0530 Subject: [PATCH] diabling auto save, switching focus on other stuff for now --- .../processing/mode/experimental/AutoSaveUtil.java | 5 ++++- .../processing/mode/experimental/DebugEditor.java | 14 +++++++------- 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/pdex/src/processing/mode/experimental/AutoSaveUtil.java b/pdex/src/processing/mode/experimental/AutoSaveUtil.java index 3141ed65a..7efa14ec0 100644 --- a/pdex/src/processing/mode/experimental/AutoSaveUtil.java +++ b/pdex/src/processing/mode/experimental/AutoSaveUtil.java @@ -60,6 +60,7 @@ public class AutoSaveUtil { * @param timeOut - in minutes, how frequently should saves occur */ public AutoSaveUtil(DebugEditor dedit, int timeOut){ + /* editor = dedit; if (timeOut < 1) { // less than 1 minute not allowed! saveTime = -1; @@ -77,7 +78,7 @@ public class AutoSaveUtil { autosaveDir = new File(editor.getSketch().getFolder().getAbsolutePath() + File.separator + AUTOSAVEFOLDER); sketchFolder = editor.getSketch().getFolder(); sketchBackupFolder = autosaveDir; - } + }*/ } /** @@ -153,6 +154,7 @@ public class AutoSaveUtil { * Start the auto save service */ public void init(){ + /* if(isAutoSaveBackup) { log("AutoSaver not started"); return; @@ -163,6 +165,7 @@ public class AutoSaveUtil { timer.schedule(new SaveTask(), saveTime, saveTime); isSaving = false; log("AutoSaver started"); + */ } /** diff --git a/pdex/src/processing/mode/experimental/DebugEditor.java b/pdex/src/processing/mode/experimental/DebugEditor.java index ee4735086..20206c186 100755 --- a/pdex/src/processing/mode/experimental/DebugEditor.java +++ b/pdex/src/processing/mode/experimental/DebugEditor.java @@ -342,10 +342,10 @@ public class DebugEditor extends JavaEditor implements ActionListener { // Added temporarily to dump error log. TODO: Remove this later public void internalCloseRunner(){ if(ExperimentalMode.errorLogsEnabled) writeErrorsToFile(); - if(autosaver != null && !viewingAutosaveBackup) { - log("stopping autosaver in internalCloseRunner"); - autosaver.stop(); - } +// if(autosaver != null && !viewingAutosaveBackup) { +// log("stopping autosaver in internalCloseRunner"); +// autosaver.stop(); +// } super.internalCloseRunner(); } @@ -750,8 +750,8 @@ public class DebugEditor extends JavaEditor implements ActionListener { variableInspector().reset(); // clear contents of variable inspector } //if(didOpen){ - - loadAutoSaver(); + autosaver = new AutoSaveUtil(this, ExperimentalMode.autoSaveInterval); // this is used instead of loadAutosaver(), temp measure + //loadAutoSaver(); viewingAutosaveBackup = autosaver.isAutoSaveBackup(); log("handleOpenInternal, viewing autosave? " + viewingAutosaveBackup); //} @@ -932,7 +932,7 @@ public class DebugEditor extends JavaEditor implements ActionListener { * Also handles the case where an auto save backup is found. * The user is asked to save the sketch to a new location */ - public void loadAutoSaver(){ + private void loadAutoSaver(){ log("Load Auto Saver()"); autosaver = new AutoSaveUtil(this, ExperimentalMode.autoSaveInterval); if(!autosaver.checkForPastSave()) {