I2P Address: [http://git.idk.i2p]

Skip to content
Snippets Groups Projects
Commit f2203002 authored by hypercubus's avatar hypercubus Committed by zzz
Browse files

code cleanup

parent a2b86acc
Branches
Tags
No related merge requests found
......@@ -23,6 +23,9 @@ import snoozesoft.systray4j.SysTrayMenuListener;
* @author hypercubus
*/
public class SysTray implements SysTrayMenuListener {
private static final SysTray INSTANCE = System.getProperty("os.name").startsWith("Windows") ? new SysTray() : null;
private BrowserChooser _browserChooser;
private String _browserString;
private ConfigFile _configFile = new ConfigFile();
......@@ -33,12 +36,8 @@ public class SysTray implements SysTrayMenuListener {
private SysTrayMenuIcon _sysTrayMenuIcon = new SysTrayMenuIcon("icons/iggy");
private SysTrayMenu _sysTrayMenu = new SysTrayMenu(_sysTrayMenuIcon, "I2P Control");
private UrlLauncher _urlLauncher = new UrlLauncher();
private static SysTray _instance;
public static synchronized SysTray instance() { return _instance; }
public SysTray() {
_instance = this;
if (!_configFile.init("systray.config"))
_configFile.setProperty("browser", "default");
......@@ -48,14 +47,14 @@ public class SysTray implements SysTrayMenuListener {
createSysTrayMenu();
}
public static void main(String[] args) {
if (System.getProperty("os.name").startsWith("Windows"))
new SysTray();
public static synchronized SysTray getInstance() {
return INSTANCE;
}
public void hide() {
_sysTrayMenu.hideIcon();
}
public void show() { _sysTrayMenu.showIcon(); }
public void hide() { _sysTrayMenu.hideIcon(); }
public void iconLeftClicked(SysTrayMenuEvent e) {}
public void iconLeftDoubleClicked(SysTrayMenuEvent e) {
......@@ -83,6 +82,10 @@ public class SysTray implements SysTrayMenuListener {
}
}
public void show() {
_sysTrayMenu.showIcon();
}
private void createSysTrayMenu() {
_itemShutdown.addSysTrayMenuListener(this);
_itemSelectBrowser.addSysTrayMenuListener(this);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment