<html>
<head>
<base href="http://fiji.sc/bugzilla/" />
</head>
<body>
<p>
<div>
<b><a class="bz_bug_link
bz_status_NEW "
title="NEW - Fiji hangs when installing macro tool"
href="http://fiji.sc/bugzilla/show_bug.cgi?id=835#c6">Comment # 6</a>
on <a class="bz_bug_link
bz_status_NEW "
title="NEW - Fiji hangs when installing macro tool"
href="http://fiji.sc/bugzilla/show_bug.cgi?id=835">bug 835</a>
from <span class="vcard"><a class="email" href="mailto:ilan.tal@gmail.com" title="Ilan Tal <ilan.tal@gmail.com>"> <span class="fn">Ilan Tal</span></a>
</span></b>
<pre>Hi Wayne,
I would like to make an additional request for my external jar file plugin. You
have these really great hints for most of your built in buttons, but they are
hard coded. I would really like to have a hint for my external button tool as
well.
For example I have in my code, which I have just changed for experimental
purposes:
public String getToolName() {
return "Window Level Tool (right click for Reset, Auto)";
}
The problem is that the hint will kill the possibility to save the tool to the
registry because it won't fit the command. What I would like is to save to the
registry the original name, without the hint. That way I get the hint on the
status bar and the registry value fits the command.
I added a "second chance" to the setPrefs and hope you agree to the change:
private void setPrefs(int id) {
if (doNotSavePrefs)
return;
boolean ok = isBuiltInTool(names[id]);
String registryValue = instance.names[id];
if (!ok) {
Hashtable commands = Menus.getCommands();
String name = names[id];
if (name.endsWith("Menu Tool"))
name = name.substring(0, name.length()-5);
ok = commands!=null && commands.get(name)!=null;
// give a second chance for hints, i.e. (hint 123)
if( !ok) {
int i = name.indexOf(" (");
if( i > 0) {
name = name.substring(0, i);
ok = commands!=null && commands.get(name)!=null;
if(ok) registryValue = name;
}
}
}
if (!ok)
return;
int index = id - CUSTOM1;
String key = TOOL_KEY + (index/10)%10 + index%10;
Prefs.set(key, registryValue);
}
Please let me know.
Thanks,
Ilan</pre>
</div>
</p>
<hr>
<span>You are receiving this mail because:</span>
<ul>
<li>You are the assignee for the bug.</li>
</ul>
</body>
</html>