mirror of
https://github.com/igniterealtime/Spark.git
synced 2026-08-18 11:10:02 +00:00
1) SPARK-350 ICQ transport is not included in current Spark
2) SPARK-352 Message in Plugin Viewer is displaying wrong restart message. git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@5313 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
@ -250,6 +250,8 @@ public class SparkRes {
|
||||
public static final String IM_DND_STALE_IMAGE = "IM_AWAY_STALE_IMAGE";
|
||||
public static final String IM_FREE_CHAT_STALE_IMAGE = "IM_FREE_CHAT_STALE_IMAGE";
|
||||
public static final String IM_UNAVAILABLE_STALE_IMAGE = "IM_UNAVAILABLE_STALE_IMAGE";
|
||||
public static final String ICQ_TRANSPORT_ACTIVE_IMAGE = "ICQ_TRANSPORT_ACTIVE_IMAGE";
|
||||
public static final String ICQ_TRANSPORT_INACTIVE_IMAGE = "ICQ_TRANSPORT_INACTIVE_IMAGE";
|
||||
|
||||
static ClassLoader cl = SparkRes.class.getClassLoader();
|
||||
|
||||
|
||||
@ -246,6 +246,8 @@ MSN_TRANSPORT_ACTIVE_IMAGE = images/msn.gif
|
||||
MSN_TRANSPORT_INACTIVE_IMAGE = images/msn-gray.gif
|
||||
YAHOO_TRANSPORT_ACTIVE_IMAGE = images/yahoo.gif
|
||||
YAHOO_TRANSPORT_INACTIVE_IMAGE = images/yahoo-gray.gif
|
||||
ICQ_TRANSPORT_ACTIVE_IMAGE = images/icq.gif
|
||||
ICQ_TRANSPORT_INACTIVE_IMAGE = images/icq-gray.gif
|
||||
|
||||
#Stale Images
|
||||
IM_AVAILABLE_STALE_IMAGE = images/im_available_stale.png
|
||||
|
||||
@ -36,6 +36,7 @@ import java.util.Enumeration;
|
||||
import java.util.Iterator;
|
||||
import java.util.List;
|
||||
import java.util.StringTokenizer;
|
||||
import java.util.concurrent.CopyOnWriteArrayList;
|
||||
import java.util.jar.JarEntry;
|
||||
import java.util.jar.JarFile;
|
||||
import java.util.zip.ZipFile;
|
||||
@ -50,7 +51,7 @@ import javax.swing.SwingUtilities;
|
||||
public class PluginManager implements MainWindowListener {
|
||||
private final List<Plugin> plugins = new ArrayList<Plugin>();
|
||||
|
||||
private final List<PublicPlugin> publicPlugins = new ArrayList<PublicPlugin>();
|
||||
private final List<PublicPlugin> publicPlugins = new CopyOnWriteArrayList<PublicPlugin>();
|
||||
private static PluginManager singleton;
|
||||
private static final Object LOCK = new Object();
|
||||
|
||||
@ -620,7 +621,7 @@ public class PluginManager implements MainWindowListener {
|
||||
* @return true if installed.
|
||||
*/
|
||||
public boolean isInstalled(PublicPlugin plugin) {
|
||||
for(PublicPlugin publicPlugin : getPublicPlugins()){
|
||||
for (PublicPlugin publicPlugin : getPublicPlugins()) {
|
||||
if (plugin.getName().equals(publicPlugin.getName())) {
|
||||
return true;
|
||||
}
|
||||
@ -630,5 +631,4 @@ public class PluginManager implements MainWindowListener {
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
@ -10,6 +10,7 @@
|
||||
|
||||
package org.jivesoftware.sparkimpl.plugin.gateways;
|
||||
|
||||
import org.jivesoftware.resource.Res;
|
||||
import org.jivesoftware.smack.PacketListener;
|
||||
import org.jivesoftware.smack.XMPPConnection;
|
||||
import org.jivesoftware.smack.XMPPException;
|
||||
@ -32,11 +33,11 @@ import org.jivesoftware.spark.ui.status.StatusBar;
|
||||
import org.jivesoftware.spark.util.SwingWorker;
|
||||
import org.jivesoftware.spark.util.log.Log;
|
||||
import org.jivesoftware.sparkimpl.plugin.gateways.transports.AIMTransport;
|
||||
import org.jivesoftware.sparkimpl.plugin.gateways.transports.ICQTransport;
|
||||
import org.jivesoftware.sparkimpl.plugin.gateways.transports.MSNTransport;
|
||||
import org.jivesoftware.sparkimpl.plugin.gateways.transports.Transport;
|
||||
import org.jivesoftware.sparkimpl.plugin.gateways.transports.TransportManager;
|
||||
import org.jivesoftware.sparkimpl.plugin.gateways.transports.YahooTransport;
|
||||
import org.jivesoftware.resource.Res;
|
||||
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@ -130,6 +131,10 @@ public class GatewayPlugin implements Plugin {
|
||||
YahooTransport yahoo = new YahooTransport(item.getEntityID());
|
||||
TransportManager.addTransport(item.getEntityID(), yahoo);
|
||||
}
|
||||
else if (item.getEntityID().startsWith("icq.")) {
|
||||
ICQTransport icq = new ICQTransport(item.getEntityID());
|
||||
TransportManager.addTransport(item.getEntityID(), icq);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -0,0 +1,53 @@
|
||||
/**
|
||||
* $Revision: $
|
||||
* $Date: $
|
||||
*
|
||||
* Copyright (C) 2006 Jive Software. All rights reserved.
|
||||
*
|
||||
* This software is published under the terms of the GNU Lesser Public License (LGPL),
|
||||
* a copy of which is included in this distribution.
|
||||
*/
|
||||
|
||||
package org.jivesoftware.sparkimpl.plugin.gateways.transports;
|
||||
|
||||
import org.jivesoftware.resource.Res;
|
||||
import org.jivesoftware.resource.SparkRes;
|
||||
|
||||
import javax.swing.Icon;
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
public class ICQTransport implements Transport {
|
||||
|
||||
private String serviceName;
|
||||
|
||||
public ICQTransport(String serviceName){
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
|
||||
public String getTitle(){
|
||||
return Res.getString("title.icq.registration");
|
||||
}
|
||||
|
||||
public String getInstructions() {
|
||||
return Res.getString("message.enter.icq");
|
||||
}
|
||||
|
||||
public Icon getIcon() {
|
||||
return SparkRes.getImageIcon(SparkRes.ICQ_TRANSPORT_ACTIVE_IMAGE);
|
||||
}
|
||||
|
||||
public Icon getInactiveIcon() {
|
||||
return SparkRes.getImageIcon(SparkRes.ICQ_TRANSPORT_INACTIVE_IMAGE);
|
||||
}
|
||||
|
||||
public String getServiceName() {
|
||||
return serviceName;
|
||||
}
|
||||
|
||||
public void setServiceName(String serviceName) {
|
||||
this.serviceName = serviceName;
|
||||
}
|
||||
}
|
||||
|
||||
@ -166,7 +166,7 @@ public class PluginViewer extends JPanel implements Plugin {
|
||||
File pluginJAR = new File(plugin.getPluginDir().getParentFile(), pluginDir.getName() + ".jar");
|
||||
boolean deleted = pluginJAR.delete();
|
||||
|
||||
JOptionPane.showMessageDialog(this, Res.getString("message.restart.spark"), Res.getString("title.reminder"), JOptionPane.INFORMATION_MESSAGE);
|
||||
JOptionPane.showMessageDialog(this, Res.getString("message.restart.spark.changes"), Res.getString("title.reminder"), JOptionPane.INFORMATION_MESSAGE);
|
||||
PluginManager.getInstance().removePublicPlugin(plugin);
|
||||
return true;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user