Merge pull request #47 from informatik-ag-ngl/b/status_tray_linux

Silent failure when StatusTrayIcon is not supported on a platform
This commit is contained in:
Kai S. K. Engelbart 2019-12-09 07:40:18 +01:00 committed by GitHub
commit 6525b1b026

View File

@ -71,12 +71,17 @@ public class Startup {
JOptionPane.WARNING_MESSAGE); JOptionPane.WARNING_MESSAGE);
} }
Settings.getInstance().setUsername(userName); Settings.getInstance().setUsername(userName);
EventQueue.invokeLater(() -> { EventQueue.invokeLater(() -> {
try { try {
ChatWindow chatWindow = new ChatWindow(client, localDB); ChatWindow chatWindow = new ChatWindow(client, localDB);
new StatusTrayIcon(chatWindow).show();
chatWindow.setVisible(true); chatWindow.setVisible(true);
try {
new StatusTrayIcon(chatWindow).show();
} catch (EnvoyException e) {
logger.warning("The StatusTrayIcon is not supported on this platform!");
}
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }