replace all calls to old bar notif with new method

This commit is contained in:
yugecin
2017-01-21 23:52:19 +01:00
parent 02ef422003
commit 36aaccda29
11 changed files with 55 additions and 42 deletions

View File

@@ -35,6 +35,7 @@ import org.newdawn.slick.Color;
import org.newdawn.slick.Graphics;
import org.newdawn.slick.Image;
import yugecin.opsudance.core.events.EventBus;
import yugecin.opsudance.events.BarNotificationEvent;
import yugecin.opsudance.events.BubbleNotificationEvent;
/**
@@ -277,12 +278,12 @@ public class DownloadNode {
download.setListener(new DownloadListener() {
@Override
public void completed() {
UI.sendBarNotification(String.format("Download complete: %s", getTitle()));
EventBus.instance.post(new BarNotificationEvent(String.format("Download complete: %s", getTitle())));
}
@Override
public void error() {
UI.sendBarNotification("Download failed due to a connection error.");
EventBus.instance.post(new BarNotificationEvent("Download failed due to a connection error."));
}
});
this.download = download;

View File

@@ -38,6 +38,8 @@ import org.apache.maven.artifact.versioning.DefaultArtifactVersion;
import org.newdawn.slick.util.Log;
import org.newdawn.slick.util.ResourceLoader;
import yugecin.opsudance.core.errorhandling.ErrorHandler;
import yugecin.opsudance.core.events.EventBus;
import yugecin.opsudance.events.BarNotificationEvent;
/**
* Handles automatic program updates.
@@ -249,13 +251,13 @@ public class Updater {
@Override
public void completed() {
status = Status.UPDATE_DOWNLOADED;
UI.sendBarNotification("Update has finished downloading.");
EventBus.instance.post(new BarNotificationEvent("Update has finished downloading"));
}
@Override
public void error() {
status = Status.CONNECTION_ERROR;
UI.sendBarNotification("Update failed due to a connection error.");
EventBus.instance.post(new BarNotificationEvent("Update failed due to a connection error."));
}
});
}