import net.pterodactylus.sone.core.Core;
import net.pterodactylus.sone.core.CoreListener;
import net.pterodactylus.sone.data.Album;
+import net.pterodactylus.sone.data.Image;
import net.pterodactylus.sone.data.Post;
import net.pterodactylus.sone.data.Reply;
import net.pterodactylus.sone.data.Sone;
/** The “new version” notification. */
private final TemplateNotification newVersionNotification;
+ /** The “inserting images” notification. */
+ private final ListNotification<Image> insertingImagesNotification;
+
+ /** The “inserted images” notification. */
+ private final ListNotification<Image> insertedImagesNotification;
+
+ /** The “image insert failed” notification. */
+ private final ListNotification<Image> imageInsertFailedNotification;
+
/**
* Creates a new web interface.
*
Template newVersionTemplate = TemplateParser.parse(createReader("/templates/notify/newVersionNotification.html"));
newVersionNotification = new TemplateNotification("new-version-notification", newVersionTemplate);
+
+ Template insertingImagesTemplate = TemplateParser.parse(createReader("/templates/notify/inserting-images-notification.html"));
+ insertingImagesNotification = new ListNotification<Image>("inserting-images-notification", "images", insertingImagesTemplate);
+
+ Template insertedImagesTemplate = TemplateParser.parse(createReader("/templates/notify/inserted-images-notification.html"));
+ insertedImagesNotification = new ListNotification<Image>("inserted-images-notification", "images", insertedImagesTemplate);
+
+ Template imageInsertFailedTemplate = TemplateParser.parse(createReader("/templates/notify/image-insert-failed-notification.html"));
+ imageInsertFailedNotification = new ListNotification<Image>("image-insert-failed-notification", "images", imageInsertFailedTemplate);
}
//
*/
@Override
public void imageInsertStarted(Image image) {
+ insertingImagesNotification.add(image);
+ notificationManager.addNotification(insertingImagesNotification);
}
/**
*/
@Override
public void imageInsertAborted(Image image) {
+ insertingImagesNotification.remove(image);
}
/**
*/
@Override
public void imageInsertFinished(Image image) {
+ insertingImagesNotification.remove(image);
+ insertedImagesNotification.add(image);
+ notificationManager.addNotification(insertedImagesNotification);
}
/**
*/
@Override
public void imageInsertFailed(Image image, Throwable cause) {
+ insertingImagesNotification.remove(image);
+ imageInsertFailedNotification.add(image);
+ notificationManager.addNotification(imageInsertFailedNotification);
}
/**
Notification.SoneRescued.Text.RememberToUnlock=Please remember to control the posts and replies you have given and don’t forget to unlock your Sones!
Notification.LockedSones.Text=The following Sones have been locked for more than 5 minutes. Please check if you really want to keep these Sones locked:
Notification.NewVersion.Text=Version {version} of the Sone plugin was found. Download it from USK@nwa8lHa271k2QvJ8aa0Ov7IHAV-DFOCFgmDt3X6BpCI,DuQSUZiI~agF8c-6tjsFFGuZ8eICrzWCILB60nT8KKo,AQACAAE/sone/{edition}!
+Notification.InsertingImages.Text=The following images are being inserted:
+Notification.InsertedImages.Text=The following images have been inserted:
+Notification.ImageInsertFailed.Text=The following images could not be inserted: