Author: jflesch
Date: 2007-08-10 17:37:38 +0000 (Fri, 10 Aug 2007)
New Revision: 14578

Modified:
   trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
   trunk/apps/Thaw/src/thaw/i18n/thaw.properties
   trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
   trunk/apps/Thaw/src/thaw/plugins/index/IndexFolder.java
   trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
   trunk/apps/Thaw/src/thaw/plugins/index/IndexRoot.java
   trunk/apps/Thaw/src/thaw/plugins/index/LinkManagementHelper.java
   trunk/apps/Thaw/src/thaw/plugins/index/UnknownIndexList.java
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
Log:
Add the new indexes to a sub folder instead of the root

Modified: trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties     2007-08-10 
12:52:13 UTC (rev 14577)
+++ trunk/apps/Thaw/src/thaw/i18n/source.thaw_fr.properties     2007-08-10 
17:37:38 UTC (rev 14578)
@@ -409,6 +409,7 @@
 thaw.plugin.index.autoSortAction=Ranger cet index d'apr?s sa cat?gorie
 thaw.plugin.index.autoSortFolderAction=Ranger les indexes d'apr?s leur 
cat?gorie

+thaw.plugin.index.recentlyAdded=R?cemment ajout?s

 # Peer monitor


Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2007-08-10 12:52:13 UTC 
(rev 14577)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2007-08-10 17:37:38 UTC 
(rev 14578)
@@ -420,8 +420,10 @@
 thaw.plugin.index.automaticallySorted=Automatically sorted
 thaw.plugin.index.autoSortAction=Sort this index according to its category
 thaw.plugin.index.autoSortFolderAction=Sort the indexes according to their 
categories
+thaw.plugin.index.recentlyAdded=Recently added


+
 # Peer monitor

 thaw.plugin.peerMonitor.peerMonitor=Connection

Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties    2007-08-10 12:52:13 UTC 
(rev 14577)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties    2007-08-10 17:37:38 UTC 
(rev 14578)
@@ -409,6 +409,7 @@
 thaw.plugin.index.autoSortAction=Ranger cet index d'apr\u00e8s sa 
cat\u00e9gorie
 thaw.plugin.index.autoSortFolderAction=Ranger les indexes d'apr\u00e8s leur 
cat\u00e9gorie

+thaw.plugin.index.recentlyAdded=R\u00e9cemment ajout\u00e9s

 # Peer monitor

@@ -530,10 +531,14 @@
 thaw.plugin.transferLogs.chooseFile=Choisisez un fichier
 thaw.plugin.transferLogs.importedKey=Clef import\u00e9e

+## Tray icon
+
 thaw.plugin.trayIcon.pluginName=Ic\u00f4ne systray
 thaw.plugin.trayIcon.dialogTitle=Transferts Freenet
 thaw.plugin.trayIcon.java1.6=D\u00e9sol\u00e9, ce plugin n\u00e9cessite au 
moins Java 1.6 (parfois appell\u00e9 J2SE 6)
+thaw.plugin.trayIcon.emptyQueue=Aucun transfert en cours

+
 ## MDNS

 thaw.plugin.MDNS=Autod\u00e9tection de la node

Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexFolder.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexFolder.java     2007-08-10 
12:52:13 UTC (rev 14577)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexFolder.java     2007-08-10 
17:37:38 UTC (rev 14578)
@@ -25,6 +25,7 @@


 public class IndexFolder implements IndexTreeNode, MutableTreeNode {
+
        public static final int MAX_AUTOSORTING_DEPTH = 6;

        private static final long serialVersionUID = 2L;
@@ -113,7 +114,9 @@

        }

-
+       /**
+        * @param name case insensitive
+        */
        public IndexFolder getFolder(String name) {
                return (IndexFolder)folders.get(name.toLowerCase());
        }
@@ -296,7 +299,7 @@
                            Integer.toString(id)+" ("+toString()+")");

                if (child instanceof IndexFolder && folders != null) {
-                       folders.put( ((IndexFolder)child).toString(), child);
+                       folders.put( 
((IndexFolder)child).toString().toLowerCase(), child);
                }

                if (children != null) {
@@ -1274,13 +1277,13 @@

        public void forceFlagsReload() {
                if (children != null) {
-                       synchronized(children) {
-                               for (Iterator it = children.iterator();
-                                    it.hasNext();) {
-                                       IndexTreeNode child = 
(IndexTreeNode)it.next();
-                                       child.forceFlagsReload();
-                               }
+                       //synchronized(children) {
+                       for (Iterator it = children.iterator();
+                            it.hasNext();) {
+                               IndexTreeNode child = (IndexTreeNode)it.next();
+                               child.forceFlagsReload();
                        }
+                       //}
                }

                hasLastHasChangedValueBeenSet = false;

Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java   
2007-08-10 12:52:13 UTC (rev 14577)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java   
2007-08-10 17:37:38 UTC (rev 14578)
@@ -413,7 +413,7 @@
                if (target != null)
                        parent = target;
                else
-                       parent = indexBrowser.getIndexTree().getRoot();
+                       parent = 
indexBrowser.getIndexTree().getRoot().getRecentlyAddedFolder();

                int revision = FreenetURIHelper.getUSKRevision(publicKey);

@@ -655,7 +655,7 @@


        /**
-        * @param cat Example: "Automatically sorted/freenet/thaw" (only 
folders !)
+        * @param cat Example: "freenet/thaw" (only folders !)
         * @return the path in the tree
         */
        public static TreePath makeMyPath(IndexBrowserPanel indexBrowser, 
String cat, int maxDepth) {
@@ -663,8 +663,9 @@

                if (split == null) return null;

-               IndexFolder currentFolder = 
indexBrowser.getIndexTree().getRoot();
-               TreePath path = new TreePath(currentFolder);
+               IndexFolder root = indexBrowser.getIndexTree().getRoot();
+               IndexFolder currentFolder = 
indexBrowser.getIndexTree().getRoot().getAutoSortedFolder();
+               TreePath path = new TreePath(root);
                path = path.pathByAddingChild(currentFolder);

                for (int i = 0 ; i < split.length && i < maxDepth; i++) {
@@ -731,7 +732,7 @@
                        /**
                         * to avoid the collision due to the vector in the 
IndexFolder
                         */
-                       if 
(I18n.getMessage("thaw.plugin.index.automaticallySorted").equals(folder.toString()))
 {
+                       if (folder == null || "".equals(folder.toString())) {
                                return false;
                        }

@@ -757,8 +758,6 @@
                        return false;
                }

-               cat = 
I18n.getMessage("thaw.plugin.index.automaticallySorted")+"/"+cat;
-
                TreePath path = makeMyPath(indexBrowser, cat,
                                           IndexFolder.MAX_AUTOSORTING_DEPTH+1);


Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexRoot.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexRoot.java       2007-08-10 
12:52:13 UTC (rev 14577)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexRoot.java       2007-08-10 
17:37:38 UTC (rev 14578)
@@ -105,5 +105,32 @@

                Logger.notice(this, "Destruction of the world done, have a nice 
day.");
        }
+
+
+       public IndexFolder getOrCreateFolder(String folder) {
+               IndexFolder f = getFolder(folder);
+
+               if (f == null) {
+                       f = IndexManagementHelper.addIndexFolder(indexBrowser,
+                                                                this,
+                                                                folder);
+               }
+
+               return f;
+       }
+
+       /**
+        * create if it doesn't exist
+        */
+       public IndexFolder getAutoSortedFolder() {
+               return 
getOrCreateFolder(I18n.getMessage("thaw.plugin.index.automaticallySorted"));
+       }
+
+       /**
+        * create if it doesn't exist
+        */
+       public IndexFolder getRecentlyAddedFolder() {
+               return 
getOrCreateFolder(I18n.getMessage("thaw.plugin.index.recentlyAdded"));
+       }
 }


Modified: trunk/apps/Thaw/src/thaw/plugins/index/LinkManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/LinkManagementHelper.java    
2007-08-10 12:52:13 UTC (rev 14577)
+++ trunk/apps/Thaw/src/thaw/plugins/index/LinkManagementHelper.java    
2007-08-10 17:37:38 UTC (rev 14578)
@@ -106,7 +106,10 @@
                private boolean addToParent; /* (== add to the same parent 
folder) */
                private boolean autoSorting;

-
+               /**
+                * @param addToParent Try to add the new index to the same 
folder than the
+                *                    index from where comes the link
+                */
                public IndexAdder(final AbstractButton actionSource,
                                  final FCPQueueManager queueManager,
                                  final IndexBrowserPanel indexBrowser,

Modified: trunk/apps/Thaw/src/thaw/plugins/index/UnknownIndexList.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/UnknownIndexList.java        
2007-08-10 12:52:13 UTC (rev 14577)
+++ trunk/apps/Thaw/src/thaw/plugins/index/UnknownIndexList.java        
2007-08-10 17:37:38 UTC (rev 14578)
@@ -85,7 +85,8 @@

                autoSorting = new CheckBox(indexBrowser.getConfig(),
                                           "autoSorting",
-                                          
I18n.getMessage("thaw.plugin.index.autoSorting"));
+                                          
I18n.getMessage("thaw.plugin.index.autoSorting"),
+                                          true);

                autoSorting.addActionListener(this);
                panel.add(autoSorting, BorderLayout.SOUTH);
@@ -97,7 +98,8 @@

                button = new JButton(IconBox.indexReuse);
                
button.setToolTipText(I18n.getMessage("thaw.plugin.index.addIndexesFromLink"));
-               toolbarActions.add(new LinkManagementHelper.IndexAdder(button, 
queueManager, indexBrowser, true));
+               toolbarActions.add(new LinkManagementHelper.IndexAdder(button, 
queueManager,
+                                                                      
indexBrowser, false));
                toolbarModifier.addButtonToTheToolbar(button);

                list.addMouseListener(this);

Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java        
2007-08-10 12:52:13 UTC (rev 14577)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java        
2007-08-10 17:37:38 UTC (rev 14578)
@@ -393,8 +393,9 @@
                for (Iterator it = subMsgs.iterator();
                     it.hasNext();) {
                        SubMessage subMsg = (SubMessage)it.next();
-                       SubMessagePanel panel = new SubMessagePanel(subMsg,
-                                                                   (i + 
DEFAULT_UNFOLDED) < subMsgs.size());
+                       //SubMessagePanel panel = new SubMessagePanel(subMsg,
+                       //                                          (i + 
DEFAULT_UNFOLDED) < subMsgs.size());
+                       SubMessagePanel panel = new SubMessagePanel(subMsg, 
false);

                        subPanels.add(panel);



Reply via email to