diff --git a/src/main/java/com/threerings/getdown/data/Application.java b/src/main/java/com/threerings/getdown/data/Application.java index fc59a31..f7db7b5 100644 --- a/src/main/java/com/threerings/getdown/data/Application.java +++ b/src/main/java/com/threerings/getdown/data/Application.java @@ -112,6 +112,9 @@ public class Application /** The error background image for {@link RotatingBackgrounds}. */ public String errorBackground; + /** The paths (relative to the appdir) of file names for icon images. */ + public String[] iconImages; + /** The path (relative to the appdir) to a single background image. */ public String backgroundImage; @@ -600,6 +603,7 @@ public class Application } ui.progressImage = (String)cdata.get("ui.progress_image"); ui.rotatingBackgrounds = ConfigUtil.getMultiValue(cdata, "ui.rotating_background"); + ui.iconImages = ConfigUtil.getMultiValue(cdata, "ui.icon"); ui.errorBackground = (String)cdata.get("ui.error_background"); _dockIconPath = (String)cdata.get("ui.mac_dock_icon"); if (_dockIconPath == null) { diff --git a/src/main/java/com/threerings/getdown/launcher/GetdownApp.java b/src/main/java/com/threerings/getdown/launcher/GetdownApp.java index 467257f..069b40f 100644 --- a/src/main/java/com/threerings/getdown/launcher/GetdownApp.java +++ b/src/main/java/com/threerings/getdown/launcher/GetdownApp.java @@ -26,6 +26,7 @@ package com.threerings.getdown.launcher; import java.awt.Container; +import java.awt.Image; import java.awt.event.WindowEvent; import java.awt.event.WindowAdapter; import javax.swing.JFrame; @@ -37,6 +38,7 @@ import java.io.IOException; import java.io.BufferedOutputStream; import java.io.PrintStream; +import java.util.ArrayList; import java.util.Arrays; import java.util.List; @@ -123,6 +125,23 @@ public class GetdownApp _frame.setTitle(title); _frame.getContentPane().removeAll(); } + if (_ifc.iconImages != null) { + ArrayList icons = new ArrayList(); + for (String path : _ifc.iconImages) { + Image img = loadImage(path); + if (img == null) { + log.warning("Error loading icon image", "path", path); + } else { + icons.add(img); + } + } + if (icons.isEmpty()) { + log.warning("Failed to load any icons", "iconImages", _ifc.iconImages); + + } else { + _frame.setIconImages(icons); + } + } _frame.setDefaultCloseOperation(WindowConstants.DO_NOTHING_ON_CLOSE); return _frame.getContentPane(); }