tray is now only shown on Windows and doesn't block on linux

git-svn-id: https://svn.berlios.de/svnroot/repos/yacy/trunk@4997 6c8d7289-2bf4-0310-a012-ef5d649a1542
pull/1/head
lotus 17 years ago
parent d77ed28e2f
commit fa695c2d9f

@ -86,6 +86,7 @@
package de.anomic.plasma; package de.anomic.plasma;
import java.awt.GraphicsEnvironment;
import java.io.File; import java.io.File;
import java.io.FileInputStream; import java.io.FileInputStream;
import java.io.IOException; import java.io.IOException;
@ -117,11 +118,11 @@ import de.anomic.crawler.HTTPLoader;
import de.anomic.crawler.ImporterManager; import de.anomic.crawler.ImporterManager;
import de.anomic.crawler.IndexingStack; import de.anomic.crawler.IndexingStack;
import de.anomic.crawler.NoticedURL; import de.anomic.crawler.NoticedURL;
import de.anomic.crawler.ResourceObserver;
import de.anomic.crawler.ResultImages; import de.anomic.crawler.ResultImages;
import de.anomic.crawler.ResultURLs; import de.anomic.crawler.ResultURLs;
import de.anomic.crawler.RobotsTxt; import de.anomic.crawler.RobotsTxt;
import de.anomic.crawler.ZURL; import de.anomic.crawler.ZURL;
import de.anomic.crawler.ResourceObserver;
import de.anomic.data.URLLicense; import de.anomic.data.URLLicense;
import de.anomic.data.blogBoard; import de.anomic.data.blogBoard;
import de.anomic.data.blogBoardComments; import de.anomic.data.blogBoardComments;
@ -161,6 +162,7 @@ import de.anomic.server.serverProcessorJob;
import de.anomic.server.serverProfiling; import de.anomic.server.serverProfiling;
import de.anomic.server.serverSemaphore; import de.anomic.server.serverSemaphore;
import de.anomic.server.serverSwitch; import de.anomic.server.serverSwitch;
import de.anomic.server.serverSystem;
import de.anomic.server.serverThread; import de.anomic.server.serverThread;
import de.anomic.server.logging.serverLog; import de.anomic.server.logging.serverLog;
import de.anomic.tools.crypt; import de.anomic.tools.crypt;
@ -834,20 +836,17 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
setLog(new serverLog("PLASMA")); setLog(new serverLog("PLASMA"));
if (applyPro) this.log.logInfo("This is the pro-version of YaCy"); if (applyPro) this.log.logInfo("This is the pro-version of YaCy");
// make system tray TODO: enable // make system tray
// try { // TODO: make tray on linux
// final boolean trayIcon = getConfig("trayIcon", "false").equals("true"); try {
// if (trayIcon) { final boolean trayIcon = getConfig("trayIcon", "false").equals("true");
// System.setProperty("java.awt.headless", "false"); if (trayIcon && serverSystem.isWindows) {
// yacytray = new yacyTray(this, false); System.setProperty("java.awt.headless", "false");
// } yacytray = new yacyTray(this, false);
// } catch (Exception e) { }
// try{ } catch (Exception e) {
// yacytray.removeTray(); System.setProperty("java.awt.headless", "true");
// } finally { }
// System.setProperty("java.awt.headless", "true");
// }
// }
// remote proxy configuration // remote proxy configuration
httpdProxyHandler.setRemoteProxyConfig(httpRemoteProxyConfig.init(this)); // TODO refactoring httpdProxyHandler.setRemoteProxyConfig(httpRemoteProxyConfig.init(this)); // TODO refactoring
@ -1659,7 +1658,7 @@ public final class plasmaSwitchboard extends serverAbstractSwitch<IndexingStack.
crawlQueues.close(); crawlQueues.close();
log.logConfig("SWITCHBOARD SHUTDOWN STEP 3: sending termination signal to database manager (stand by...)"); log.logConfig("SWITCHBOARD SHUTDOWN STEP 3: sending termination signal to database manager (stand by...)");
webIndex.close(); webIndex.close();
// if(System.getProperty("java.awt.headless") == "false") yacytray.removeTray(); TODO: enable if(serverSystem.isWindows && !GraphicsEnvironment.isHeadless()) yacytray.removeTray();
log.logConfig("SWITCHBOARD SHUTDOWN TERMINATED"); log.logConfig("SWITCHBOARD SHUTDOWN TERMINATED");
} }

@ -71,7 +71,7 @@ public class yacyTray implements ActionListener, ItemListener {
final String iconpath = sb.getRootPath().toString() + "/addon/YaCy_TrayIcon.gif".replace("/", File.separator); final String iconpath = sb.getRootPath().toString() + "/addon/YaCy_TrayIcon.gif".replace("/", File.separator);
final ImageIcon i = new ImageIcon(iconpath); final ImageIcon i = new ImageIcon(iconpath);
// the menu is disabled because of visibility conflicts on windows (tested on xp) // the menu is disabled because of visibility conflicts on windows with jre6
// anyway the code might be a template for future use // anyway the code might be a template for future use
if (showmenu) { if (showmenu) {
// this is the popup menu // this is the popup menu

Loading…
Cancel
Save