Skip to content

Commit

Permalink
Preferences Reload (#440)
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
RobertBColton authored May 29, 2019
1 parent f589a1a commit 6cd1add
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 2 deletions.
2 changes: 1 addition & 1 deletion org/lateralgm/main/LGM.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
11 changes: 10 additions & 1 deletion org/lateralgm/subframes/PreferencesFrame.java
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down Expand Up @@ -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()
Expand Down

0 comments on commit 6cd1add

Please sign in to comment.