Author: jflesch
Date: 2007-08-30 20:31:36 +0000 (Thu, 30 Aug 2007)
New Revision: 14931
Modified:
trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
Log:
Fix the 'download all the keys' option in minifrost
Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
2007-08-30 20:25:06 UTC (rev 14930)
+++ trunk/apps/Thaw/src/thaw/plugins/index/IndexManagementHelper.java
2007-08-30 20:31:36 UTC (rev 14931)
@@ -398,7 +398,11 @@
privateKey = null;
if (Index.isAlreadyKnown(indexBrowser.getDb(), publicKey, true)
>= 0) {
- Logger.notice(new IndexManagementHelper(), "Index
already added !");
+ String name =
FreenetURIHelper.getFilenameFromKey(publicKey);
+
+ if (name != null)
+ Logger.warning(new IndexManagementHelper(),
"Index '"+name+"' already added");
+
return null;
}
Modified: trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
2007-08-30 20:25:06 UTC (rev 14930)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/MessagePanel.java
2007-08-30 20:31:36 UTC (rev 14931)
@@ -544,25 +544,14 @@
}
}
- public void download(String key) {
+ public void download(String key, java.io.File destDir) {
FCPQueueManager queueManager =
messagePanel.getMainPanel().getPluginCore().getCore().getQueueManager();
- thaw.gui.FileChooser chooser = new
thaw.gui.FileChooser();
-
-
chooser.setTitle(I18n.getMessage("thaw.plugin.fetch.chooseDestination"));
- chooser.setDirectoryOnly(true);
-
chooser.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG);
-
- java.io.File file = chooser.askOneFile();
-
- if (file == null)
- return;
-
FCPClientGet get = new FCPClientGet(key,
FCPClientGet.DEFAULT_PRIORITY,
FCPClientGet.PERSISTENCE_FOREVER,
true /* global
queue */,
FCPClientGet.DEFAULT_MAX_RETRIES /* max retries */,
- file.getPath());
+ destDir.getPath());
queueManager.addQueryToThePendingQueue(get);
}
@@ -609,15 +598,37 @@
} else if (e.getSource() == chkActions[0]) { /*
download this key */
- download(key);
+ thaw.gui.FileChooser chooser = new
thaw.gui.FileChooser();
+
chooser.setTitle(I18n.getMessage("thaw.plugin.fetch.chooseDestination"));
+ chooser.setDirectoryOnly(true);
+
chooser.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG);
+
+ java.io.File file = chooser.askOneFile();
+
+ if (file == null)
+ return;
+
+ download(key, file);
+
} else if (e.getSource() == chkActions[1]) { /*
download all the keys */
+ thaw.gui.FileChooser chooser = new
thaw.gui.FileChooser();
+
+
chooser.setTitle(I18n.getMessage("thaw.plugin.fetch.chooseDestination"));
+ chooser.setDirectoryOnly(true);
+
chooser.setDialogType(javax.swing.JFileChooser.OPEN_DIALOG);
+
+ java.io.File file = chooser.askOneFile();
+
+ if (file == null)
+ return;
+
Vector v = messagePanel.getCHKKeys();
for (Iterator it = v.iterator();
it.hasNext();) {
- download((String)it.next());
+ download((String)it.next(), file);
}
} else if (e.getSource() == indexActions[0]) { /* add
this index */