Index: wp-includes/js/swfupload/plugins/swfupload.queue.js
===================================================================
--- wp-includes/js/swfupload/plugins/swfupload.queue.js	(revision 9385)
+++ wp-includes/js/swfupload/plugins/swfupload.queue.js	(working copy)
@@ -2,9 +2,12 @@
 	Queue Plug-in
 	
 	Features:
-		cancelQueue method for cancelling the entire queue.
-		All queued files are uploaded when startUpload() is called.
-		If false is returned from uploadComplete then the queue upload is stopped.  If false is not returned (strict comparison) then the queue upload is continued.
+		*Adds a cancelQueue() method for cancelling the entire queue.
+		*All queued files are uploaded when startUpload() is called.
+		*If false is returned from uploadComplete then the queue upload is stopped.
+		 If false is not returned (strict comparison) then the queue upload is continued.
+		*Adds a QueueComplete event that is fired when all the queued files have finished uploading.
+		 Set the event handler with the queue_complete_handler setting.
 		
 	*/
 
@@ -12,47 +15,63 @@
 if (typeof(SWFUpload) === "function") {
 	SWFUpload.queue = {};
 	
-	SWFUpload.prototype.initSettings = function (old_initSettings) {
-		return function (init_settings) {
-			if (typeof(old_initSettings) === "function") {
-				old_initSettings.call(this, init_settings);
+	SWFUpload.prototype.initSettings = (function (oldInitSettings) {
+		return function () {
+			if (typeof(oldInitSettings) === "function") {
+				oldInitSettings.call(this);
 			}
 			
 			this.customSettings.queue_cancelled_flag = false;
+			this.customSettings.queue_upload_count = 0;
 			
-			this.addSetting("user_upload_complete_handler", init_settings.upload_complete_handler, SWFUpload.uploadComplete);
-			this.uploadComplete_handler = SWFUpload.queue.uploadComplete;
+			this.settings.user_upload_complete_handler = this.settings.upload_complete_handler;
+			this.settings.upload_complete_handler = SWFUpload.queue.uploadCompleteHandler;
+			
+			this.settings.queue_complete_handler = this.settings.queue_complete_handler || null;
 		};
-	}(SWFUpload.prototype.initSettings);
+	})(SWFUpload.prototype.initSettings);
 
-	SWFUpload.prototype.cancelQueue = function () {
-		var stats = this.getStats();
+	SWFUpload.prototype.startUpload = function (fileID) {
 		this.customSettings.queue_cancelled_flag = false;
+		this.callFlash("StartUpload", false, [fileID]);
+	};
 
-		if (stats.in_progress > 0) {
-			this.customSettings.queue_cancelled_flag = true;
-		}
+	SWFUpload.prototype.cancelQueue = function () {
+		this.customSettings.queue_cancelled_flag = true;
+		this.stopUpload();
 		
-		while(stats.files_queued > 0) {
+		var stats = this.getStats();
+		while (stats.files_queued > 0) {
 			this.cancelUpload();
 			stats = this.getStats();
 		}
 	};
 	
-	SWFUpload.queue.uploadComplete = function (file) {
-		var user_upload_complete_handler = this.getSetting("user_upload_complete_handler");
-		var continue_upload = true;
+	SWFUpload.queue.uploadCompleteHandler = function (file) {
+		var user_upload_complete_handler = this.settings.user_upload_complete_handler;
+		var continueUpload;
+		
+		if (file.filestatus === SWFUpload.FILE_STATUS.COMPLETE) {
+			this.customSettings.queue_upload_count++;
+		}
+
 		if (typeof(user_upload_complete_handler) === "function") {
-			continue_upload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
+			continueUpload = (user_upload_complete_handler.call(this, file) === false) ? false : true;
+		} else {
+			continueUpload = true;
 		}
 		
-		if (continue_upload) {
+		if (continueUpload) {
 			var stats = this.getStats();
 			if (stats.files_queued > 0 && this.customSettings.queue_cancelled_flag === false) {
 				this.startUpload();
+			} else if (this.customSettings.queue_cancelled_flag === false) {
+				this.queueEvent("queue_complete_handler", [this.customSettings.queue_upload_count]);
+				this.customSettings.queue_upload_count = 0;
 			} else {
 				this.customSettings.queue_cancelled_flag = false;
+				this.customSettings.queue_upload_count = 0;
 			}
 		}
 	};
