mirror of
https://github.com/igniterealtime/Spark.git
synced 2025-12-01 12:27:58 +00:00
when downloading a plugin it should be removed from the "do-not-load-plugin"-list
also removed the alternative plugin icon loading from website, as everything returns the same icon git-svn-id: http://svn.igniterealtime.org/svn/repos/spark/trunk@12474 b35dd754-fafc-0310-a699-88a17e54d16e
This commit is contained in:
committed by
wolf.posdorfer
parent
b931fedc4e
commit
c2da66093d
@ -183,22 +183,18 @@ public class PluginManager implements MainWindowListener {
|
||||
try {
|
||||
File f = new File(installPath + jarFile.getName());
|
||||
if (installerFiles.contains(f)) {
|
||||
String oldfile = StringUtils
|
||||
.getMD5Checksum(jarFile
|
||||
.getAbsolutePath());
|
||||
String newfile = StringUtils.getMD5Checksum(f
|
||||
.getAbsolutePath());
|
||||
Log.debug(f.getAbsolutePath() + " "
|
||||
+ jarFile.getAbsolutePath());
|
||||
Log.debug(newfile + " " + oldfile + " equal:"
|
||||
+ oldfile.equals(newfile));
|
||||
String oldfile = StringUtils.getMD5Checksum(jarFile.getAbsolutePath());
|
||||
String newfile = StringUtils.getMD5Checksum(f.getAbsolutePath());
|
||||
|
||||
Log.debug(f.getAbsolutePath() + " " + jarFile.getAbsolutePath());
|
||||
Log.debug(newfile + " " + oldfile + " equal:" + oldfile.equals(newfile));
|
||||
|
||||
if (!oldfile.equals(newfile)) {
|
||||
Log.debug("deleting: "
|
||||
+ file.getAbsolutePath() + ","
|
||||
+ jarFile.getAbsolutePath());
|
||||
Log.debug("deleting: "+ file.getAbsolutePath() + "," + jarFile.getAbsolutePath());
|
||||
uninstall(file);
|
||||
jarFile.delete();
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
} catch (Exception e) {
|
||||
|
||||
@ -399,6 +399,9 @@ public class PluginViewer extends JPanel implements Plugin {
|
||||
if (sparkPlug.getPlugin().getDownloadURL().equals(plugin.getDownloadURL())) {
|
||||
availablePanel.remove(sparkPlug);
|
||||
|
||||
_deactivatedPlugins.remove(sparkPlug.getPlugin().getName());
|
||||
_prefs.setDeactivatedPlugins(_deactivatedPlugins);
|
||||
|
||||
PluginManager.getInstance().addPlugin(sparkPlug.getPlugin());
|
||||
|
||||
sparkPlug.showOperationButton();
|
||||
|
||||
@ -24,7 +24,6 @@ import java.awt.FlowLayout;
|
||||
import java.awt.Font;
|
||||
import java.awt.GridBagConstraints;
|
||||
import java.awt.GridBagLayout;
|
||||
import java.awt.Image;
|
||||
import java.awt.Insets;
|
||||
import java.awt.event.ActionEvent;
|
||||
import java.awt.event.ActionListener;
|
||||
@ -32,7 +31,6 @@ import java.io.File;
|
||||
import java.net.MalformedURLException;
|
||||
import java.net.URL;
|
||||
|
||||
import javax.imageio.ImageIO;
|
||||
import javax.swing.BorderFactory;
|
||||
import javax.swing.Icon;
|
||||
import javax.swing.ImageIcon;
|
||||
@ -67,29 +65,8 @@ public class SparkPlugUI extends JPanel {
|
||||
JLabel versionLabel = new JLabel();
|
||||
JLabel descriptionLabel = new JLabel();
|
||||
|
||||
|
||||
if (getFilename() != null) {
|
||||
URL url = null;
|
||||
try {
|
||||
url = new URL("http://www.igniterealtime.org/updater/sparkplugs?filename=" + getFilename());
|
||||
final Image pluginImage = ImageIO.read(url);
|
||||
|
||||
// In some cases, people are not supplying icons. This case needs to be handled.
|
||||
if (pluginImage != null) {
|
||||
ImageIcon pluginIcon = new ImageIcon(pluginImage);
|
||||
imageIcon.setIcon(pluginIcon);
|
||||
if (pluginIcon.getIconWidth() == -1) {
|
||||
imageIcon.setIcon(SparkRes.getImageIcon(SparkRes.PLUGIN_IMAGE));
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception e) {
|
||||
Log.debug("Unable to find image for " + url);
|
||||
}
|
||||
}
|
||||
else {
|
||||
imageIcon.setIcon(SparkRes.getImageIcon(SparkRes.PLUGIN_IMAGE));
|
||||
}
|
||||
imageIcon.setIcon(SparkRes.getImageIcon(SparkRes.PLUGIN_IMAGE));
|
||||
|
||||
|
||||
add(imageIcon, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(5, 5, 5, 5), 0, 0));
|
||||
|
||||
@ -100,7 +77,10 @@ public class SparkPlugUI extends JPanel {
|
||||
add(versionLabel, new GridBagConstraints(2, 0, 1, 1, 0.0, 0.0, GridBagConstraints.WEST, GridBagConstraints.HORIZONTAL, new Insets(5, 5, 5, 5), 0, 0));
|
||||
|
||||
titleLabel.setText(plugin.getName());
|
||||
versionLabel.setText(plugin.getVersion() + " by " + plugin.getAuthor());
|
||||
if (plugin.getVersion() != null && plugin.getAuthor() != null) {
|
||||
versionLabel.setText(plugin.getVersion() + " by "
|
||||
+ plugin.getAuthor());
|
||||
}
|
||||
descriptionLabel.setText(plugin.getDescription());
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user