Author: jflesch
Date: 2007-12-03 18:21:29 +0000 (Mon, 03 Dec 2007)
New Revision: 16229
Modified:
trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java
trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java
Log:
Fix index importation : Don't refresh immediatly imported indexes + sort
correctly the indexes in the tree
Modified: trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java 2007-12-03
17:53:06 UTC (rev 16228)
+++ trunk/apps/Thaw/src/thaw/plugins/index/DatabaseManager.java 2007-12-03
18:21:29 UTC (rev 16229)
@@ -617,7 +617,7 @@
folders[folderLevel],
attrs.getValue("publicKey"),
attrs.getValue("privateKey"),
-
false);
+
false, false);
if (index != null) {
index.rename(attrs.getValue("displayName"));
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
2007-12-03 17:53:06 UTC (rev 16228)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
2007-12-03 18:21:29 UTC (rev 16229)
@@ -344,8 +344,14 @@
publicKey = dialog.getPublicKey();
privateKey = dialog.getPrivateKey();
+ /* https://bugs.freenetproject.org/view.php?id=1625:
+ * --- 0001625: Added index not in the correct category
+ * If you add an index from the link list instead of
the unknown index list,
+ * it's added in the same folder than the index
instead of "recently added".
+ * ==> Target == null
+ */
IndexManagementHelper.reuseIndex(getQueueManager(),
getIndexBrowserPanel(),
-
(IndexFolder)getTarget(), publicKey, privateKey,
+ null, publicKey,
privateKey,
false /* autosort */);
}
}
@@ -416,17 +422,10 @@
IndexFolder parent;
- /* https://bugs.freenetproject.org/view.php?id=1625:
- * --- 0001625: Added index not in the correct category
- * If you add an index from the link list instead of the
unknown index list,
- * it's added in the same folder than the index instead of
"recently added".
- */
- /*
if (target != null)
parent = target;
else
- */
- parent =
indexBrowser.getIndexTree().getRoot().getRecentlyAddedFolder();
+ parent =
indexBrowser.getIndexTree().getRoot().getRecentlyAddedFolder();
int revision = FreenetURIHelper.getUSKRevision(publicKey);
Modified: trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java 2007-12-03
17:53:06 UTC (rev 16228)
+++ trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java 2007-12-03
18:21:29 UTC (rev 16229)
@@ -76,11 +76,17 @@
JMenuItem item;
JButton button;
+ /* https://bugs.freenetproject.org/view.php?id=1625:
+ * --- 0001625: Added index not in the correct category
+ * If you add an index from the link list instead of the
unknown index list,
+ * it's added in the same folder than the index instead of
"recently added".
+ * ==> addToParent == false
+ */
item = new
JMenuItem(I18n.getMessage("thaw.plugin.index.addIndexesFromLink"),
IconBox.minAdd);
button = new JButton(IconBox.indexReuse);
button.setToolTipText(I18n.getMessage("thaw.plugin.index.addIndexesFromLink"));
toolbarActions.add(new LinkManagementHelper.IndexAdder(button,
queueManager,
-
indexBrowser, true));
+
indexBrowser, false));
toolbarModifier.addButtonToTheToolbar(button);
rightClickMenu.add(item);