mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
better support for changing sketchbook location in prefs
hide editor window while prefs are open
This commit is contained in:
@@ -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();
|
||||
|
||||
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user