propagate from branch 'i2p.i2p' (head dbe319d674d6a6a53491762262978f53caaaa58a)

to branch 'i2p.i2p.mathiasdm.desktopgui' (head fced1e04334ef1c18bc6ae8a31984e627310b14c)
This commit is contained in:
mathiasdm
2011-01-26 06:48:45 +00:00
78 changed files with 1040 additions and 6706 deletions

View File

@@ -24,6 +24,7 @@
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
<pathelement location="../../systray/java/build/obj" />
<pathelement location="../../systray/java/lib/systray4j.jar" />
<pathelement location="../../desktopgui/build" />
<pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" /> <!-- we dont care if we're not on win32 -->
<pathelement location="../../jrobin/jrobin-1.4.0.jar" />
</classpath>
@@ -54,6 +55,7 @@
<pathelement location="../../jetty/jettylib/javax.servlet.jar" />
<pathelement location="../../systray/java/build/systray.jar" />
<pathelement location="../../systray/java/lib/systray4j.jar" />
<pathelement location="../../desktopgui/dist/desktopgui.jar" />
<pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" /> <!-- we dont care if we're not on win32 -->
<pathelement location="../../jrobin/jrobin-1.4.0.jar" />
</classpath>
@@ -161,6 +163,7 @@
<pathelement location="../../jetty/jettylib/ant.jar" />
<pathelement location="../../systray/java/build/obj" />
<pathelement location="../../systray/java/lib/systray4j.jar" />
<pathelement location="../../desktopgui/dist/desktopgui.jar" />
<pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" />
<pathelement location="build/routerconsole.jar" />
<pathelement location="build/" />
@@ -191,6 +194,7 @@
<pathelement location="../../jetty/jettylib/org.mortbay.jetty.jar" />
<pathelement location="../../systray/java/build/obj" />
<pathelement location="../../systray/java/lib/systray4j.jar" />
<pathelement location="../../desktopgui/dist/desktopgui.jar" />
<pathelement location="../../../installer/lib/wrapper/win32/wrapper.jar" />
<pathelement location="build/routerconsole.jar" />
<pathelement location="build" />
@@ -220,7 +224,7 @@
<mkdir dir="./build" />
<mkdir dir="./build/javadoc" />
<javadoc
sourcepath="./src:../../../core/java/src:../../../router/java/src:../../systray/java/src" destdir="./build/javadoc"
sourcepath="./src:../../../core/java/src:../../../router/java/src:../../systray/java/src:../../desktopgui/src" destdir="./build/javadoc"
packagenames="*"
use="true"
splitindex="true"

View File

@@ -88,30 +88,6 @@ public class ConfigServiceHandler extends FormHandler {
addFormError("Warning: unable to contact the service manager - " + t.getMessage());
}
addFormNotice("Threads dumped to wrapper.log");
} else if (_("Show systray icon").equals(_action)) {
try {
SysTray tray = SysTray.getInstance();
if (tray != null) {
tray.show();
addFormNotice(_("System tray icon enabled."));
} else {
addFormNotice(_("System tray icon feature not supported on this platform. Sorry!"));
}
} catch (Throwable t) {
addFormError(_("Warning: unable to contact the systray manager") + " - " + t.getMessage());
}
} else if (_("Hide systray icon").equals(_action)) {
try {
SysTray tray = SysTray.getInstance();
if (tray != null) {
tray.hide();
addFormNotice(_("System tray icon disabled."));
} else {
addFormNotice(_("System tray icon feature not supported on this platform. Sorry!"));
}
} catch (Throwable t) {
addFormError(_("Warning: unable to contact the systray manager") + " - " + t.getMessage());
}
} else if (_("View console on startup").equals(_action)) {
browseOnStartup(true);
addFormNotice(_("Console is to be shown on startup"));

View File

@@ -18,7 +18,21 @@ public class ContentHelper extends HelperBase {
public void setStartAtBeginning(String moo) {
_startAtBeginning = Boolean.valueOf(""+moo).booleanValue();
}
public void setLang(String l) { _lang = l; }
public void setLang(String l) {
if((_lang == null || !_lang.equals(l)) && (l != null)) {
//Set language for router console
_lang = l;
if(_context == null) {
setContextId(null);
}
//Set language persistently throughout I2P
_context.router().setConfigSetting(Messages.PROP_LANG, _lang);
_context.router().saveConfig();
_context.setProperty(Messages.PROP_LANG, _lang);
}
}
public void setMaxLines(String lines) {
if (lines != null) {

View File

@@ -10,7 +10,7 @@ import java.util.Properties;
import java.util.StringTokenizer;
import net.i2p.I2PAppContext;
import net.i2p.apps.systray.SysTray;
import net.i2p.desktopgui.Main;
import net.i2p.data.Base32;
import net.i2p.data.DataHelper;
import net.i2p.router.RouterContext;
@@ -19,6 +19,7 @@ import net.i2p.util.I2PAppThread;
import net.i2p.util.SecureDirectory;
import net.i2p.util.SecureFileOutputStream;
import net.i2p.util.ShellCommand;
import net.i2p.util.VersionComparator;
import org.mortbay.http.DigestAuthenticator;
import org.mortbay.http.HashUserRealm;
@@ -301,7 +302,13 @@ public class RouterConsoleRunner {
}
try {
SysTray tray = SysTray.getInstance();
//TODO: move away from routerconsole into a separate application.
//ApplicationManager?
VersionComparator v = new VersionComparator();
if(v.compare(System.getProperty("java.runtime.version"), "1.6") >= 0) {
String[] args = new String[0];
net.i2p.desktopgui.Main.beginStartup(args);
}
} catch (Throwable t) {
t.printStackTrace();
}