From nextgens at freenetproject.org Mon Sep 11 17:19:31 2006 From: nextgens at freenetproject.org (nextgens at freenetproject.org) Date: Mon, 11 Sep 2006 17:19:31 +0000 (UTC) Subject: [Thaw-dev] r10456 - trunk/apps/Thaw/src/thaw/fcp Message-ID: <20060911171931.1E5F89BB92@emu.freenetproject.org> Author: nextgens Date: 2006-09-11 17:19:28 +0000 (Mon, 11 Sep 2006) New Revision: 10456 Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java Log: fix a typo Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java =================================================================== --- trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-11 16:17:35 UTC (rev 10455) +++ trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-11 17:19:28 UTC (rev 10456) @@ -313,7 +313,7 @@ toTheNodeProgress= 0; - status = "Waiting socket availability"; + status = "Waiting for socket availability"; Logger.info(this, "Another file is being uploaded ... waiting ..."); From usurp at freenetproject.org Fri Sep 15 14:01:39 2006 From: usurp at freenetproject.org (usurp at freenetproject.org) Date: Fri, 15 Sep 2006 14:01:39 +0000 (UTC) Subject: [Thaw-dev] r10482 - trunk/apps/Thaw/src/thaw/i18n Message-ID: <20060915140139.7BBAF9BB58@emu.freenetproject.org> Author: usurp Date: 2006-09-15 14:01:36 +0000 (Fri, 15 Sep 2006) New Revision: 10482 Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties Log: Update french translation Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties =================================================================== --- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2006-09-15 11:47:35 UTC (rev 10481) +++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2006-09-15 14:01:36 UTC (rev 10482) @@ -15,6 +15,12 @@ thaw.common.insertions=Insertions thaw.common.downloads=T?l?chargements +thaw.common.uploading=Uploade + +thaw.common.downloading=T?l?charge +thaw.common.inserting=Ins?re + +thaw.common.action.download=T?l?charger thaw.common.fetch=R?cup?rer thaw.common.file=Fichier @@ -55,6 +61,8 @@ thaw.common.unknown=Inconnu thaw.common.estimation=estimation thaw.common.failed=ECHEC +thaw.common.done=Termin? +thaw.common.ok=Ok ## Errors thaw.error.idAlreadyUsed=Impossible de se connecter. Notre Id est d?j? utilis? par un autre client connect? au noeud. @@ -69,7 +77,7 @@ thaw.menu.item.about=? propos ## Status bar -thaw.statusBar.initPlugins=Loading plugins ... +thaw.statusBar.initPlugins=Chargement des plugins ... thaw.statusBar.ready=Pr?t thaw.statusBar.connecting=Connection ... @@ -92,6 +100,7 @@ thaw.config.advancedMode=Mode avanc? + ##?Plugins thaw.plugin.insert.fileToInsert=Fichier ? ins?rer thaw.plugin.insert.filesToInsert=Fichier(s) ? ins?rer @@ -121,6 +130,7 @@ thaw.plugin.fetch.destinationDirectory=R?pertoire de destination thaw.plugin.fetch.chooseDestination=Choisir la destination ... thaw.plugin.fetch.pasteFromClipboard=Coller depuis le presse-papier +thaw.plugin.fetch.chooseADestination=Vous devez choisir une destination thaw.plugin.console.console=Console thaw.plugin.console.saveToFile=Sauvegarder les logs dans un fichier @@ -133,8 +143,8 @@ thaw.plugin.statistics.running=En cours: thaw.plugin.statistics.pending=En attente: - thaw.plugin.restarter.restarter=Red?marre les t?l?chargements ?chou?s +# If someone find a better name for the following one ... thaw.plugin.restarter.configTabName=T?l?chargements ?chou?s thaw.plugin.restarter.interval=Intervale entre chaque red?marrage (in seconds) thaw.plugin.restarter.restartFatals=R?d?marrer aussi les t?l?chargements consid?r?s comme fatalement ?chou?s @@ -142,12 +152,14 @@ ## Warnings thaw.warning.title=Avertissement -thaw.warning.isWriting=Attention ! Thaw est entrain d'?changer des informations avec la node.\nIl serait pr?f?rable de vous d?connecter une fois ces envois finis.\nEtes-vous s?r de vouloir vous d?connecter ? +thaw.warning.isWriting=Attention ! Thaw est en train d'?changer des informations avec la node.\nIl serait pr?f?rable de vous d?connecter une fois ces envois finis.\nEtes-vous s?r de vouloir vous d?connecter ? thaw.warning.isWritingSoApplyLater=Attention ! Thaw est en train d'?changer des informations avec la node,\net changer des param?tres d?connecte/reconnecte Thaw.\nEtes-vous s?r de vouloir les changer maintenant ? thaw.warning.disconnected=Thaw a ?t? d?connect?, voulez-vous essayer de vous reconnecter ? thaw.warning.unableToConnectTo=Impossible de se connecter ? -thaw.warning.autoreconnecting=D?connect?. Thaw est entrain d'essayer de se reconnecter ... +thaw.warning.autoreconnecting=D?connect?. Thaw est en train d'essayer de se reconnecter ... + + ## Toolbar thaw.toolbar.title=Bar d'outils de Thaw thaw.toolbar.button.connect=Se connecter @@ -155,10 +167,57 @@ thaw.toolbar.button.settings=R?glages thaw.toolbar.button.quit=Quitter + ## About thaw.about.title=? propos thaw.about.l1=Thaw thaw.about.l2=par J?r?me Flesch thaw.about.l3=2006(c) Freenet Project Incorporated thaw.about.l4=sous GPLv2 -thaw.about.l6=Th?me d'icones "Gorilla" cr?? par Jimmac (http://jimmac.musichall.cz/icons.php) \ No newline at end of file +thaw.about.l6=Th?me d'icones "Gorilla" cr?? par Jimmac (http://jimmac.musichall.cz/icons.php) + + +## HsqlDb +thaw.plugin.hsqldb.database=Base de donn?es +thaw.plugin.hsqldb.console=Console Sql + +## Index management + +# In internal, thaw use the word "category" instead of "folders" + +thaw.plugin.index.category=Cat?gorie + +thaw.plugin.index.editor=Vos fichiers partag?s +thaw.plugin.index.browser=Navigateur d'index + +thaw.plugin.index.yourIndexes=Vos indexs +thaw.plugin.index.indexes=Indexs + +thaw.plugin.index.addIndex=Add a file index +thaw.plugin.index.createIndex=Cr?er a file index +thaw.plugin.index.addCategory=Ajouter un r?pertoire +thaw.plugin.index.rename=Renommer +thaw.plugin.index.delete=Effacer +thaw.plugin.index.insertIndex=Ins?rer / mettre ? jour cet index +thaw.plugin.index.insertIndexes=Ins?rer / mettre ? jour ces indexs +thaw.plugin.index.downloadIndex=T?l?charger / mettre ? jour cet index +thaw.plugin.index.downloadIndexes=T?l?charger / mettre ? jour ces indexs +thaw.plugin.index.copyKey=Copier les cl?s de l'index dans le presse-papiers +thaw.plugin.index.recalculateKeys=Recalculer les cl?s + +thaw.plugin.index.categoryName=Nom du r?pertoire ? +thaw.plugin.index.indexNamethaw.plugin.fetch.chooseADestination=You must choose a destination=Nom de l'index ? + +thaw.plugin.index.newCategory=Nouveau r?pertoire +thaw.plugin.index.newIndex=Nouvel index + +thaw.plugin.index.indexKey=Cl? de l'index ? + +thaw.plugin.index.search.label=Rechercher dans ce r?pertoire / index +thaw.plugin.index.search.apply=Rechercher + +thaw.plugin.index.addFilesWithInserting=Ins?rer les fichier(s) sur Freenet et les ajouter ? cet index +thaw.plugin.index.addFilesWithoutInserting=Ajouter les fichier(s) ? cet index +thaw.plugin.index.addLink=Ajouter un lien vers un autre index + +thaw.plugin.index.insert=Ins?rer From jflesch at freenetproject.org Fri Sep 29 13:22:43 2006 From: jflesch at freenetproject.org (jflesch at freenetproject.org) Date: Fri, 29 Sep 2006 13:22:43 +0000 (UTC) Subject: [Thaw-dev] r10563 - trunk/apps/Thaw/src/thaw/fcp Message-ID: <20060929132243.E0B5C9CCF0@emu.freenetproject.org> Author: jflesch Date: 2006-09-29 13:22:42 +0000 (Fri, 29 Sep 2006) New Revision: 10563 Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java Log: Fix CHK keys when inserting Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java =================================================================== --- trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-29 12:29:41 UTC (rev 10562) +++ trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-29 13:22:42 UTC (rev 10563) @@ -400,7 +400,10 @@ progress = 0; running = true; - status = "Inserting"; + if (!getCHKOnly) + status = "Inserting"; + else + status = "Computing"; setChanged(); notifyObservers(); @@ -533,10 +536,8 @@ finished = false; successful = false; - if(keyType == 0) - publicKey = msg.getValue("URI") + "/" + getFilename(); - else - publicKey = msg.getValue("URI"); + publicKey = msg.getValue("URI"); + publicKey = publicKey.replaceAll("freenet:", ""); Logger.info(this, "URIGenerated: "+publicKey); @@ -707,7 +708,10 @@ //if(fileSize == 0) // fileSize = BLOCK_SIZE * required; // NOT RELIABLE - status = "Inserting"; + if (!getCHKOnly) + status = "Inserting"; + else + status = "Computing"; setChanged(); notifyObservers(); @@ -830,7 +834,6 @@ * @return public key */ public String getFileKey() { - return publicKey; } @@ -844,7 +847,7 @@ if(keyType == 0 && publicKey != null) key = publicKey; if(keyType == 0 && publicKey == null) - key = "CHK at coinCoin/"+name; + key = "CHK@"; if(keyType == 1) key = "KSK@" + name + "-"+ Integer.toString(rev); if(keyType == 2) From jflesch at freenetproject.org Fri Sep 29 13:33:44 2006 From: jflesch at freenetproject.org (jflesch at freenetproject.org) Date: Fri, 29 Sep 2006 13:33:44 +0000 (UTC) Subject: [Thaw-dev] r10564 - in trunk/apps/Thaw: images src/thaw/core src/thaw/fcp src/thaw/i18n src/thaw/plugins/index Message-ID: <20060929133344.744AF20AFA6@emu.freenetproject.org> Author: jflesch Date: 2006-09-29 13:33:39 +0000 (Fri, 29 Sep 2006) New Revision: 10564 Added: trunk/apps/Thaw/images/application-internet.png trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java Modified: trunk/apps/Thaw/src/thaw/core/FileChooser.java trunk/apps/Thaw/src/thaw/core/IconBox.java trunk/apps/Thaw/src/thaw/core/Logger.java trunk/apps/Thaw/src/thaw/core/Main.java trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java trunk/apps/Thaw/src/thaw/fcp/FCPConnection.java trunk/apps/Thaw/src/thaw/i18n/thaw.properties trunk/apps/Thaw/src/thaw/plugins/index/File.java trunk/apps/Thaw/src/thaw/plugins/index/FileList.java trunk/apps/Thaw/src/thaw/plugins/index/FileTable.java trunk/apps/Thaw/src/thaw/plugins/index/Index.java trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java trunk/apps/Thaw/src/thaw/plugins/index/IndexEditorPanel.java trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java trunk/apps/Thaw/src/thaw/plugins/index/Link.java trunk/apps/Thaw/src/thaw/plugins/index/SearchResult.java Log: Add TargetFilename field to ClientPut requests and fix again CHK keys when inserting Added: trunk/apps/Thaw/images/application-internet.png =================================================================== (Binary files differ) Property changes on: trunk/apps/Thaw/images/application-internet.png ___________________________________________________________________ Name: svn:mime-type + application/octet-stream Modified: trunk/apps/Thaw/src/thaw/core/FileChooser.java =================================================================== --- trunk/apps/Thaw/src/thaw/core/FileChooser.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/core/FileChooser.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -28,7 +28,7 @@ if(v) fileChooser.setFileSelectionMode(JFileChooser.DIRECTORIES_ONLY); else - fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); + fileChooser.setFileSelectionMode(JFileChooser.FILES_AND_DIRECTORIES); /* Directories -> Recursivity */ } /** @@ -68,7 +68,14 @@ return fileChooser.getSelectedFile(); } + + protected File[] expandRecursivly(File[] selectedFiles) + { + /* TODO */ + return selectedFiles; + } + /** * @return null if nothing choosed. */ @@ -77,10 +84,8 @@ if(!showDialog()) return null; - - - - return fileChooser.getSelectedFiles(); + + return expandRecursivly(fileChooser.getSelectedFiles()); } } Modified: trunk/apps/Thaw/src/thaw/core/IconBox.java =================================================================== --- trunk/apps/Thaw/src/thaw/core/IconBox.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/core/IconBox.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -36,6 +36,8 @@ public static ImageIcon insertAndAddToIndexAction; + public static ImageIcon makeALinkAction; + public static ImageIcon minIndex; public static ImageIcon clearAction; @@ -121,6 +123,9 @@ new ImageIcon((new IconBox()).getClass().getClassLoader().getResource("folder.png")); insertAndAddToIndexAction = new ImageIcon((new IconBox()).getClass().getClassLoader().getResource("folder-new.png")); + makeALinkAction = + new ImageIcon((new IconBox()).getClass().getClassLoader().getResource("application-internet.png")); + reconnectAction = new ImageIcon((new IconBox()).getClass().getClassLoader().getResource("view-refresh.png")); Modified: trunk/apps/Thaw/src/thaw/core/Logger.java =================================================================== --- trunk/apps/Thaw/src/thaw/core/Logger.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/core/Logger.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -94,10 +94,10 @@ * As it. Similar to verbose() */ public static void asIt(Object o, String msg) { - if(LOG_LEVEL >= 5) { + //if(LOG_LEVEL >= 5) { System.out.println(msg); notifyLogListeners(msg); - } + //} } Modified: trunk/apps/Thaw/src/thaw/core/Main.java =================================================================== --- trunk/apps/Thaw/src/thaw/core/Main.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/core/Main.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -12,8 +12,8 @@ */ public class Main { - //public final static String VERSION="0.6 WIP r at custom@"; - public final static String VERSION="0.5 Beta"; + public final static String VERSION="0.6 WIP r at custom@"; + //public final static String VERSION="0.5 Beta"; /** * Look & feel use by GUI front end Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java =================================================================== --- trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -377,6 +377,8 @@ default: Logger.notice(this, "Unknow persistence !?"); break; } + msg.setValue("TargetFilename", localFile.getName()); + msg.setValue("UploadFrom", "direct"); msg.setAmountOfDataWaiting(localFile.length()); @@ -561,15 +563,6 @@ status = "Inserting"; - if(keyType == 0) - publicKey = publicKey + "/" +name; - - /* - if(keyType > 0) - publicKey = publicKey + "/" + name + "-" + Integer.toString(rev); - */ - - setChanged(); notifyObservers(); return; Modified: trunk/apps/Thaw/src/thaw/fcp/FCPConnection.java =================================================================== --- trunk/apps/Thaw/src/thaw/fcp/FCPConnection.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/fcp/FCPConnection.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -18,7 +18,7 @@ * Call observer when connected / disconnected.
* WARNING: This FCP implement don't guarantee that messages are sent in the same order than initally put * if the lock on writting is not set !
- * TODO: Add functions socketToFile(long size, File file) / fileToSocket(File file) + * TODO: Add functions socketToStream(long size, OutputStream file) / streamToSocket(InputStream file) */ public class FCPConnection extends Observable { /** If == true, then will print on stdout @@ -428,9 +428,9 @@ return result; } catch (java.io.IOException e) { - if(isConnected()) { + if(isConnected()) Logger.error(this, "IOException while reading but still connected, wtf? : "+e.toString()); - } else + else Logger.notice(this, "IOException. Disconnected."); disconnect(); Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties =================================================================== --- trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties 2006-09-29 13:33:39 UTC (rev 10564) @@ -64,6 +64,8 @@ thaw.common.done=Done thaw.common.ok=Ok +thaw.common.search=Search + ## Errors thaw.error.idAlreadyUsed=Unable to connect. Our Id is already used by another client connected to the node. @@ -185,6 +187,8 @@ # In internal, thaw use the word "category" instead of "folders" +thaw.plugin.index.index=Index + thaw.plugin.index.category=Category thaw.plugin.index.editor=Your shared files @@ -198,10 +202,10 @@ thaw.plugin.index.addCategory=Add a folder thaw.plugin.index.rename=Rename thaw.plugin.index.delete=Delete -thaw.plugin.index.insertIndex=Insert / update this index -thaw.plugin.index.insertIndexes=Insert / update these indexes -thaw.plugin.index.downloadIndex=Download / update this index -thaw.plugin.index.downloadIndexes=Download / update these indexes +thaw.plugin.index.insertIndex=[Re]insert this index +thaw.plugin.index.insertIndexes=[Re]insert these indexes +thaw.plugin.index.downloadIndex=[Re]download this index +thaw.plugin.index.downloadIndexes=[Re]download these indexes thaw.plugin.index.copyKey=Copy index key(s) to clipboard thaw.plugin.index.recalculateKeys=Recalculate keys @@ -211,9 +215,9 @@ thaw.plugin.index.newCategory=New folder thaw.plugin.index.newIndex=New index -thaw.plugin.index.indexKey=Index key ? +thaw.plugin.index.indexKey=Index key: -thaw.plugin.index.search.label=Search in this folder / index +thaw.plugin.index.search.label=Search: thaw.plugin.index.search.apply=Search thaw.plugin.index.addFilesWithInserting=Insert file(s) on Freenet and add them to this index @@ -221,3 +225,8 @@ thaw.plugin.index.addLink=Add a link to another index thaw.plugin.index.insert=Insert + +thaw.plugin.index.fileList=File list +thaw.plugin.index.linkList=Link list + +thaw.plugin.index.selectIndex=Select an index or specify the key Modified: trunk/apps/Thaw/src/thaw/plugins/index/File.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/File.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/File.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -206,8 +206,6 @@ else st.setNull(6, Types.VARCHAR); - Logger.info(this, "PARENT : "+parent.getId()); - st.setInt(7, parent.getId()); st.execute(); Modified: trunk/apps/Thaw/src/thaw/plugins/index/FileList.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/FileList.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/FileList.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -3,11 +3,11 @@ import java.util.Vector; /** - * List files, but also links. + * List files */ public interface FileList { - public void loadLists(String fileColumnToSort, boolean asc); + public void loadFiles(String fileColumnToSort, boolean asc); /** * Must returns a copy of the vector it's using ! @@ -18,12 +18,7 @@ public thaw.plugins.index.File getFile(int index); /** - * Must returns a copy of the vector it's using ! - */ - public Vector getLinkList(); - - /** * Can update the database. */ - public void unloadLists(); + public void unloadFiles(); } Modified: trunk/apps/Thaw/src/thaw/plugins/index/FileTable.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/FileTable.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/FileTable.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -25,6 +25,7 @@ import javax.swing.JMenu; import javax.swing.JFileChooser; import javax.swing.JProgressBar; +import javax.swing.JLabel; import java.awt.Toolkit; import java.awt.datatransfer.Clipboard; @@ -41,12 +42,12 @@ import thaw.fcp.*; public class FileTable implements MouseListener, KeyListener, ActionListener { + + private JPanel panel; private JTable table; private FileListModel fileListModel; - private JPanel panel; - private FileList fileList = null; private boolean modifiables; @@ -66,13 +67,10 @@ public FileTable(boolean modifiables, FCPQueueManager queueManager) { this.queueManager = queueManager; - panel = new JPanel(); - panel.setLayout(new BorderLayout(10, 10)); this.modifiables = modifiables; - + - rightClickMenu = new JPopupMenu(); if(modifiables) { @@ -102,21 +100,27 @@ table.addMouseListener(this); + panel = new JPanel(); + panel.setLayout(new BorderLayout()); + + panel.add(new JLabel(I18n.getMessage("thaw.plugin.index.fileList")), BorderLayout.NORTH); + panel.add(new JScrollPane(table)); + } - public JScrollPane getPanel() { - return new JScrollPane(table); + public JPanel getPanel() { + return panel; } public void setFileList(FileList fileList) { if(this.fileList != null) { - this.fileList.unloadLists(); + this.fileList.unloadFiles(); } if(fileList != null) { - fileList.loadLists(null, true); + fileList.loadFiles(null, true); } this.fileList = fileList; @@ -180,7 +184,10 @@ for(int i = 0 ; i < selectedRows.length ; i++) { if(e.getSource() == removeFiles) { - index.removeFile((thaw.plugins.index.File)files.get(selectedRows[i])); + thaw.plugins.index.File file = (thaw.plugins.index.File)files.get(selectedRows[i]); + if (file.getTransfer() != null) + file.getTransfer().stop(queueManager); + index.removeFile(file); } if(e.getSource() == insertFiles) { @@ -353,13 +360,6 @@ public void refresh(TableModelEvent e) { fireTableChanged(e); - /* - TableModelListener[] listeners = getTableModelListeners(); - - for(int i = 0 ; i < listeners.length ; i++) { - listeners[i].tableChanged(e); - } - */ } public void update(java.util.Observable o, Object param) { @@ -413,10 +413,12 @@ bar.setString(I18n.getMessage("thaw.common.ok")); if(!query.isFinished()) { - if(query instanceof FCPClientGet) + /*if(query instanceof FCPClientGet) bar.setString(I18n.getMessage("thaw.common.downloading")); else bar.setString(I18n.getMessage("thaw.common.uploading")); + */ + bar.setString(query.getStatus()); } return bar; Modified: trunk/apps/Thaw/src/thaw/plugins/index/Index.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/Index.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -177,7 +177,7 @@ public void delete() { try { - loadLists(null, false); + loadFiles(null, false); for(Iterator fileIt = fileList.iterator(); fileIt.hasNext(); ) { @@ -361,7 +361,7 @@ ////// FILE LIST //////// - public void loadLists(String columnToSort, boolean asc) { + public void loadFiles(String columnToSort, boolean asc) { if(fileList != null) return; @@ -414,11 +414,8 @@ return (thaw.plugins.index.File)fileList.get(index); } - public Vector getLinkList() { - return null; - } - public void unloadLists() { + public void unloadFiles() { for(Iterator it = fileList.iterator(); it.hasNext(); ) { thaw.plugins.index.File file = (thaw.plugins.index.File)it.next(); @@ -567,7 +564,7 @@ Element files = xmlDoc.createElement("files"); if(fileList == null) { - loadLists(null, true); + loadFiles(null, true); } for(Iterator it = getFileList().iterator(); Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/IndexBrowserPanel.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -28,11 +28,9 @@ private JSplitPane split; private JPanel listAndDetails; - private FileTable fileTable; + private Tables tables; private FileDetailsEditor fileDetails; - private FileList fileList = null; - private Hsqldb db; private FCPQueueManager queueManager; @@ -41,15 +39,15 @@ this.db = db; this.queueManager = queueManager; - indexTree = new IndexTree(I18n.getMessage("thaw.plugin.index.indexes"), false, queueManager, db); + indexTree = new IndexTree(I18n.getMessage("thaw.plugin.index.indexes"), false, false, queueManager, db); listAndDetails = new JPanel(); listAndDetails.setLayout(new BorderLayout(10, 10)); - fileTable = new FileTable(false, queueManager); + tables = new Tables(false, queueManager); fileDetails = new FileDetailsEditor(false); - listAndDetails.add(fileTable.getPanel(), BorderLayout.CENTER); + listAndDetails.add(tables.getPanel(), BorderLayout.CENTER); listAndDetails.add(fileDetails.getPanel(), BorderLayout.SOUTH); split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, @@ -67,11 +65,11 @@ public void save() { indexTree.save(); } - - public void setFileList(FileList l) { - this.fileList = l; - fileTable.setFileList(l); + + protected void setFileList(FileList l) { + tables.getFileTable().setFileList(l); } + public void valueChanged(javax.swing.event.TreeSelectionEvent e) { javax.swing.tree.TreePath path = e.getPath(); Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexEditorPanel.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/IndexEditorPanel.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/IndexEditorPanel.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -28,12 +28,13 @@ private JSplitPane split; private JPanel listAndDetails; - private FileTable fileTable; + private Tables tables; private FileDetailsEditor fileDetails; private JToolBar toolBar; private JButton addButton; private JButton insertAndAddButton; + private JButton linkButton; private FileList fileList = null; @@ -45,12 +46,12 @@ this.db = db; this.queueManager = queueManager; - indexTree = new IndexTree(I18n.getMessage("thaw.plugin.index.yourIndexes"), true, queueManager, db); + indexTree = new IndexTree(I18n.getMessage("thaw.plugin.index.yourIndexes"), true, false, queueManager, db); listAndDetails = new JPanel(); - listAndDetails.setLayout(new BorderLayout(10, 10)); + listAndDetails.setLayout(new BorderLayout(0, 0)); - fileTable = new FileTable(true, queueManager); + tables = new Tables(true, queueManager); fileDetails = new FileDetailsEditor(true); toolBar = new JToolBar(); @@ -60,17 +61,22 @@ addButton.setToolTipText(I18n.getMessage("thaw.plugin.index.addFilesWithoutInserting")); insertAndAddButton = new JButton(IconBox.insertAndAddToIndexAction); insertAndAddButton.setToolTipText(I18n.getMessage("thaw.plugin.index.addFilesWithInserting")); + linkButton = new JButton(IconBox.makeALinkAction); + linkButton.setToolTipText(I18n.getMessage("thaw.plugin.index.addLink")); addButton.addActionListener(this); insertAndAddButton.addActionListener(this); + linkButton.addActionListener(this); buttonsEnabled(false); toolBar.add(addButton); toolBar.add(insertAndAddButton); + toolBar.addSeparator(); + toolBar.add(linkButton); listAndDetails.add(toolBar, BorderLayout.NORTH); - listAndDetails.add(fileTable.getPanel(), BorderLayout.CENTER); + listAndDetails.add(tables.getPanel(), BorderLayout.CENTER); listAndDetails.add(fileDetails.getPanel(), BorderLayout.SOUTH); split = new JSplitPane(JSplitPane.HORIZONTAL_SPLIT, @@ -92,13 +98,14 @@ public void buttonsEnabled(boolean a) { addButton.setEnabled(a); insertAndAddButton.setEnabled(a); + linkButton.setEnabled(a); } - public void setFileList(FileList l) { + protected void setFileList(FileList l) { buttonsEnabled(l != null && l instanceof Index); this.fileList = l; - fileTable.setFileList(l); + tables.getFileTable().setFileList(l); } public void valueChanged(javax.swing.event.TreeSelectionEvent e) { @@ -128,6 +135,11 @@ public void actionPerformed(ActionEvent e) { + if (e.getSource() == linkButton) { + Thread linkMakerThread = new Thread(new LinkMaker()); + linkMakerThread.start(); + } + if(e.getSource() == addButton || e.getSource() == insertAndAddButton) { FileChooser fileChooser = new FileChooser(); @@ -176,6 +188,18 @@ } + public class LinkMaker implements Runnable { + public LinkMaker() { + + } + + public void run() { + IndexSelecter indexSelecter = new IndexSelecter(); + String indexKey = indexSelecter.askForAnIndexURI(db); + + } + } + public void update(java.util.Observable o, Object param) { if(o instanceof FCPClientPut) { FCPClientPut clientPut = (FCPClientPut)o; Modified: trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/IndexTree.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -46,11 +46,12 @@ /** * Manages the index tree and its menu (right-click). */ -public class IndexTree implements MouseListener, ActionListener, java.util.Observer { +public class IndexTree extends java.util.Observable implements MouseListener, ActionListener, java.util.Observer { private JPanel panel; - private JDragTree tree; + //private JDragTree tree; + private JTree tree; private IndexCategory root; private JPopupMenu indexCategoryMenu; @@ -68,6 +69,7 @@ private JMenuItem copyKey; private boolean modifiables; + private boolean selectionOnly; private IndexTreeNode selectedNode; @@ -81,15 +83,18 @@ * @param modifiables If set to true, then only indexes having private keys will * be displayed else only indexes not having private keys will * be displayed. + * @param queueManager Not used if selectionOnly is set to true */ - public IndexTree(String name, + public IndexTree(String rootName, boolean modifiables, + boolean selectionOnly, FCPQueueManager queueManager, Hsqldb db) { this.queueManager = queueManager; this.db = db; this.modifiables = modifiables; + this.selectionOnly = selectionOnly; panel = new JPanel(); panel.setLayout(new BorderLayout(10, 10)); @@ -145,15 +150,21 @@ deleteIndex.addActionListener(this); - root = new IndexCategory(db, queueManager, -1, null, name, modifiables); + root = new IndexCategory(db, queueManager, -1, null, rootName, modifiables); root.loadChildren(); root.addObserver(this); treeModel = new DefaultTreeModel(root); - tree = new JDragTree(treeModel); - tree.addMouseListener(this); + if (!selectionOnly) { + tree = new JDragTree(treeModel); + tree.addMouseListener(this); + } else { + tree = new JTree(treeModel); + tree.addMouseListener(this); + } + IndexTreeRenderer treeRenderer = new IndexTreeRenderer(); treeRenderer.setLeafIcon(IconBox.minIndex); @@ -177,16 +188,21 @@ } - public void mouseClicked(MouseEvent e) { } + public void mouseClicked(MouseEvent e) { + notifySelection(e); + } + public void mouseEntered(MouseEvent e) { } public void mouseExited(MouseEvent e) { } public void mousePressed(MouseEvent e) { - showPopupMenu(e); + if (!selectionOnly) + showPopupMenu(e); } public void mouseReleased(MouseEvent e) { - showPopupMenu(e); + if (!selectionOnly) + showPopupMenu(e); } protected void showPopupMenu(MouseEvent e) { @@ -209,6 +225,18 @@ } } + public void notifySelection(MouseEvent e) { + TreePath path = tree.getPathForLocation(e.getX(), e.getY()); + + if(path == null) + return; + + selectedNode = (IndexTreeNode)((DefaultMutableTreeNode)path.getLastPathComponent()).getUserObject(); + + setChanged(); + notifyObservers(selectedNode); + } + public void actionPerformed(ActionEvent e) { if(selectedNode == null) return; Modified: trunk/apps/Thaw/src/thaw/plugins/index/Link.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/Link.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/Link.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -5,13 +5,25 @@ import thaw.fcp.*; import thaw.plugins.Hsqldb; -public class Link { +public class Link extends java.util.Observable { + String indexName = null; + String key = null; + public Link() { } - + public Link(String indexName, String key) { + this.indexName = indexName; + this.key = key; + } + public String getIndexName() { + return indexName; + } + public String getKey() { + return key; + } } Added: trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/LinkTable.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -0,0 +1,228 @@ +package thaw.plugins.index; + +import javax.swing.JPanel; +import javax.swing.JTable; +import javax.swing.JScrollPane; + +import java.awt.BorderLayout; +import java.awt.GridLayout; + +import javax.swing.event.TableModelListener; +import javax.swing.event.TableModelEvent; + +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.awt.event.MouseListener; +import java.awt.event.MouseEvent; +import java.awt.event.KeyListener; +import java.awt.event.KeyEvent; + +import javax.swing.table.DefaultTableCellRenderer; +import java.awt.Component; + +import javax.swing.JPopupMenu; +import javax.swing.JMenuItem; +import javax.swing.JMenu; +import javax.swing.JFileChooser; +import javax.swing.JProgressBar; +import javax.swing.JLabel; + +import java.awt.Toolkit; +import java.awt.datatransfer.Clipboard; +import java.awt.datatransfer.ClipboardOwner; +import java.awt.datatransfer.StringSelection; + +import java.util.Vector; +import java.util.Iterator; + +import java.util.Observable; +import java.util.Observer; + +import thaw.core.*; +import thaw.fcp.*; + +public class LinkTable implements MouseListener, KeyListener, ActionListener { + + private JPanel panel; + private JTable table; + + private LinkListModel linkListModel; + private LinkList linkList; + + private FCPQueueManager queueManager; + private boolean modifiables; + + private int[] selectedRows; + + public LinkTable (boolean modifiables, FCPQueueManager queueManager) { + this.modifiables = modifiables; + this.queueManager = queueManager; + + linkListModel = new LinkListModel(); + table = new JTable(linkListModel); + table.setShowGrid(true); + + panel = new JPanel(); + panel.setLayout(new BorderLayout()); + + panel.add(new JLabel(I18n.getMessage("thaw.plugin.index.linkList")), BorderLayout.NORTH); + panel.add(new JScrollPane(table)); + + } + + public JPanel getPanel() { + return panel; + } + + public void setLinkList(LinkList linkList) { + if(this.linkList != null) { + this.linkList.unloadLinks(); + } + + if(linkList != null) { + linkList.loadLinks(null, true); + } + + this.linkList = linkList; + + linkListModel.reloadLinkList(linkList); + } + + public void mouseClicked(MouseEvent e) { + + } + + public void mouseEntered(MouseEvent e) { } + + public void mouseExited(MouseEvent e) { } + + public void mousePressed(MouseEvent e) { } + + public void mouseReleased(MouseEvent e) { } + + public void keyPressed(KeyEvent e) { } + + public void keyReleased(KeyEvent e) { } + + public void keyTyped(KeyEvent e) { } + + public void actionPerformed(ActionEvent e) { + + } + + + + public class LinkListModel extends javax.swing.table.AbstractTableModel implements java.util.Observer { + public Vector columnNames; + + public Vector links = null; /* thaw.plugins.index.Link Vector */ + + public LinkList linkList; + + public LinkListModel() { + super(); + + columnNames = new Vector(); + + columnNames.add(I18n.getMessage("thaw.plugin.index.index")); + columnNames.add(I18n.getMessage("thaw.common.key")); + } + + public void reloadLinkList(LinkList newLinkList) { + if (linkList != null && (linkList instanceof Observable)) { + ((Observable)linkList).deleteObserver(this); + } + + if (newLinkList != null && (newLinkList instanceof Observable)) { + ((Observable)newLinkList).deleteObserver(this); + } + + linkList = newLinkList; + + + if(links != null) { + for(Iterator it = links.iterator(); + it.hasNext(); ) { + thaw.plugins.index.Link link = (thaw.plugins.index.Link)it.next(); + link.deleteObserver(this); + } + } + + links = null; + + if(linkList != null) { + links = linkList.getLinkList(); + } + + if(links != null) { + for(Iterator it = links.iterator(); + it.hasNext(); ) { + thaw.plugins.index.Link link = (thaw.plugins.index.Link)it.next(); + link.addObserver(this); + } + } + + } + + public int getRowCount() { + if (links == null) + return 0; + + return links.size(); + } + + + public int getColumnCount() { + return columnNames.size(); + } + + public String getColumnName(int column) { + return (String)columnNames.get(column); + } + + public Object getValueAt(int row, int column) { + thaw.plugins.index.Link link = (thaw.plugins.index.Link)links.get(row); + + switch(column) { + case(0): return link.getIndexName(); + case(1): return link.getKey(); + default: return null; + } + } + + public void refresh() { + if(linkList != null) { + links = linkList.getLinkList(); + } + + TableModelEvent event = new TableModelEvent(this); + refresh(event); + } + + public void refresh(int row) { + TableModelEvent event = new TableModelEvent(this, row); + refresh(event); + } + + public void refresh(TableModelEvent e) { + + fireTableChanged(e); + } + + public void update(java.util.Observable o, Object param) { + if(param instanceof thaw.plugins.index.Link) { + + /* TODO : It can be a remove ... to check ... */ + + thaw.plugins.index.Link link = (thaw.plugins.index.Link)param; + + link.deleteObserver(this); + link.addObserver(this); + } + + refresh(); /* TODO : Do it more nicely ... :) */ + } + } + +} + Modified: trunk/apps/Thaw/src/thaw/plugins/index/SearchResult.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/SearchResult.java 2006-09-29 13:22:42 UTC (rev 10563) +++ trunk/apps/Thaw/src/thaw/plugins/index/SearchResult.java 2006-09-29 13:33:39 UTC (rev 10564) @@ -4,13 +4,14 @@ public class SearchResult implements FileList { + private Vector fileList = null; public SearchResult() { } - public void loadLists(String fileColumnToSort, boolean asc) { + public void loadFiles(String columnToSort, boolean asc) { fileList = new Vector(); } @@ -22,11 +23,7 @@ return null; } - public Vector getLinkList() { - return null; - } - - public void unloadLists() { + public void unloadFiles() { fileList = null; } From jflesch at freenetproject.org Fri Sep 29 13:38:00 2006 From: jflesch at freenetproject.org (jflesch at freenetproject.org) Date: Fri, 29 Sep 2006 13:38:00 +0000 (UTC) Subject: [Thaw-dev] r10565 - trunk/apps/Thaw/src/thaw/plugins/index Message-ID: <20060929133800.893DD9CCFC@emu.freenetproject.org> Author: jflesch Date: 2006-09-29 13:37:58 +0000 (Fri, 29 Sep 2006) New Revision: 10565 Added: trunk/apps/Thaw/src/thaw/plugins/index/IndexSelecter.java trunk/apps/Thaw/src/thaw/plugins/index/LinkList.java trunk/apps/Thaw/src/thaw/plugins/index/SearchBar.java trunk/apps/Thaw/src/thaw/plugins/index/Tables.java Log: Add missing files Added: trunk/apps/Thaw/src/thaw/plugins/index/IndexSelecter.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/IndexSelecter.java 2006-09-29 13:33:39 UTC (rev 10564) +++ trunk/apps/Thaw/src/thaw/plugins/index/IndexSelecter.java 2006-09-29 13:37:58 UTC (rev 10565) @@ -0,0 +1,167 @@ +package thaw.plugins.index; + + +import javax.swing.JFrame; +import javax.swing.JPanel; +import java.awt.BorderLayout; +import java.awt.GridLayout; +import javax.swing.JLabel; +import javax.swing.JTextField; +import javax.swing.JButton; + +import thaw.plugins.Hsqldb; +import thaw.core.I18n; +import thaw.core.Logger; + +/** + * Class helping to display a dialog allowing the user to choose an index. (For example, it's used when you want + * to make a link to another index. + * + *
+ * Window
+ * *-------------------*------------------*
+ * | Local indexes     | Other indexes    |
+ * |  |                |  |               |
+ * |  |-- Cat1         |  |-- Cat1        |
+ * |  |    |-- Index1  |  |    |-- Index1 |
+ * |  |    |-- Index2  |  |    |-- Index2 | 
+ * |  ...              |  ...             |
+ * |                   |                  |
+ * *-------------------*------------------*
+ * | Specific index key                   |
+ * *-------------------*------------------*
+ * | Cancel button     |  Ok button       |
+ * *-------------------*------------------*
+ * 
+ */ +public class IndexSelecter implements java.awt.event.ActionListener, java.util.Observer { + private JFrame frame; + + private JPanel upPanel; + + private JPanel indexPanel; + private IndexTree localIndexes; + private IndexTree otherIndexes; + + private JPanel fieldPanel; + private JTextField keyField; + + private JPanel downPanel; + private JButton cancelButton; + private JButton okButton; + + private boolean closeWin; + private String selectedIndexKey = null; + + public IndexSelecter() { + + } + + /** + * Returned null if canceled. Is blocking ! + */ + public String askForAnIndexURI(Hsqldb db) { + frame = new JFrame(I18n.getMessage("thaw.plugin.index.selectIndex")); + + frame.setVisible(false); + + upPanel = new JPanel(); + Logger.info(this, "indexes"); + localIndexes = new IndexTree(I18n.getMessage("thaw.plugin.index.yourIndexes"), true, true, null, db); + otherIndexes = new IndexTree(I18n.getMessage("thaw.plugin.index.indexes"), false, true, null, db); + Logger.info(this, "plus indexes"); + + fieldPanel = new JPanel(); + keyField = new JTextField(""); + + downPanel = new JPanel(); + cancelButton = new JButton(I18n.getMessage("thaw.common.cancel")); + okButton = new JButton(I18n.getMessage("thaw.common.ok")); + + upPanel.setLayout(new BorderLayout()); + downPanel.setLayout(new GridLayout(1, 2)); + fieldPanel.setLayout(new BorderLayout()); + + indexPanel = new JPanel(); + indexPanel.setLayout(new GridLayout(1, 2)); + indexPanel.add(localIndexes.getPanel()); + indexPanel.add(otherIndexes.getPanel()); + + upPanel.add(indexPanel, BorderLayout.CENTER); + + fieldPanel.add(new JLabel(I18n.getMessage("thaw.plugin.index.indexKey")), BorderLayout.WEST); + fieldPanel.add(keyField, BorderLayout.CENTER); + upPanel.add(fieldPanel, BorderLayout.SOUTH); + + downPanel.add(okButton); + downPanel.add(cancelButton); + + frame.getContentPane().setLayout(new BorderLayout(10, 10)); + frame.getContentPane().add(upPanel, BorderLayout.CENTER); + frame.getContentPane().add(downPanel, BorderLayout.SOUTH); + + frame.setSize(400, 500); + + cancelButton.addActionListener(this); + okButton.addActionListener(this); + localIndexes.addObserver(this); + otherIndexes.addObserver(this); + + frame.setVisible(true); + + for (closeWin = false ; !closeWin ; ) { + try { + Thread.sleep(500); + } catch(java.lang.InterruptedException e) { + /* \_o< \_o< \_o< */ + } + } + + frame.setVisible(false); + + frame = null; + + upPanel = null; + localIndexes = null; + otherIndexes = null; + + fieldPanel = null; + keyField = null; + + downPanel = null; + cancelButton = null; + okButton = null; + + return selectedIndexKey; + } + + + public void update(java.util.Observable o, Object param) { + if (param instanceof Index) { + Index index = (Index)param; + selectedIndexKey = index.getKey(); + + Logger.info(this, "Selected index key: "+selectedIndexKey); + keyField.setText(selectedIndexKey); + } + } + + public void actionPerformed(java.awt.event.ActionEvent e) { + if (e.getSource() == okButton) { + if (keyField.getText() == null || keyField.getText().equals("")) + selectedIndexKey = null; + else + selectedIndexKey = keyField.getText(); + closeWin = true; + } + + if (e.getSource() == cancelButton) { + selectedIndexKey = null; + closeWin = true; + } + + localIndexes.deleteObserver(this); + otherIndexes.deleteObserver(this); + } + +} Added: trunk/apps/Thaw/src/thaw/plugins/index/LinkList.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/LinkList.java 2006-09-29 13:33:39 UTC (rev 10564) +++ trunk/apps/Thaw/src/thaw/plugins/index/LinkList.java 2006-09-29 13:37:58 UTC (rev 10565) @@ -0,0 +1,17 @@ +package thaw.plugins.index; + +import java.util.Vector; + +public interface LinkList { + + public void loadLinks(String columnToSort, boolean asc); + + public Vector getLinkList(); + + public Link getLink(int index); + + /** + * Can update the database. + */ + public void unloadLinks(); +} Added: trunk/apps/Thaw/src/thaw/plugins/index/SearchBar.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/SearchBar.java 2006-09-29 13:33:39 UTC (rev 10564) +++ trunk/apps/Thaw/src/thaw/plugins/index/SearchBar.java 2006-09-29 13:37:58 UTC (rev 10565) @@ -0,0 +1,34 @@ +package thaw.plugins.index; + +import javax.swing.JTextField; +import javax.swing.JButton; +import javax.swing.JPanel; +import javax.swing.JLabel; + +import java.awt.BorderLayout; + +import thaw.core.I18n; + +public class SearchBar { + private JPanel panel; + + private JTextField userText; + private JButton validationButton; + + public SearchBar(FileTable fileTable, LinkTable linkTable) { + panel = new JPanel(); + panel.setLayout(new BorderLayout(10, 10)); + + userText = new JTextField(""); + validationButton = new JButton(" "+I18n.getMessage("thaw.common.search")+" "); + + panel.add(new JLabel(I18n.getMessage("thaw.plugin.index.search.label")), BorderLayout.WEST); + panel.add(userText, BorderLayout.CENTER); + panel.add(validationButton, BorderLayout.EAST); + } + + public JPanel getPanel() { + return panel; + } + +} Added: trunk/apps/Thaw/src/thaw/plugins/index/Tables.java =================================================================== --- trunk/apps/Thaw/src/thaw/plugins/index/Tables.java 2006-09-29 13:33:39 UTC (rev 10564) +++ trunk/apps/Thaw/src/thaw/plugins/index/Tables.java 2006-09-29 13:37:58 UTC (rev 10565) @@ -0,0 +1,49 @@ +package thaw.plugins.index; + +import javax.swing.JPanel; +import javax.swing.JSplitPane; +import java.awt.BorderLayout; + +import thaw.fcp.FCPQueueManager; + +/** + * Contains a FileTable, a LinkTable, and a SearchBar + */ +public class Tables { + private JPanel panel; + + private SearchBar searchBar; + private FileTable fileTable; + private LinkTable linkTable; + + public Tables(boolean modifiables, FCPQueueManager queueManager) { + panel = new JPanel(); + panel.setLayout(new BorderLayout(10, 10)); + + fileTable = new FileTable(modifiables, queueManager); + linkTable = new LinkTable(modifiables, queueManager); + + searchBar = new SearchBar(fileTable, linkTable); + + panel.add(searchBar.getPanel(), BorderLayout.NORTH); + panel.add(new JSplitPane(JSplitPane.VERTICAL_SPLIT, + linkTable.getPanel(), + fileTable.getPanel())); + } + + + public FileTable getFileTable() { + return fileTable; + } + + public LinkTable getLinkTable() { + return linkTable; + } + + public JPanel getPanel() { + return panel; + } + + + +} From jflesch at freenetproject.org Fri Sep 29 15:47:18 2006 From: jflesch at freenetproject.org (jflesch at freenetproject.org) Date: Fri, 29 Sep 2006 15:47:18 +0000 (UTC) Subject: [Thaw-dev] r10567 - in trunk/apps/Thaw/src/thaw: core fcp i18n Message-ID: <20060929154718.7D2BF9CA67@emu.freenetproject.org> Author: jflesch Date: 2006-09-29 15:47:15 +0000 (Fri, 29 Sep 2006) New Revision: 10567 Modified: trunk/apps/Thaw/src/thaw/core/Logger.java trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java trunk/apps/Thaw/src/thaw/fcp/FCPQueueLoader.java trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties Log: Thaw uses now the argument TargetFilename of PersistentPut Modified: trunk/apps/Thaw/src/thaw/core/Logger.java =================================================================== --- trunk/apps/Thaw/src/thaw/core/Logger.java 2006-09-29 13:48:54 UTC (rev 10566) +++ trunk/apps/Thaw/src/thaw/core/Logger.java 2006-09-29 15:47:15 UTC (rev 10567) @@ -94,10 +94,10 @@ * As it. Similar to verbose() */ public static void asIt(Object o, String msg) { - //if(LOG_LEVEL >= 5) { + if(LOG_LEVEL >= 5) { System.out.println(msg); notifyLogListeners(msg); - //} + } } Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java =================================================================== --- trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-29 13:48:54 UTC (rev 10566) +++ trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-29 15:47:15 UTC (rev 10567) @@ -123,7 +123,7 @@ */ public FCPClientPut(String identifier, String publicKey, int priority, int persistence, boolean global, - String filePath, String status, int progress, + String filePath, String fileName, String status, int progress, long fileSize, FCPQueueManager queueManager) { @@ -175,7 +175,7 @@ } - if(this.name.equals("null")) { + if(this.name.equals("null") || this.name.equals("CHK@")) { Logger.warning(this, "The node returns \"null\" as filename. Using id !"); Logger.warning(this, "( URI="+publicKey +" )"); Logger.warning(this, "( Identifier="+identifier+" )"); @@ -194,10 +194,12 @@ } - - } + + if (fileName != null) { /* We want to force the filename */ /* See PersistentPut.TargetFilename */ + this.name = fileName; + } this.publicKey = null; Modified: trunk/apps/Thaw/src/thaw/fcp/FCPQueueLoader.java =================================================================== --- trunk/apps/Thaw/src/thaw/fcp/FCPQueueLoader.java 2006-09-29 13:48:54 UTC (rev 10566) +++ trunk/apps/Thaw/src/thaw/fcp/FCPQueueLoader.java 2006-09-29 15:47:15 UTC (rev 10567) @@ -114,7 +114,7 @@ FCPClientPut clientPut = new FCPClientPut(msg.getValue("Identifier"), msg.getValue("URI"), // key priority, persistence, global, - filePath, + filePath, msg.getValue("TargetFilename"), "Inserting", 0, fileSize, queueManager); Modified: trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties =================================================================== --- trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2006-09-29 13:48:54 UTC (rev 10566) +++ trunk/apps/Thaw/src/thaw/i18n/thaw_fr.properties 2006-09-29 15:47:15 UTC (rev 10567) @@ -190,8 +190,8 @@ thaw.plugin.index.editor=Vos fichiers partag?s thaw.plugin.index.browser=Navigateur d'index -thaw.plugin.index.yourIndexes=Vos indexs -thaw.plugin.index.indexes=Indexs +thaw.plugin.index.yourIndexes=Vos indexes +thaw.plugin.index.indexes=Indexes thaw.plugin.index.addIndex=Add a file index thaw.plugin.index.createIndex=Cr?er a file index From jflesch at freenetproject.org Fri Sep 29 16:15:31 2006 From: jflesch at freenetproject.org (jflesch at freenetproject.org) Date: Fri, 29 Sep 2006 16:15:31 +0000 (UTC) Subject: [Thaw-dev] r10569 - trunk/apps/Thaw/src/thaw/fcp Message-ID: <20060929161531.438F19BD7B@emu.freenetproject.org> Author: jflesch Date: 2006-09-29 16:15:28 +0000 (Fri, 29 Sep 2006) New Revision: 10569 Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java Log: Takes the message PutFetchable into consideration Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java =================================================================== --- trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-29 15:51:59 UTC (rev 10568) +++ trunk/apps/Thaw/src/thaw/fcp/FCPClientPut.java 2006-09-29 16:15:28 UTC (rev 10569) @@ -535,7 +535,8 @@ || !msg.getValue("Identifier").equals(identifier)) return; - if(msg.getMessageName().equals("URIGenerated")) { + if(msg.getMessageName().equals("URIGenerated") + || msg.getMessageName().equals("PutFetchable")) { running = true; finished = false; successful = false; @@ -544,7 +545,7 @@ publicKey = publicKey.replaceAll("freenet:", ""); - Logger.info(this, "URIGenerated: "+publicKey); + Logger.info(this, msg.getMessageName()+": "+publicKey); if(getCHKOnly) { status = "CHK";