r26685 - in trunk/freenet/src/freenet: clients/http pluginmanager

[email protected]
Newsgroups gmane.network.freenet.cvs
Message-ID <[email protected]>
Author: toad
Date: 2009-04-09 22:00:38 +0000 (Thu, 09 Apr 2009)
New Revision: 26685

Modified:
   trunk/freenet/src/freenet/clients/http/PproxyToadlet.java
   trunk/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
Log:
Show FredPluginRealVersioned versions on the plugins page


Modified: trunk/freenet/src/freenet/clients/http/PproxyToadlet.java
===================================================================
--- trunk/freenet/src/freenet/clients/http/PproxyToadlet.java	2009-04-09 21:59:50 UTC (rev 26684)
+++ trunk/freenet/src/freenet/clients/http/PproxyToadlet.java	2009-04-09 22:00:38 UTC (rev 26685)
@@ -428,7 +428,11 @@
 				PluginInfoWrapper pi = it.next();
 				HTMLNode pluginRow = pluginTable.addChild("tr");
 				pluginRow.addChild("td", pi.getPluginClassName());
-				pluginRow.addChild("td", pi.getPluginVersion());
+				long ver = pi.getPluginLongVersion();
+				if(ver != -1)
+					pluginRow.addChild("td", pi.getPluginVersion()+" ("+ver+")");
+				else
+					pluginRow.addChild("td", pi.getPluginVersion());
 				pluginRow.addChild("td", pi.getThreadName());
 				pluginRow.addChild("td", new Date(pi.getStarted()).toString());
 				if (pi.isStopping()) {

Modified: trunk/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java
===================================================================
--- trunk/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java	2009-04-09 21:59:50 UTC (rev 26684)
+++ trunk/freenet/src/freenet/pluginmanager/PluginInfoWrapper.java	2009-04-09 22:00:38 UTC (rev 26685)
@@ -24,6 +24,7 @@
 	private final boolean isMultiplePlugin;
 	private final boolean isFCPPlugin;
 	private final boolean isVersionedPlugin;
+	private final boolean isLongVersionedPlugin;
 	private final boolean isThemedPlugin;
 	private final boolean isL10nPlugin;
 	private final boolean isUpdatedablePlugin;
@@ -47,6 +48,7 @@
 		isMultiplePlugin = (plug instanceof FredPluginMultiple);
 		isFCPPlugin = (plug instanceof FredPluginFCP);
 		isVersionedPlugin = (plug instanceof FredPluginVersioned);
+		isLongVersionedPlugin = (plug instanceof FredPluginRealVersioned);
 		isThemedPlugin = (plug instanceof FredPluginThemed);
 		isL10nPlugin = (plug instanceof FredPluginL10n);
 		isUpdatedablePlugin = (plug instanceof FredPluginUoF);
@@ -209,4 +211,12 @@
 	public synchronized boolean isStopping() {
 		return stopping;
 	}
+
+	public long getPluginLongVersion() {
+		if (isLongVersionedPlugin) {
+			return ((FredPluginRealVersioned)plug).getRealVersion();
+		} else {
+			return -1;
+		}
+	}
 }
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.