Author: jflesch
Date: 2007-09-20 22:25:49 +0000 (Thu, 20 Sep 2007)
New Revision: 15218

Modified:
   trunk/apps/Thaw/src/thaw/plugins/TrayIcon.java
   trunk/apps/Thaw/src/thaw/plugins/transferLogs/Transfer.java
Log:
Make it possible to disable tray icon popups (no visible option in the GUI : 
edit thaw.conf.xml)

Modified: trunk/apps/Thaw/src/thaw/plugins/TrayIcon.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/TrayIcon.java      2007-09-20 22:22:23 UTC 
(rev 15217)
+++ trunk/apps/Thaw/src/thaw/plugins/TrayIcon.java      2007-09-20 22:25:49 UTC 
(rev 15218)
@@ -25,6 +25,7 @@
 import java.awt.BorderLayout;

 import thaw.core.Core;
+import thaw.core.Config;
 import thaw.core.Logger;
 import thaw.core.I18n;

@@ -35,6 +36,7 @@
 import thaw.gui.IconBox;
 import thaw.gui.WarningWindow;

+
 public class TrayIcon implements thaw.core.Plugin,
                                 MouseListener,
                                 WindowListener,
@@ -42,6 +44,8 @@
                                 thaw.core.LogListener {

        private Core core;
+       private Config config;
+
        private SysTrayIcon icon;

        private JDialog dialog;
@@ -58,6 +62,7 @@

        public boolean run(Core core) {
                this.core = core;
+               this.config = core.getConfig();

                if (!Core.checkJavaVersion(1, 6)) {
                        new WarningWindow(core,
@@ -65,6 +70,8 @@
                        return false;
                }

+               config.setValue("disableTrayIconPopups", "false");
+
                icon = new SysTrayIcon(thaw.gui.IconBox.blueBunny);
                icon.setToolTip("Thaw "+thaw.core.Main.VERSION);
                icon.addMouseListener(this);
@@ -132,6 +139,12 @@
                if (icon == null || !icon.canWork())
                        return false;

+               String cfg;
+
+               if ( (cfg = config.getValue("disableTrayIconPopups")) != null )
+                       if (Boolean.TRUE.equals(cfg))
+                               return false;
+
                icon.popMessage(title, message, msgType);

                return true;

Modified: trunk/apps/Thaw/src/thaw/plugins/transferLogs/Transfer.java
===================================================================
--- trunk/apps/Thaw/src/thaw/plugins/transferLogs/Transfer.java 2007-09-20 
22:22:23 UTC (rev 15217)
+++ trunk/apps/Thaw/src/thaw/plugins/transferLogs/Transfer.java 2007-09-20 
22:25:49 UTC (rev 15218)
@@ -184,7 +184,8 @@
                                        }

                                } else { /* we insert a new one */
-                                       /* except if this query has already 
ended, because it means we weren't
+                                       /* except if this query has already 
ended,
+                                        * because it means we weren't
                                         * used for this job, so we won't move 
:P */
                                        if (query.isFinished())
                                                return false;


Reply via email to