Author: jflesch
Date: 2006-07-13 12:47:03 +0000 (Thu, 13 Jul 2006)
New Revision: 9591

Modified:
   trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
   trunk/apps/Thaw/src/thaw/fcp/FCPQueueLoader.java
   trunk/apps/Thaw/src/thaw/fcp/FCPTransferQuery.java
   trunk/apps/Thaw/src/thaw/i18n/thaw.properties
   trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
   trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java
Log:
Fixing some little bugs and adding a column in the table displaying the 
download status

Modified: trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java      2006-07-13 11:39:14 UTC 
(rev 9590)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPClientGet.java      2006-07-13 12:47:03 UTC 
(rev 9591)
@@ -247,6 +247,12 @@
                                return;
                        }

+                       if(message.getValue("Fatal").equals("False")) {
+                               Logger.debug(this, "Non-fatal GetFailed");
+                               status = "Non-fatal GetFailed 
("+message.getValue("CodeDescription")+")";
+                               return;
+                       }
+
                        //removeRequest();

                        int code = ((new 
Integer(message.getValue("Code"))).intValue());
@@ -594,8 +600,6 @@
        public String getPath() {
                if(destinationDir != null)
                        return destinationDir + File.separator + filename;
-               
-               Logger.warning(this, "getPath() : destinationDir == null");

                return null;
        }

Modified: trunk/apps/Thaw/src/thaw/fcp/FCPQueueLoader.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPQueueLoader.java    2006-07-13 11:39:14 UTC 
(rev 9590)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPQueueLoader.java    2006-07-13 12:47:03 UTC 
(rev 9591)
@@ -62,11 +62,12 @@
                        if(msg.getValue("Identifier").startsWith(thawId))
                                destinationDir = msg.getValue("ClientToken");

+                       int priority = ((new 
Integer(msg.getValue("PriorityClass"))).intValue());


                        FCPClientGet clientGet = new 
FCPClientGet(msg.getValue("Identifier"),
                                                                  
msg.getValue("URI"), // key
-                                                                 -1, 
persistence, global,
+                                                                 priority, 
persistence, global,
                                                                  
destinationDir, "Fetching", 0,
                                                                  queueManager);


Modified: trunk/apps/Thaw/src/thaw/fcp/FCPTransferQuery.java
===================================================================
--- trunk/apps/Thaw/src/thaw/fcp/FCPTransferQuery.java  2006-07-13 11:39:14 UTC 
(rev 9590)
+++ trunk/apps/Thaw/src/thaw/fcp/FCPTransferQuery.java  2006-07-13 12:47:03 UTC 
(rev 9591)
@@ -5,6 +5,8 @@
 /**
  * Transfer query == fetch / insert query. These queries must be able to
  * give more informations than the other.
+ * Functions returning status of the request may be call frequently, so try to 
make them fast.
+ *
  */
 public interface FCPTransferQuery extends FCPQuery {


Modified: trunk/apps/Thaw/src/thaw/i18n/thaw.properties
===================================================================
--- trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2006-07-13 11:39:14 UTC 
(rev 9590)
+++ trunk/apps/Thaw/src/thaw/i18n/thaw.properties       2006-07-13 12:47:03 UTC 
(rev 9591)
@@ -49,6 +49,7 @@
 thaw.common.forceRestart=Force (re)start
 thaw.common.downloadLocally=Download locally

+thaw.common.unspecified=Unspecified

 ## Errors
 thaw.error.idAlreadyUsed=Unable to connect. Our Id is already used by another 
client connected to the node.

Modified: trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java       
2006-07-13 11:39:14 UTC (rev 9590)
+++ trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueuePanel.java       
2006-07-13 12:47:03 UTC (rev 9591)
@@ -104,10 +104,15 @@
                copyKeysItem = new 
JMenuItem(I18n.getMessage("thaw.common.copyKeysToClipboard"));

                rightClickMenu.add(removeItem);
-               rightClickMenu.add(cancelItem);
+
                if((new 
Integer(core.getConfig().getValue("maxSimultaneousDownloads"))).intValue() >= 0
                   || (new 
Integer(core.getConfig().getValue("maxSimultaneousInsertions"))).intValue() >= 
0)
+                       rightClickMenu.add(cancelItem);
+
+               if((new 
Integer(core.getConfig().getValue("maxSimultaneousDownloads"))).intValue() >= 0
+                  || (new 
Integer(core.getConfig().getValue("maxSimultaneousInsertions"))).intValue() >= 
0)
                        rightClickMenu.add(delayItem);
+
                rightClickMenu.add(downloadItem);
                rightClickMenu.add(forceRestartItem);
                rightClickMenu.add(copyKeysItem);
@@ -207,14 +212,18 @@

        public void refresh() {
                int selected = table.getSelectedRow();
-
+               /*
                if(lastRowSelected != selected) {
                        lastRowSelected = selected;

                        if(selected != -1)
                                
detailPanel.setQuery(tableModel.getQuery(selected));
                }
-               
+               */
+               lastRowSelected = selected;
+                       
+               if(selected != -1)
+                       detailPanel.setQuery(tableModel.getQuery(selected));
        }

        public JPanel getPanel() {
@@ -255,8 +264,6 @@

                                if(e.getSource() == cancelItem) {
                                        query.stop(core.getQueueManager());
-                                       /*core.getQueueManager().remove(query);
-                                        */
                                }

                                if(e.getSource() == delayItem) {
@@ -270,7 +277,11 @@
                                        if(query.isRunning() && 
!query.isFinished())
                                                
query.stop(core.getQueueManager());

-                                       query.setAttempt(0);
+                                       query.removeRequest();
+
+                                       if(query.getMaxAttempt() >= 0)
+                                               query.setAttempt(0);
+
                                        query.start(core.getQueueManager());    
                                
                                }


Modified: trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java  
2006-07-13 11:39:14 UTC (rev 9590)
+++ trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java  
2006-07-13 12:47:03 UTC (rev 9591)
@@ -20,11 +20,19 @@

         private Vector queries = null;

+       private boolean isForInsertion = false;
+
        public QueueTableModel(boolean isForInsertions) {
                super();

+               this.isForInsertion = isForInsertion;
+
                columnNames.add(I18n.getMessage("thaw.common.file"));
                columnNames.add(I18n.getMessage("thaw.common.size"));
+               
+               if(!isForInsertion)
+                       
columnNames.add(I18n.getMessage("thaw.common.localPath"));
+
                columnNames.add(I18n.getMessage("thaw.common.status"));
                columnNames.add(I18n.getMessage("thaw.common.progress"));

@@ -64,11 +72,20 @@
                        return ((new Long(query.getFileSize())).toString() + " 
B"); /* TODO : Convert to KB / MB / GB */
                }

-               if(column == 2) {
+               if(!isForInsertion && column == 2) {
+                       if(query.getPath() != null)
+                               return query.getPath();
+                       else
+                               return 
I18n.getMessage("thaw.common.unspecified");
+               }
+
+               if( (isForInsertion && column == 2)
+                   || (!isForInsertion && column == 3) ) {
                        return query.getStatus();
                }

-               if(column == 3) {
+               if( (isForInsertion && column == 3
+                    || (!isForInsertion && column == 4) ) ) {
                        return ((new 
Integer(query.getProgression())).toString() + " %");
                }



Reply via email to