X-Git-Url: https://git.pterodactylus.net/?a=blobdiff_plain;f=src%2Fmain%2Fjava%2Fnet%2Fpterodactylus%2Fsone%2Fweb%2FWebInterface.java;h=1c429e7afc6b932c25e6838736dcd712f5d5fc55;hb=e686b1315ba475258af1b1d487b6d257932c173e;hp=bd12d5b1fbc80300d2a36b725ea4d5744d858fba;hpb=40e29fa1abc0d1da75831d69d4cc9f52601a4045;p=Sone.git diff --git a/src/main/java/net/pterodactylus/sone/web/WebInterface.java b/src/main/java/net/pterodactylus/sone/web/WebInterface.java index bd12d5b..1c429e7 100644 --- a/src/main/java/net/pterodactylus/sone/web/WebInterface.java +++ b/src/main/java/net/pterodactylus/sone/web/WebInterface.java @@ -90,6 +90,9 @@ public class WebInterface { /** The logger. */ private static final Logger logger = Logging.getLogger(WebInterface.class); + /** The notification manager. */ + private final NotificationManager notificationManager = new NotificationManager(); + /** The Sone plugin. */ private final SonePlugin sonePlugin; @@ -147,6 +150,15 @@ public class WebInterface { } /** + * Returns the notification manager. + * + * @return The notification manager + */ + public NotificationManager getNotifications() { + return notificationManager; + } + + /** * Returns the l10n helper of the node. * * @return The node’s l10n helper @@ -192,13 +204,13 @@ public class WebInterface { Template startupNotificationTemplate = templateFactory.createTemplate(createReader("/templates/notify/startupNotification.html")); final TemplateNotification startupNotification = new TemplateNotification(startupNotificationTemplate); - getCore().getNotifications().addNotification(startupNotification); + notificationManager.addNotification(startupNotification); Ticker.getInstance().registerEvent(System.currentTimeMillis() + (120 * 1000), new Runnable() { @Override public void run() { - getCore().getNotifications().removeNotification(startupNotification); + startupNotification.dismiss(); } }, "Sone Startup Notification Remover"); }