add an explicit menu to show MW
This commit is contained in:
@@ -66,16 +66,21 @@ class Initialize extends AbstractLifecycleHandler {
|
|||||||
tray.remove(trayIcon)
|
tray.remove(trayIcon)
|
||||||
System.exit(0)
|
System.exit(0)
|
||||||
})
|
})
|
||||||
|
|
||||||
|
def showMW = {e ->
|
||||||
|
def mainFrame = application.getWindowManager().findWindow("main-frame")
|
||||||
|
if (mainFrame != null)
|
||||||
|
mainFrame.setVisible(true)
|
||||||
|
}
|
||||||
|
|
||||||
|
def show = new MenuItem("Open MuWire")
|
||||||
|
show.addActionListener(showMW)
|
||||||
|
popupMenu.add(show)
|
||||||
popupMenu.add(exit)
|
popupMenu.add(exit)
|
||||||
tray.add(trayIcon)
|
tray.add(trayIcon)
|
||||||
|
|
||||||
|
|
||||||
trayIcon.addActionListener({ e ->
|
trayIcon.addActionListener(showMW)
|
||||||
def mainFrame = application.getWindowManager().findWindow("main-frame")
|
|
||||||
if (mainFrame != null)
|
|
||||||
mainFrame.setVisible(true)
|
|
||||||
})
|
|
||||||
application.getContext().put("tray-icon", true)
|
application.getContext().put("tray-icon", true)
|
||||||
} catch (Exception bad) {
|
} catch (Exception bad) {
|
||||||
log.log(Level.WARNING,"couldn't set tray icon",bad)
|
log.log(Level.WARNING,"couldn't set tray icon",bad)
|
||||||
|
Reference in New Issue
Block a user