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

@ -71,7 +71,7 @@ public class yacyTray implements ActionListener, ItemListener {
final String iconpath = sb.getRootPath().toString() + "/addon/YaCy_TrayIcon.gif".replace("/", File.separator);
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
if (showmenu) {
// this is the popup menu

Loading…
Cancel
Save