From: David ‘Bombe’ Roden Date: Mon, 1 Jun 2009 14:12:06 +0000 (+0200) Subject: Emit upload-finished event when the first message from the node arrives. X-Git-Tag: 0.7.1~4 X-Git-Url: https://git.pterodactylus.net/?a=commitdiff_plain;h=8a4a1d1cfd4aa8d927a83f32895784aef94ad116;p=jSite.git Emit upload-finished event when the first message from the node arrives. --- diff --git a/src/de/todesbaum/jsite/application/ProjectInserter.java b/src/de/todesbaum/jsite/application/ProjectInserter.java index 7256bbe..46cdbd4 100644 --- a/src/de/todesbaum/jsite/application/ProjectInserter.java +++ b/src/de/todesbaum/jsite/application/ProjectInserter.java @@ -125,6 +125,17 @@ public class ProjectInserter implements FileScannerListener, Runnable { /** * Notifies all listeners that the insert has made some progress. * + * @see InsertListener#projectUploadFinished(Project) + */ + protected void fireProjectUploadFinished() { + for (InsertListener insertListener : insertListeners) { + insertListener.projectUploadFinished(project); + } + } + + /** + * Notifies all listeners that the insert has made some progress. + * * @see InsertListener#projectInsertProgress(Project, int, int, int, int, * boolean) * @param succeeded @@ -416,6 +427,7 @@ public class ProjectInserter implements FileScannerListener, Runnable { /* parse progress and success messages */ String finalURI = null; + boolean firstMessage = true; boolean success = false; boolean finished = false; boolean disconnected = false; @@ -425,6 +437,10 @@ public class ProjectInserter implements FileScannerListener, Runnable { if (debug) { System.out.println(message); } + if (firstMessage) { + fireProjectUploadFinished(); + firstMessage = false; + } if (!finished) { @SuppressWarnings("null") String messageName = message.getName();