Mac dock name for Player and Editor

I’m looking at what I need to do to set the correct dock name for the
Player and Editor under OS X ("-Xdock:name=…") and I’m wondering what
the correct dock name is.

That is, should it be “VASSAL Player” for an instance of the Player, or
should it be “OCS - Case Blue” if you have the Case Blue module open, or
should it be something else?

Let’s do the second one: use the module name.

rk

Post generated using Mail2Forum (mail2forum.com)

On May 27, 2008, at 12:35 PM, Rodney Kinney wrote:

Summary: I agree that’s the best option.

I’ve been mulling this over a bit, trying to decide what fits best.

On the one hand, the name in the dock is traditionally the program
name. On the other hand, the standard model for Mac applications is
that each application exists only once, and different “documents” are
opened in that one application, using separate windows. But what
Vassal does now is launch a separate player application for each
module, so there will be multiple Vassal player applications running.
So that kind of breaks the standard model.

Anyway, the key question should be what would be most useful. Since
the icons will all be identical, all the user will have to go on when
moving over the dock is the dock name, and since he will almost
certainly be looking for a particular module, it makes the most sense
to use that as the dock name.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

The icons will be the same for all Player instances now, but
eventually we’ll provide a way for the module to supply the icon.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

I’ve uploaded a build which (I think) uses the module name for the
-Xdock:name for the Player and Editor. Let me know if this works
on the Mac:

nomic.net/~uckelman/tmp/vass … macosx.dmg

On May 29, 2008, at 1:05 PM, uckelman wrote:

It fails miserably. :frowning:

Launching generates an Error message dialog with no information. It
looks like it is trying to use the module name as a class name. Log
file attached below.

Also, I looked at the Info.plist and noticed a setting for
CFBundleTypeOSTypes, which IIRC should refer to some type of standard
type that the OS knows about. This is what the Mac OS used to use for
figuring out file types (it was part of the file information kept
separately from the data), since a while back the Mac OS didn’t pay
any attention to file name extensions. Unless this is being set in
some way by Vassal, I don’t think there will ever be any files with
the VMOD OS Type, so it can probably be omitted without problems. On
the other hand, keeping it in is unlikely to hurt anything, unless
there is some other application that thinks it should have an OSType
that matches VMOD. In which case, Vassal will think it can handle it.

The log file produced follows:

[1689244333]
– OS Mac OS X
– Java version 1.5.0_13
– VASSAL version 3.1.0-svn3675
– Manager
Exception in thread “main” java.lang.NoClassDefFoundError: Ambush
[1689244333]
java.util.concurrent.ExecutionException: java.io.EOFException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
at java.util.concurrent.FutureTask.get(FutureTask.java:80)
at org.jdesktop.swingworker.SwingWorker.get(Unknown Source)
at VASSAL.launch.AbstractLaunchAction
$LaunchTask.done(AbstractLaunchAction.java:280)
at VASSAL.launch.Player$LaunchAction$1.done(Player.java:181)
at org.jdesktop.swingworker.SwingWorker$5.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker
$DoSubmitAccumulativeRunnable.run(Unknown Source)
at org.jdesktop.swingworker.AccumulativeRunnable.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker
$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at
java
.awt
.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:
269)
at
java
.awt
.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:
190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:358)
at VASSAL.launch.AbstractLaunchAction
$LaunchTask.doInBackground(AbstractLaunchAction.java:260)
at VASSAL.launch.AbstractLaunchAction
$LaunchTask.doInBackground(AbstractLaunchAction.java:157)
at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor
$Worker.runTask(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor
$Worker.run(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:613)


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

I think this might be due to not quoting the argument to -Xdock:name.
(I read somewhere that when you use ProcessBuilder, you don’t have to,
which appears not to be so. I wonder if I also then need to guard
the double quotes in module name as well? If this works for a normal
module, could you create a module with a double quote in the middle
of its name and test that for me?)

Alright, I’ll remove that. Thanks.

Try this one:

nomic.net/~uckelman/tmp/vass … macosx.dmg


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On May 29, 2008, at 3:33 PM, Joel Uckelman wrote:

How are you specifying the arguments to ProcessBuilder?

The proper specification for the dock name parameter is

-Xdock:name=processName

The crucial point is that the value is specified using “=” as a
single element, unlike some other Unix-like options where the switch
name and the value are separate arguments.

I build a very simple test application that works well and doesn’t
require any special quoting of the values:

Process p = new ProcessBuilder(“java”, “-Xdock:name=Bill Murray”,
“Test”).start();

This launches a new java process with a dock (and menubar) name of
“Bill Murray”.

That works fine in my simple tests as well:

Process p2 = new ProcessBuilder(“java”,
“-Xdock:name=Bill “Hound Dog” Murray”,
“Test”).start();

Still no joy. Same problem. Although I note that the module I tried
this time had a two-word name, which apparently got passed on as a
single entity: “Pea Ridge”. Trying with a single word name “Sicily”
didn’t change anything.

[812324524]
– OS Mac OS X
– Java version 1.5.0_13
– VASSAL version 3.1.0-svn3678
– Manager
Exception in thread “main” java.lang.NoClassDefFoundError: Pea Ridge
[812324524]
java.util.concurrent.ExecutionException: java.io.EOFException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
at java.util.concurrent.FutureTask.get(FutureTask.java:80)
at org.jdesktop.swingworker.SwingWorker.get(Unknown Source)
at VASSAL.launch.AbstractLaunchAction$LaunchTask.done
(AbstractLaunchAction.java:280)
at VASSAL.launch.Player$LaunchAction$1.done(Player.java:181)
at org.jdesktop.swingworker.SwingWorker$5.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker
$DoSubmitAccumulativeRunnable.run(Unknown Source)
at org.jdesktop.swingworker.AccumulativeRunnable.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker
$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:358)
at VASSAL.launch.AbstractLaunchAction$LaunchTask.doInBackground
(AbstractLaunchAction.java:260)
at VASSAL.launch.AbstractLaunchAction$LaunchTask.doInBackground
(AbstractLaunchAction.java:157)
at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:613)
Exception in thread “main” java.lang.NoClassDefFoundError: Sicily
[812324524]
java.util.concurrent.ExecutionException: java.io.EOFException
at java.util.concurrent.FutureTask$Sync.innerGet(FutureTask.java:205)
at java.util.concurrent.FutureTask.get(FutureTask.java:80)
at org.jdesktop.swingworker.SwingWorker.get(Unknown Source)
at VASSAL.launch.AbstractLaunchAction$LaunchTask.done
(AbstractLaunchAction.java:280)
at VASSAL.launch.Player$LaunchAction$1.done(Player.java:181)
at org.jdesktop.swingworker.SwingWorker$5.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker
$DoSubmitAccumulativeRunnable.run(Unknown Source)
at org.jdesktop.swingworker.AccumulativeRunnable.run(Unknown Source)
at org.jdesktop.swingworker.SwingWorker
$DoSubmitAccumulativeRunnable.actionPerformed(Unknown Source)
at javax.swing.Timer.fireActionPerformed(Timer.java:271)
at javax.swing.Timer$DoPostEvent.run(Timer.java:201)
at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:209)
at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
at java.awt.EventDispatchThread.pumpOneEventForHierarchy
(EventDispatchThread.java:269)
at java.awt.EventDispatchThread.pumpEventsForHierarchy
(EventDispatchThread.java:190)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
184)
at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:
176)
at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)
Caused by: java.io.EOFException
at java.io.DataInputStream.readInt(DataInputStream.java:358)
at VASSAL.launch.AbstractLaunchAction$LaunchTask.doInBackground
(AbstractLaunchAction.java:260)
at VASSAL.launch.AbstractLaunchAction$LaunchTask.doInBackground
(AbstractLaunchAction.java:157)
at org.jdesktop.swingworker.SwingWorker$1.call(Unknown Source)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:269)
at java.util.concurrent.FutureTask.run(FutureTask.java:123)
at org.jdesktop.swingworker.SwingWorker.run(Unknown Source)
at java.util.concurrent.ThreadPoolExecutor$Worker.runTask
(ThreadPoolExecutor.java:650)
at java.util.concurrent.ThreadPoolExecutor$Worker.run
(ThreadPoolExecutor.java:675)
at java.lang.Thread.run(Thread.java:613)


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

Thus spake Thomas Russ:

Here’s the relevant block of code. moduleName is the name of the module
as read from the module metadata (possibly null, if there was no metadata).

// build the child process
final ArrayList al = new ArrayList();
al.add(“java”);
al.add("-Xms" + initialHeap + “M”);
al.add("-Xmx" + maximumHeap + “M”);
al.add("-cp");
al.add(System.getProperty(“java.class.path”));

if (Info.isMacOSX()) {
// use the module name for the dock if we found a module name
al.add("-Xdock:name="" +
moduleName != null && moduleName.length() > 0 ? moduleName :
// FIXME: should be localized?
“Unnamed module” + “”");
// al.add("-Xdock:icon=" + );
}

al.add(entryPoint);

final String[] args = al.toArray(new String[al.size()]);

final ProcessBuilder pb = new ProcessBuilder(args);
pb.directory(Info.getBinDir());

final Process p = pb.start();

Oh, hell. I see the problem now. I’m missing parentheses around the
conditional which selects the module name, and thus getting the closing
double quote only when there’s no module name.

Try now:

nomic.net/~uckelman/tmp/vass … macosx.dmg

(And, also, if this works, please try to create and load a module with a
double qoute followed by a space somehwere in its name.)


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

This works correctly.

But you should drop the double-quotes around the module name. They aren’t needed and, in fact, they show up as part of the name. See the attached pictures.

I didn’t try making a module with a double-quote in the name, because I don’t think it will be an issue if you drop the double quotes around the name. I think that all you need is:

al.add("-Xdock:name=" + (moduleName != null && moduleName.length() > 0 ? moduleName : // FIXME: should be localized? "Unnamed module" ));

since my simple tests indicated that quotes will otherwise work in the body.

Oh, by the way, I’ll be happy to produce the icon family file *.icns, to use with the module once we settle on the icon to use. If you want something for the meantime, I can produce one from any interim image. Vector source preferred.

Thus spake “tar”:

Thanks.

I’ve uploaded a build with a fix for this now, svn3692:

nomic.net/~uckelman/tmp/vassal/

I was hoping to find a way to produce those from the command-line myself,
but if I can’t, I’ll let you know.


J.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)

On May 30, 2008, at 11:48 AM, Joel Uckelman wrote:

OK.
3692 works great and displays the names very nicely.

I also tried it with a new module name

The “best” Game

and it handled the double quotes just fine.

This works and can be closed.


Messages mailing list
Messages@forums.vassalengine.org
forums.vassalengine.org/mailman/ … engine.org

Post generated using Mail2Forum (mail2forum.com)