Author: jflesch
Date: 2007-03-26 00:56:55 +0000 (Mon, 26 Mar 2007)
New Revision: 12376

Modified:
   trunk/apps/Thaw/src/thaw/i18n/thaw.properties
   trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
   trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerMonitorPanel.java
Log:
Improve a little bit the PeerMonitor display regarding peer informations

Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2007-03-26 00:53:45 UTC 
(rev 12375)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2007-03-26 00:56:55 UTC 
(rev 12376)
@@ -306,7 +306,7 @@
 thaw.plugin.index.indexLoading=Index loading


-thaw.plugin.peerMonitor.peerMonitor=Freenet connection status
+thaw.plugin.peerMonitor.peerMonitor=Connection
 thaw.plugin.peerMonitor.yourReference=Your reference:
 thaw.plugin.peerMonitor.copyReference=Copy your reference to the clipboard
 thaw.plugin.peerMonitor.nodeStats=Node informations
@@ -321,11 +321,13 @@
 thaw.plugin.peerMonitor.infos.peer.myName=Node name
 thaw.plugin.peerMonitor.infos.peer.physical.udp=IP address
 thaw.plugin.peerMonitor.infos.peer.averagePingTime=Average ping time
+thaw.plugin.peerMonitor.infos.peer.idle=Idle

 thaw.plugin.peerMonitor.infos.node.overallSize=Datastore size
 thaw.plugin.peerMonitor.infos.node.uptimeSeconds=Uptime
 thaw.plugin.peerMonitor.infos.node.networkSizeEstimateSession=Network size 
estimation
 thaw.plugin.peerMonitor.infos.node.myName=Node name
+
 thaw.plugin.peerMonitor.infos.nodeMemory=Node memory
 thaw.plugin.peerMonitor.infos.thawMemory=Thaw memory


Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties    2007-03-26 00:53:45 UTC 
(rev 12375)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties    2007-03-26 00:56:55 UTC 
(rev 12376)
@@ -313,7 +313,7 @@
 thaw.plugin.index.indexLoading=Chargement d'index


-thaw.plugin.peerMonitor.peerMonitor=Status de la connexion Freenet
+thaw.plugin.peerMonitor.peerMonitor=Connexion
 thaw.plugin.peerMonitor.yourReference=Votre reference:
 thaw.plugin.peerMonitor.copyReference=Copier votre reference vers le 
presse-papier
 thaw.plugin.peerMonitor.nodeStats=Informations sur votre noeud
@@ -328,6 +328,7 @@
 thaw.plugin.peerMonitor.infos.peer.myName=Nom du noeud
 thaw.plugin.peerMonitor.infos.peer.physical.udp=Adress IP
 thaw.plugin.peerMonitor.infos.peer.averagePingTime=Temps de r\u00e9ponse moyen
+thaw.plugin.peerMonitor.infos.peer.idle=Inactif depuis

 thaw.plugin.peerMonitor.infos.node.overallSize=Taille du datastore
 thaw.plugin.peerMonitor.infos.node.uptimeSeconds=Uptime

Modified: trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerMonitorPanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerMonitorPanel.java  
2007-03-26 00:53:45 UTC (rev 12375)
+++ trunk/apps/Thaw/src/thaw/plugins/peerMonitor/PeerMonitorPanel.java  
2007-03-26 00:56:55 UTC (rev 12376)
@@ -64,7 +64,7 @@
        public final static Color JLIST_NODE_STAT_BACKGROUND = Color.WHITE;
        public final static Color JLIST_PEER_BACKGROUND = new 
Color(240,240,240);

-       public final static int STR_INFO_MAX_LNG = 50;
+       public final static int STR_INFO_MAX_LNG = 55;
        public final static int STR_NODENAME_MAX_LNG = 15;

        private JPanel refPanel;
@@ -349,85 +349,96 @@
         * @return null if it must not be displayed ; else an array with two 
elements (key translated + value translated)
         */
        public String[] getTranslation(String key, String value) {
+               String [] result = null;

                /* PEERS */

-               if ("volatile.lastRoutingBackoffReason".equals(key))
-                       return new String[] {
+               if (result == null && 
"volatile.lastRoutingBackoffReason".equals(key))
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.peer.lastRoutingBackoffReason"),
                                value
                        };

-               if ("volatile.routingBackoffPercent".equals(key))
-                       return new String[] {
+               if (result == null && 
"volatile.routingBackoffPercent".equals(key))
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.peer.routingBackoffPercent"),
                                value + "%"
                        };

-               if ("version".equals(key))
-                       return new String[] {
+               if (result == null && "version".equals(key))
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.peer.version"),
                                value
                        };

-               if ("volatile.status".equals(key))
-                       return new String[] {
+               if (result == null && "volatile.status".equals(key))
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.peer.status"),
                                value
                        };

-               if ("myName".equals(key))
-                       return new String[] {
+               if (result == null && "myName".equals(key))
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.peer.myName"),
                                value
                        };


-               if ("physical.udp".equals(key))
-                       return new String[] {
+               if (result == null && "physical.udp".equals(key))
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.peer.physical.udp"),
                                value
                        };

-               if ("volatile.averagePingTime".equals(key))
-                       return new String[] {
+               if (result == null && "volatile.averagePingTime".equals(key))
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.peer.averagePingTime"),
                                Integer.toString(new Float(value).intValue()) + 
" ms"
                        };

+               if (result == null && "volatile.idle".equals(key))
+                       result = new String[] {
+                               
I18n.getMessage("thaw.plugin.peerMonitor.infos.peer.idle"),
+                               "~" + 
thaw.gui.GUIHelper.getPrintableTime(Long.parseLong(value) / 1000)
+                       };
+
                /* NODE */

-               if ("volatile.overallSize".equals(key))
-                       return new String[] {
+               if (result == null && "volatile.overallSize".equals(key))
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.node.overallSize"),
                                "~" + 
thaw.gui.GUIHelper.getPrintableSize(Long.parseLong(value))
                        };

-               if ("volatile.uptimeSeconds".equals(key)) {
-                       return new String[] {
+               if (result == null && "volatile.uptimeSeconds".equals(key)) {
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.node.uptimeSeconds"),
                                "~" + 
thaw.gui.GUIHelper.getPrintableTime(Long.parseLong(value))
                        };
                }

-               if ("volatile.networkSizeEstimateSession".equals(key)) {
-                       return new String[] {
+               if (result == null && 
"volatile.networkSizeEstimateSession".equals(key)) {
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.node.networkSizeEstimateSession"),
                                value
                        };
                }

-               if ("myName".equals(key)) {
-                       return new String[] {
+               if (result == null && "myName".equals(key)) {
+                       result = new String[] {
                                
I18n.getMessage("thaw.plugin.peerMonitor.infos.node.myName"),
                                value
                        };
                }

-               if (advanced)
-                       return new String[] { key, value };
+               if (advanced) {
+                       if (result == null)
+                               result = new String[] { key, value };
+                       else
+                               result[0] = result[0] + " ("+key+")";
+               }

-               return null;
+               return result;
        }




Reply via email to