import net.pterodactylus.util.config.Configuration;
import net.pterodactylus.util.config.ConfigurationException;
import net.pterodactylus.util.logging.Logging;
-import net.pterodactylus.util.notify.NotificationManager;
import net.pterodactylus.util.number.Numbers;
import freenet.keys.FreenetURI;
/** Interface to freenet. */
private final FreenetInterface freenetInterface;
- /** The notification manager. */
- private final NotificationManager notificationManager = new NotificationManager();
-
/** The Sone downloader. */
private final SoneDownloader soneDownloader;
}
/**
- * Returns the notification manager.
- *
- * @return The notification manager
- */
- public NotificationManager getNotifications() {
- return notificationManager;
- }
-
- /**
* Returns the status of the given Sone.
*
* @param sone
/** 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;
}
/**
+ * 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
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");
}