From 6cd1add70c39e79be0609a4385d5a84ba3b119d2 Mon Sep 17 00:00:00 2001 From: Robert Colton Date: Wed, 29 May 2019 19:09:57 -0400 Subject: [PATCH] Preferences Reload (#440) This is a minor tweak to the new preferences set up to make it reload each preference group every time the frame is shown. This means if the frame is closed without hitting apply, it will be reloaded before it is next shown. This means the frame no longer has to explicitly load each preference group during its construction. --- org/lateralgm/main/LGM.java | 2 +- org/lateralgm/subframes/PreferencesFrame.java | 11 ++++++++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/org/lateralgm/main/LGM.java b/org/lateralgm/main/LGM.java index 072e972af..152b37600 100644 --- a/org/lateralgm/main/LGM.java +++ b/org/lateralgm/main/LGM.java @@ -135,7 +135,7 @@ public final class LGM { - public static final String version = "1.8.78"; //$NON-NLS-1$ + public static final String version = "1.8.79"; //$NON-NLS-1$ // TODO: This list holds the class loader for any loaded plugins which should be // cleaned up and closed when the application closes. diff --git a/org/lateralgm/subframes/PreferencesFrame.java b/org/lateralgm/subframes/PreferencesFrame.java index 2b8ad00f7..87620dc81 100644 --- a/org/lateralgm/subframes/PreferencesFrame.java +++ b/org/lateralgm/subframes/PreferencesFrame.java @@ -123,7 +123,6 @@ public PreferencesFrame() DefaultMutableTreeNode node = new DefaultMutableTreeNode(group.name); root.add(node); cardPane.add(group.makePanel(), group.name); - group.load(); } //TODO: Fix UI bugs in JoshEdit repo and then use the serialize feature to save them. @@ -239,6 +238,16 @@ private void resetDefaults() } } + @Override + public void setVisible(boolean visible) + { + if (visible) + for (PreferencesGroup group : groups) + group.load(); + + super.setVisible(visible); + } + private Timer blinkTimer; private void startBlink()