DTG: On OSX, set dock icon, and enable by default

This commit is contained in:
zzz
2017-11-19 00:40:50 +00:00
parent 0ba207cb01
commit 85bb495754
3 changed files with 54 additions and 8 deletions

View File

@ -202,10 +202,7 @@ public class ConfigServiceHandler extends FormHandler {
public boolean shouldShowSystray() {
return !
(SystemVersion.isLinuxService() ||
(SystemVersion.isWindows() && _context.hasWrapper() && WrapperManager.isLaunchedAsService()) ||
// headless=true is forced in i2prouter script to prevent useless dock icon;
// must fix this first
SystemVersion.isMac());
(SystemVersion.isWindows() && _context.hasWrapper() && WrapperManager.isLaunchedAsService()));
}
/**
@ -214,10 +211,10 @@ public class ConfigServiceHandler extends FormHandler {
* @since 0.9.26
*/
public boolean isSystrayEnabled() {
// default false for now, except on non-service windows
// default false for now, except on OSX and non-service windows
String sdtg = _context.getProperty(RouterConsoleRunner.PROP_DTG_ENABLED);
return Boolean.parseBoolean(sdtg) ||
(sdtg == null && SystemVersion.isWindows());
(sdtg == null && (SystemVersion.isWindows() || SystemVersion.isMac()));
}
@Override

View File

@ -298,10 +298,10 @@ public class RouterConsoleRunner implements RouterApp {
return;
}
try {
// default false for now, except on non-service windows
// default false for now, except on OSX and non-service windows
String sdtg = _context.getProperty(PROP_DTG_ENABLED);
boolean desktopguiEnabled = Boolean.parseBoolean(sdtg) ||
(sdtg == null && SystemVersion.isWindows());
(sdtg == null && (SystemVersion.isWindows() || SystemVersion.isMac()));
if (desktopguiEnabled) {
System.setProperty("java.awt.headless", "false");
net.i2p.desktopgui.Main dtg = new net.i2p.desktopgui.Main(_context, _mgr, null);