- Added version check needed before starting desktopgui.
- Added correct 'stop I2P' functionality in desktopgui.
This commit is contained in:
@ -2,6 +2,8 @@ package net.i2p.desktopgui.router;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
|
||||||
|
import org.tanukisoftware.wrapper.WrapperManager;
|
||||||
|
|
||||||
import net.i2p.I2PAppContext;
|
import net.i2p.I2PAppContext;
|
||||||
import net.i2p.desktopgui.i18n.DesktopguiTranslator;
|
import net.i2p.desktopgui.i18n.DesktopguiTranslator;
|
||||||
import net.i2p.desktopgui.util.ConfigurationManager;
|
import net.i2p.desktopgui.util.ConfigurationManager;
|
||||||
@ -74,7 +76,16 @@ public class RouterManager {
|
|||||||
*/
|
*/
|
||||||
public static void shutDown() {
|
public static void shutDown() {
|
||||||
if(inI2P()) {
|
if(inI2P()) {
|
||||||
getRouter().shutdown(0);
|
Thread t = new Thread(new Runnable() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void run() {
|
||||||
|
WrapperManager.signalStopped(Router.EXIT_HARD);
|
||||||
|
}
|
||||||
|
|
||||||
|
});
|
||||||
|
t.start();
|
||||||
|
getRouter().shutdown(Router.EXIT_HARD);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -19,6 +19,7 @@ import net.i2p.util.I2PAppThread;
|
|||||||
import net.i2p.util.SecureDirectory;
|
import net.i2p.util.SecureDirectory;
|
||||||
import net.i2p.util.SecureFileOutputStream;
|
import net.i2p.util.SecureFileOutputStream;
|
||||||
import net.i2p.util.ShellCommand;
|
import net.i2p.util.ShellCommand;
|
||||||
|
import net.i2p.util.VersionComparator;
|
||||||
|
|
||||||
import org.mortbay.http.DigestAuthenticator;
|
import org.mortbay.http.DigestAuthenticator;
|
||||||
import org.mortbay.http.HashUserRealm;
|
import org.mortbay.http.HashUserRealm;
|
||||||
@ -303,8 +304,11 @@ public class RouterConsoleRunner {
|
|||||||
try {
|
try {
|
||||||
//TODO: move away from routerconsole into a separate application.
|
//TODO: move away from routerconsole into a separate application.
|
||||||
//ApplicationManager?
|
//ApplicationManager?
|
||||||
String[] args = new String[0];
|
VersionComparator v = new VersionComparator();
|
||||||
net.i2p.desktopgui.Main.beginStartup(args);
|
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) {
|
} catch (Throwable t) {
|
||||||
t.printStackTrace();
|
t.printStackTrace();
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user