better support for changing sketchbook location in prefs

hide editor window while prefs are open
This commit is contained in:
benfry
2004-06-21 17:28:47 +00:00
parent aeb1e4d9de
commit 02ed417869
3 changed files with 50 additions and 35 deletions
+6 -3
View File
@@ -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();
+13 -11
View File
@@ -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();