From 1ea8c42b91ba35662005e5fc9d8823871a0ecbce Mon Sep 17 00:00:00 2001 From: Michael Bayne Date: Thu, 29 Jul 2004 21:08:56 +0000 Subject: [PATCH] Give a little love back to our Mac users. --- .../threerings/getdown/data/Application.java | 26 +++++++++++++++---- 1 file changed, 21 insertions(+), 5 deletions(-) diff --git a/src/java/com/threerings/getdown/data/Application.java b/src/java/com/threerings/getdown/data/Application.java index d06089e..e8c3264 100644 --- a/src/java/com/threerings/getdown/data/Application.java +++ b/src/java/com/threerings/getdown/data/Application.java @@ -1,5 +1,5 @@ // -// $Id: Application.java,v 1.20 2004/07/29 17:57:45 mdb Exp $ +// $Id: Application.java,v 1.21 2004/07/29 21:08:56 mdb Exp $ package com.threerings.getdown.data; @@ -275,7 +275,7 @@ public class Application // parse and return our application config UpdateInterface ui = new UpdateInterface(); - ui.name = (String)cdata.get("ui.name"); + _name = ui.name = (String)cdata.get("ui.name"); ui.progress = parseRect(cdata, "ui.progress", ui.progress); ui.progressText = parseColor( cdata, "ui.progress_text", ui.progressText); @@ -358,16 +358,24 @@ public class Application cpbuf.append(rsrc.getLocal().getAbsolutePath()); } + int exargs = 0; + + // we love our Mac users, so we do nice things to preserve our + // application identity + if (RunAnywhere.isMacOS()) { + exargs += 2; + } + + // pass along our proxy settings String proxyHost, proxyPort = null; - int pargs = 0; if ((proxyHost = System.getProperty("http.proxyHost")) != null) { - pargs = 2; + exargs += 2; proxyPort = System.getProperty("http.proxyPort"); } // we'll need the JVM, classpath, JVM args, class name and app args String[] args = new String[ - 4 + _jvmargs.size() + pargs + _appargs.size()]; + 4 + _jvmargs.size() + exargs + _appargs.size()]; int idx = 0; // reconstruct the path to the JVM @@ -378,6 +386,13 @@ public class Application args[idx++] = "-classpath"; args[idx++] = cpbuf.toString(); + // do our Mac identity business + if (RunAnywhere.isMacOS()) { + String idir = _appdir.getParentFile().getAbsolutePath(); + args[idx++] = "-Xdock:icon=" + idir + "/desktop.icns"; + args[idx++] = "-Xdock:name=" + _name; + } + // if we have a proxy configuration, add those if (proxyHost != null) { args[idx++] = "-Dhttp.proxyHost=" + proxyHost; @@ -702,6 +717,7 @@ public class Application protected String _appbase; protected URL _vappbase; protected String _class; + protected String _name; protected ArrayList _codes = new ArrayList(); protected ArrayList _resources = new ArrayList();