make the eventbus static
This commit is contained in:
@@ -217,7 +217,7 @@ public class Download {
|
||||
else if (redirectCount > MAX_REDIRECTS)
|
||||
error = String.format("Download for URL '%s' is attempting too many redirects (over %d).", base.toString(), MAX_REDIRECTS);
|
||||
if (error != null) {
|
||||
EventBus.instance.post(new BubbleNotificationEvent(error, BubbleNotificationEvent.COLOR_ORANGE));
|
||||
EventBus.post(new BubbleNotificationEvent(error, BubbleNotificationEvent.COLOR_ORANGE));
|
||||
throw new IOException();
|
||||
}
|
||||
|
||||
|
||||
@@ -278,12 +278,12 @@ public class DownloadNode {
|
||||
download.setListener(new DownloadListener() {
|
||||
@Override
|
||||
public void completed() {
|
||||
EventBus.instance.post(new BarNotificationEvent(String.format("Download complete: %s", getTitle())));
|
||||
EventBus.post(new BarNotificationEvent(String.format("Download complete: %s", getTitle())));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error() {
|
||||
EventBus.instance.post(new BarNotificationEvent("Download failed due to a connection error."));
|
||||
EventBus.post(new BarNotificationEvent("Download failed due to a connection error."));
|
||||
}
|
||||
});
|
||||
this.download = download;
|
||||
@@ -404,7 +404,7 @@ public class DownloadNode {
|
||||
public void drawDownload(Graphics g, float position, int id, boolean hover) {
|
||||
Download download = this.download; // in case clearDownload() is called asynchronously
|
||||
if (download == null) {
|
||||
EventBus.instance.post(new BubbleNotificationEvent("Trying to draw download information for button without Download object", BubbleNotificationEvent.COLOR_ORANGE));
|
||||
EventBus.post(new BubbleNotificationEvent("Trying to draw download information for button without Download object", BubbleNotificationEvent.COLOR_ORANGE));
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@@ -251,13 +251,13 @@ public class Updater {
|
||||
@Override
|
||||
public void completed() {
|
||||
status = Status.UPDATE_DOWNLOADED;
|
||||
EventBus.instance.post(new BarNotificationEvent("Update has finished downloading"));
|
||||
EventBus.post(new BarNotificationEvent("Update has finished downloading"));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void error() {
|
||||
status = Status.CONNECTION_ERROR;
|
||||
EventBus.instance.post(new BarNotificationEvent("Update failed due to a connection error."));
|
||||
EventBus.post(new BarNotificationEvent("Update failed due to a connection error."));
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user