From f6b4ece647efea00bd26655005c7a42a34cdceaa Mon Sep 17 00:00:00 2001 From: "alqahira%ardisson.org" Date: Fri, 12 Dec 2008 19:50:07 +0000 Subject: [PATCH] Bug 404943 - [10.5] Bounce the download folder in the Dock when downloads finish. Patch by Ilya Sherman , r=cl, sr=smorgan git-svn-id: svn://10.0.0.236/trunk@255509 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/camino/src/download/ProgressViewController.mm | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/mozilla/camino/src/download/ProgressViewController.mm b/mozilla/camino/src/download/ProgressViewController.mm index 47a578e87f7..2be4e0f9ea5 100644 --- a/mozilla/camino/src/download/ProgressViewController.mm +++ b/mozilla/camino/src/download/ProgressViewController.mm @@ -52,6 +52,9 @@ // but that requires linkage and extra search paths. static NSString* XPCOMShutDownNotificationName = @"XPCOMShutDown"; +// This is the OS notification name to make the Dock icon for the downloads folder bounce. +static NSString* const DownloadFinishedOSNotificationName = @"com.apple.DownloadFileFinished"; + enum { kLabelTagFilename = 1000, kLabelTagStatus, @@ -383,6 +386,13 @@ enum { [mProgressWindowController removeDownload:self suppressRedraw:NO]; else if (!mDownloadFailed) [self setupFileSystemNotification]; + + // Sending this notification makes the Dock icon (if it exists) + // for the folder containing the downloaded file bounce. + if (!mUserCancelled && !mDownloadFailed) { + [[NSDistributedNotificationCenter defaultCenter] + postNotificationName:DownloadFinishedOSNotificationName object:mDestPath]; + } } }