SPARK-1315 catches if could not find spark.jar and tries a workaround. added language icon

git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12325 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
Holger Bergunde
2011-05-04 12:09:18 +00:00
committed by holger.bergunde
parent e18803d66d
commit 93412e8edf
3 changed files with 6 additions and 2 deletions

View File

@ -346,3 +346,5 @@ ACCEPT_INVITE_IMAGE = images/accept.png
REJECT_INVITE_IMAGE = images/reject.png
INVITE_MORE_IMAGE = images/invitemore.png
# Lanuage
LANGUAGE_ICON = images/language_plugin.png

View File

@ -20,6 +20,7 @@
package org.jivesoftware.sparkimpl.plugin.language;
import org.jivesoftware.resource.Res;
import org.jivesoftware.resource.SparkRes;
import org.jivesoftware.spark.SparkManager;
import org.jivesoftware.spark.plugin.Plugin;
import org.jivesoftware.spark.util.log.Log;
@ -57,14 +58,15 @@ public class LanguagePlugin implements Plugin {
final JMenu actionsMenu = SparkManager.getMainWindow().getMenuByName(Res.getString("menuitem.actions"));
languageMenu = new JMenu(Res.getString("menuitem.languages"));
languageMenu.setIcon(SparkRes.getImageIcon("LANGUAGE_ICON"));
locales = Locale.getAvailableLocales();
// Load files
URL sparkJar = getClass().getClassLoader().getResource("spark.jar");
if (sparkJar == null) {
// Do not initialize
return;
sparkJar = getClass().getProtectionDomain().getCodeSource().getLocation();
if (sparkJar == null) return;
}
try {

Binary file not shown.

After

Width:  |  Height:  |  Size: 811 B