some improvements for yacyTray

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

@ -1658,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(serverSystem.isWindows && !GraphicsEnvironment.isHeadless()) yacytray.removeTray(); if(yacyTray.isShown) yacytray.removeTray();
log.logConfig("SWITCHBOARD SHUTDOWN TERMINATED"); log.logConfig("SWITCHBOARD SHUTDOWN TERMINATED");
} }

@ -48,7 +48,10 @@ public class yacyTray implements ActionListener, ItemListener {
private boolean testing = false; private boolean testing = false;
plasmaSwitchboard sb; plasmaSwitchboard sb;
public static boolean isShown = false;
public static boolean lockBrowserPopup = true;
private long t1; private long t1;
final private static SystemTray tray = SystemTray.getDefaultSystemTray(); final private static SystemTray tray = SystemTray.getDefaultSystemTray();
@ -111,11 +114,16 @@ public class yacyTray implements ActionListener, ItemListener {
} }
}); });
tray.addTrayIcon(ti); tray.addTrayIcon(ti);
isShown = true;
} }
private void trayClickAction(){ //detect doubleclick private void trayClickAction(){ //detect doubleclick
if(System.currentTimeMillis() - t1 < 500){ if(System.currentTimeMillis() - t1 < 500){
openBrowser(""); if (lockBrowserPopup) {
displayBalloonMessage("YaCy","Please wait until YaCy is started.");
} else {
openBrowser("");
}
t1 = 0; //protecting against tripleclick t1 = 0; //protecting against tripleclick
} else { t1 = System.currentTimeMillis(); } } else { t1 = System.currentTimeMillis(); }
} }
@ -127,6 +135,7 @@ public class yacyTray implements ActionListener, ItemListener {
public void removeTray(){ public void removeTray(){
tray.removeTrayIcon(ti); tray.removeTrayIcon(ti);
isShown = false;
} }
public void displayBalloonMessage(String title, String message){ public void displayBalloonMessage(String title, String message){

@ -96,6 +96,7 @@ import de.anomic.tools.enumerateFiles;
import de.anomic.tools.yFormatter; import de.anomic.tools.yFormatter;
import de.anomic.yacy.yacyClient; import de.anomic.yacy.yacyClient;
import de.anomic.yacy.yacySeedDB; import de.anomic.yacy.yacySeedDB;
import de.anomic.yacy.yacyTray;
import de.anomic.yacy.yacyURL; import de.anomic.yacy.yacyURL;
import de.anomic.yacy.yacyVersion; import de.anomic.yacy.yacyVersion;
@ -361,6 +362,9 @@ public final class yacy {
final String browserPopUpApplication = sb.getConfig("browserPopUpApplication", "netscape"); final String browserPopUpApplication = sb.getConfig("browserPopUpApplication", "netscape");
serverSystem.openBrowser((server.withSSL()?"https":"http") + "://localhost:" + serverCore.getPortNr(port) + "/" + browserPopUpPage, browserPopUpApplication); serverSystem.openBrowser((server.withSSL()?"https":"http") + "://localhost:" + serverCore.getPortNr(port) + "/" + browserPopUpPage, browserPopUpApplication);
} }
// unlock yacyTray browser popup
yacyTray.lockBrowserPopup = false;
// Copy the shipped locales into DATA, existing files are overwritten // Copy the shipped locales into DATA, existing files are overwritten
final File locale_work = sb.getConfigPath("locale.work", "DATA/LOCALE/locales"); final File locale_work = sb.getConfigPath("locale.work", "DATA/LOCALE/locales");

Loading…
Cancel
Save