Author: jflesch
Date: 2007-09-06 01:17:49 +0000 (Thu, 06 Sep 2007)
New Revision: 14983

Modified:
   trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKFileAttachment.java
   trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java
Log:
Try to fix the use of the tray icon by the plugin queueWatcher

Modified: 
trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKFileAttachment.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKFileAttachment.java  
2007-09-06 00:59:22 UTC (rev 14982)
+++ trunk/apps/Thaw/src/thaw/plugins/miniFrost/frostKSK/KSKFileAttachment.java  
2007-09-06 01:17:49 UTC (rev 14983)
@@ -190,8 +190,11 @@

        public void apply(Hsqldb db, FCPQueueManager queueManager, String 
action) {
                if 
(action.equals(I18n.getMessage("thaw.common.copyKeyToClipboard"))) {
+
                        thaw.gui.GUIHelper.copyToClipboard(key);
+
                } else if 
(action.equals(I18n.getMessage("thaw.plugin.miniFrost.copyAllKeys"))) {
+
                        String keys = "";

                        Vector a = msg.getAttachments();
@@ -207,12 +210,15 @@
                        thaw.gui.GUIHelper.copyToClipboard(keys);

                } else if 
(action.equals(I18n.getMessage("thaw.common.action.download"))) {
+
                        keysToDownload = new Vector();
                        keysToDownload.add(key);

                        Thread th = new Thread(this);
                        th.start();
+
                } else if 
(action.equals(I18n.getMessage("thaw.plugin.miniFrost.downloadAll"))) {
+
                        keysToDownload = new Vector();

                        Vector a = msg.getAttachments();
@@ -227,6 +233,7 @@

                        Thread th = new Thread(this);
                        th.start();
+
                }
        }

@@ -235,7 +242,10 @@
                /* yeah, I didn't realize that I may need the config here :/ */
                Config config = 
((KSKBoard)msg.getBoard()).getFactory().getCore().getConfig();

-               FileChooser ch = new 
FileChooser(config.getValue("lastDestinationDirectory"));
+               String lastPath = config.getValue("lastDestinationDirectory");
+
+               FileChooser ch = ((lastPath != null) ? new 
FileChooser(lastPath) : new FileChooser());
+
                
ch.setTitle(I18n.getMessage("thaw.plugin.fetch.chooseDestination"));
                ch.setDirectoryOnly(true);
                ch.setDialogType(javax.swing.JFileChooser.SAVE_DIALOG);

Modified: trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java  
2007-09-06 00:59:22 UTC (rev 14982)
+++ trunk/apps/Thaw/src/thaw/plugins/queueWatcher/QueueTableModel.java  
2007-09-06 01:17:49 UTC (rev 14983)
@@ -298,6 +298,34 @@
        }

        public void update(final Observable o, final Object arg) {
+               if (o == queueManager && arg == null) {
+                       /* unclear change */
+                       reloadQueue();
+                       return;
+               }
+
+
+               if (o == queueManager) {
+                       final FCPTransferQuery query = (FCPTransferQuery)arg;
+
+                       if((query.getQueryType() == 1) && isForInsertions)
+                               return;
+
+                       if((query.getQueryType() == 2) && !isForInsertions)
+                               return;
+
+                       if(queueManager.isInTheQueues(query)) { // then it's an 
adding
+                               addQuery(query);
+                               return;
+                       }
+
+                       if(queries.contains(query)) { // then it's a removing
+                               removeQuery(query);
+                               return;
+                       }
+               }
+
+
                if (o instanceof FCPTransferQuery
                    && queries.indexOf(o) >= 0
                    && ((FCPTransferQuery)o).isFinished()) {
@@ -340,31 +368,7 @@
                        return;
                }

-               if (o == queueManager && arg == null) {
-                       reloadQueue();
-                       return;
-               }

-               if (o == queueManager) {
-                       final FCPTransferQuery query = (FCPTransferQuery)arg;
-
-                       if((query.getQueryType() == 1) && isForInsertions)
-                               return;
-
-                       if((query.getQueryType() == 2) && !isForInsertions)
-                               return;
-
-                       if(queueManager.isInTheQueues(query)) { // then it's an 
adding
-                               addQuery(query);
-                               return;
-                       }
-
-                       if(queries.contains(query)) { // then it's a removing
-                               removeQuery(query);
-                               return;
-                       }
-               }
-
                Logger.debug(this, "update(): unknow change");
                reloadQueue();
        }


Reply via email to