From 02ed4178698862a1b7fdc1504638d8080f493595 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 21 Jun 2004 17:28:47 +0000 Subject: [PATCH] better support for changing sketchbook location in prefs hide editor window while prefs are open --- processing/app/PdeEditor.java | 9 ++++-- processing/app/PdePreferences.java | 24 +++++++------- processing/todo.txt | 52 ++++++++++++++++++------------ 3 files changed, 50 insertions(+), 35 deletions(-) diff --git a/processing/app/PdeEditor.java b/processing/app/PdeEditor.java index a43330f1c..3dd8c16bf 100644 --- a/processing/app/PdeEditor.java +++ b/processing/app/PdeEditor.java @@ -912,11 +912,14 @@ public class PdeEditor extends JFrame * Show the (already created on app init) preferences window. */ public void handlePrefs() { - // make sure this blocks until finished - preferences.showFrame(); + // since this can't actually block, it'll hide + // the editor window while the prefs are open + preferences.showFrame(this); + // and then call applyPreferences if 'ok' is hit + // and then unhide // may need to rebuild sketch and other menus - applyPreferences(); + //applyPreferences(); // next have editor do its thing //editor.appyPreferences(); diff --git a/processing/app/PdePreferences.java b/processing/app/PdePreferences.java index f51e7caa7..aa233e7d7 100644 --- a/processing/app/PdePreferences.java +++ b/processing/app/PdePreferences.java @@ -88,6 +88,9 @@ public class PdePreferences extends JComponent { JCheckBox exportLibraryBox; JCheckBox externalEditorBox; + // the calling editor, so updates can be applied + PdeEditor editor; + // data model @@ -353,16 +356,18 @@ public class PdePreferences extends JComponent { } - // ................................................................. - - public Dimension getPreferredSize() { return new Dimension(wide, high); } + // ................................................................. + + public void disposeFrame() { frame.hide(); + editor.applyPreferences(); + editor.show(); //frame.dispose(); } @@ -374,24 +379,21 @@ public class PdePreferences extends JComponent { // put each of the settings into the table //setBoolean("sketchbook.prompt", sketchPromptBox.isSelected()); - set("sketchbook.path", sketchbookLocationField.getText()); - setBoolean("export.library", exportLibraryBox.isSelected()); - setBoolean("editor.external", externalEditorBox.isSelected()); } - public void showFrame() { - // reset all settings to their actual status + public void showFrame(PdeEditor editor) { + // hide the editor window so it can't be messed with + this.editor = editor; + editor.hide(); + // set all settings entry boxes to their actual status //sketchPromptBox.setSelected(getBoolean("sketchbook.prompt")); - sketchbookLocationField.setText(get("sketchbook.path")); - exportLibraryBox.setSelected(getBoolean("export.library")); - externalEditorBox.setSelected(getBoolean("editor.external")); frame.show(); diff --git a/processing/todo.txt b/processing/todo.txt index aa6c3b6f4..8d395e66d 100644 --- a/processing/todo.txt +++ b/processing/todo.txt @@ -24,7 +24,7 @@ X to use JLabel instead of JTextArea X font was wrong on windows X start working on "save as" -040622 monday +040622 monday morning 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 @@ -41,6 +41,36 @@ X set examples somehow read-only X 'save as' from examples puts into examples dir.. :( X make it default to the user's sketch dir +040622 monday mid-day +X see if changing the sketchbook location actually works +X after changing sketchbook location, need to rebuild the menu +X hide the editor window while prefs is open +X this way the prefs can be properly applied + +mostly notes from things that have been fixed along the way: +X fix code for changing the sketch folder +X 'new sketch' goes into the wrong folder +X but saving and all that works properly +X http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1083184449;start=0 +X sketch.properties should go into user.home +X otherwise moving sketch folder will kill it +X last-used sketch not being saved +X if sketchbook.dir is set, makes new sketchbook folder +X reads sketchbook properly from other folder +X but creates a new folder for new sketches to go into +X sketchbook.dir not properly read or written +X install sketchbook into another location on person's machine +X use System.getProperty("user.home"); +X remove the 'default' for sketchbook +X bring this up on bboard and get votes +X win2k: my documents, macosx: ~/Documents, linux: ~/sketchbook +X open mode +X on application open, override 'open' mode +X and just open an empty sketch in the sketchbook folder +X when 'skNew' is cancelled in 'open' mode, nullpointerex at the top + + +_ if a "save as" is forced, make sure that the sketchbook menu is updated _ dashes shouldn't be allowed in filenames for sketches _ actually, lost the naming stuff because now using FileDialog _ can this requirement just be on the pde file, not the directory? @@ -108,28 +138,8 @@ _ but don't export it.. ugh.. SKETCHBOOK -_ fix code for changing the sketch folder -_ 'new sketch' goes into the wrong folder -_ but saving and all that works properly -_ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1083184449;start=0 _ sort sketch names in the open menu _ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1074981609 -_ sketch.properties should go into user.home -_ otherwise moving sketch folder will kill it -_ last-used sketch not being saved -_ if sketchbook.dir is set, makes new sketchbook folder -_ reads sketchbook properly from other folder -_ but creates a new folder for new sketches to go into -_ sketchbook.dir not properly read or written -_ install sketchbook into another location on person's machine -_ use System.getProperty("user.home"); -_ remove the 'default' for sketchbook -_ bring this up on bboard and get votes -_ win2k: my documents, macosx: ~/Documents, linux: ~/sketchbook -_ open mode -_ on application open, override 'open' mode -_ and just open an empty sketch in the sketchbook folder -_ when 'skNew' is cancelled in 'open' mode, nullpointerex at the top _ warn about writing non-1.1 code. _ http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_Software;action=display;num=1079867179;start=0