New application for I2P: desktopgui. Should eventually replace systray, and have more functionality.
To use the application, you need to (by default) add the following to clients.config : # desktopgui clientApp.6.args= clientApp.6.delay=5 clientApp.6.main=desktopgui.Main clientApp.6.name=desktopgui clientApp.6.startOnLoad=true
This commit is contained in:
38
apps/desktopgui/src/router/RouterHandler.java
Normal file
38
apps/desktopgui/src/router/RouterHandler.java
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
* To change this template, choose Tools | Templates
|
||||
* and open the template in the editor.
|
||||
*/
|
||||
|
||||
package router;
|
||||
|
||||
import java.util.logging.Level;
|
||||
import java.util.logging.Logger;
|
||||
import net.i2p.router.RouterContext;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author mathias
|
||||
*/
|
||||
public class RouterHandler {
|
||||
public static final int SHUTDOWN_GRACEFULLY = 0;
|
||||
public static void setStatus(int status) {
|
||||
if(status == SHUTDOWN_GRACEFULLY) {
|
||||
Thread t = new Thread(new Runnable() {
|
||||
|
||||
public void run() {
|
||||
RouterContext context = RouterHelper.getContext();
|
||||
context.router().shutdownGracefully();
|
||||
while(context.router().getShutdownTimeRemaining()>0)
|
||||
try {
|
||||
Thread.sleep(context.router().getShutdownTimeRemaining());
|
||||
} catch (InterruptedException ex) {
|
||||
Logger.getLogger(RouterHandler.class.getName()).log(Level.SEVERE, null, ex);
|
||||
}
|
||||
System.exit(0);
|
||||
}
|
||||
|
||||
});
|
||||
t.start();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user