mirror of
https://github.com/Card-Forge/forge.git
synced 2025-11-19 04:08:01 +00:00
Issue 117: Load from default display_layout.xml when user's customized display_new_layout.xml does not exist.
* Updated the default display_layout.xml to look good on a Windows XP 1024x768 display. * Updated GuiDisplay4.java to load from default layout if user's "new" layout does not exist. * We have not had display_new_layout.xml in the repository for some time, but that is a related change. Bug: 117
This commit is contained in:
@@ -762,7 +762,11 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
||||
|
||||
@Override
|
||||
public void windowClosed(WindowEvent e) {
|
||||
|
||||
// Write the layout to the new file, usually
|
||||
// res/gui/display_new_layout.xml
|
||||
File f = ForgeProps.getFile(LAYOUT_NEW);
|
||||
|
||||
Node layout = pane.getMultiSplitLayout().getModel();
|
||||
try {
|
||||
XMLEncoder encoder = new XMLEncoder(new BufferedOutputStream(new FileOutputStream(f)));
|
||||
@@ -776,7 +780,16 @@ public class GuiDisplay4 extends JFrame implements CardContainer, Display, NewCo
|
||||
|
||||
//making the multi split pane
|
||||
Node model;
|
||||
|
||||
// Try to load the latest saved layout, usually
|
||||
// res/gui/display_new_layout.xml
|
||||
File f = ForgeProps.getFile(LAYOUT_NEW);
|
||||
|
||||
// If the new file does not exist, read the configuration from the
|
||||
// default layout, usually res/gui/display_layout.xml
|
||||
if (!f.exists()) {
|
||||
f = ForgeProps.getFile(LAYOUT);
|
||||
}
|
||||
try {
|
||||
XMLDecoder decoder = new XMLDecoder(new BufferedInputStream(new FileInputStream(f)));
|
||||
model = (Node) decoder.readObject();
|
||||
|
||||
Reference in New Issue
Block a user