Fixed settings not saving when exiting from menu

git-svn-id: http://svn.3splooges.com/romraider-arch/trunk@164 d2e2e1cd-ba16-0410-be16-b7c4453c7c2d
This commit is contained in:
Jared Gould 2006-07-21 15:22:27 +00:00
parent e6402eedf2
commit 0fb2d6e72e
1 changed files with 20 additions and 15 deletions

View File

@ -158,22 +158,27 @@ public class ECUEditor extends JFrame implements WindowListener, PropertyChangeL
setVisible(true);
}
public void windowClosing(WindowEvent e) {
getSettings().setSplitPaneLocation(splitPane.getDividerLocation());
if (getExtendedState() == JFrame.MAXIMIZED_BOTH) getSettings().setWindowMaximized(true);
else {
getSettings().setWindowMaximized(false);
getSettings().setWindowSize(getSize());
getSettings().setWindowLocation(getLocation());
}
public void handleExit() {
getSettings().setSplitPaneLocation(splitPane.getDividerLocation());
if (getExtendedState() == JFrame.MAXIMIZED_BOTH)
getSettings().setWindowMaximized(true);
else {
getSettings().setWindowMaximized(false);
getSettings().setWindowSize(getSize());
getSettings().setWindowLocation(getLocation());
}
DOMSettingsBuilder builder = new DOMSettingsBuilder();
try {
JProgressPane progress = new JProgressPane(this, "Saving settings...", "Saving settings...");
builder.buildSettings(settings, new File("./settings.xml"), progress, version);
} catch (IOException ex) { }
}
DOMSettingsBuilder builder = new DOMSettingsBuilder();
try {
JProgressPane progress = new JProgressPane(this, "Saving settings...", "Saving settings...");
builder.buildSettings(settings, new File("./settings.xml"), progress, version);
} catch (IOException ex) { }
}
public void windowClosing(WindowEvent e) {
handleExit();
}
public void windowOpened(WindowEvent e) { }
public void windowClosed(WindowEvent e) { }
public void windowIconified(WindowEvent e) { }