Closed Bug 394346 Opened 17 years ago Closed 17 years ago

Allow for named notifications with nsIAlertsService

Categories

(Toolkit :: UI Widgets, defect)

x86
macOS
defect
Not set
normal

Tracking

()

RESOLVED FIXED
mozilla1.9beta1

People

(Reporter: sdwilsh, Assigned: sdwilsh)

References

Details

(Keywords: dev-doc-complete)

Attachments

(1 file)

Bug 382694 didn't quite do a good job of giving an API for named notification. After talking with mano on irc, I think we can do an optional name parameter to the existing call of showAlertNofication.
Attached patch v1.0Splinter Review
Attachment #279346 - Flags: review?(mano)
I would suggest that the idl comment should not say which platforms it is currently implemented in, and should include just what a name for a notification actually means. Can only one notification with a given name display at once? can extension authors do custom styling based on the name or something? I wonder if in the event of empty cookie you should pass through the notification? Just a thought.
As long as it's mac-only, I would include both comments in the IDL.
Comment on attachment 279346 [details] [diff] [review] v1.0 either way, r=mano.
Attachment #279346 - Flags: review?(mano) → review+
Comment on attachment 279346 [details] [diff] [review] v1.0 I'll fix the comments (and post a patch) before checkin
Attachment #279346 - Flags: approval1.9?
Getting this out of the approval triage hole, and into Toolkit: General ;)
Component: General → XUL Widgets
Product: Thunderbird → Toolkit
QA Contact: general → xul.widgets
Target Milestone: Thunderbird 3 → mozilla1.9 M9
Attachment #279346 - Flags: approval1.9? → approval1.9+
Fixed comments on check-in. Checking in toolkit/components/alerts/public/nsIAlertsService.idl; new revision: 1.8; previous revision: 1.7 Checking in toolkit/components/alerts/src/nsAlertsService.cpp; new revision: 1.7; previous revision: 1.6 Checking in toolkit/components/alerts/src/mac/nsAlertsService.h; new revision: 1.6; previous revision: 1.5 Checking in toolkit/components/alerts/src/mac/nsAlertsService.mm; new revision: 1.9; previous revision: 1.8 Checking in toolkit/components/downloads/src/nsDownloadManager.cpp; new revision: 1.122; previous revision: 1.121
Status: ASSIGNED → RESOLVED
Closed: 17 years ago
Keywords: dev-doc-needed
Resolution: --- → FIXED
FYI, camino required additional bustage fix here since it still uses the xpfe alerts service (and the now-updated xpfe download manager).
That documentation has some flaws: 1) the yellow box at the top has several bits of wrong information 2) it has changed in 1.9, so the comment about it being unfrozen and not changing since 1.7 is wrong 3) the example should have one for pre 1.9, and one for post 1.9 that takes advantage of the optional arguments (that can be omitted from JS callers). I'll fix these if I get some time, but I don't expect that to be anytime soon.
Would be helpful if someone could specify what the wrong bits of information are, since I simply updated the text that was already on the page to mention that it works on Mac OS X in Fx3. :)
Sorry for the delay on this. Stuff that's wrong: -All the optional flag stuff is new to 1.9. Prior to it, all those arguments were required (except for the new one that was added). -Generally the service will not instantiate on OS X if Growl isn't installed. It also does a runtime check on the off chance that someone uninstalls Growl while the program is running. -showAlertNotification will throw NS_ERROR_NOT_AVAILABLE if Growl is not running on OS X as well.
Comment on attachment 279346 [details] [diff] [review] v1.0 >+ if (!aAlertName.IsEmpty()) { >+ return DispatchNamedNotification(aAlertTitle, aImageUrl, aAlertTitle, >+ aAlertText, aAlertCookie, aAlertListener); >+ } Shouldn't we pass aAlertName as the name here (and not aAlertTitle)?
(In reply to comment #13) > (From update of attachment 279346 [details] [diff] [review]) > >+ if (!aAlertName.IsEmpty()) { > >+ return DispatchNamedNotification(aAlertTitle, aImageUrl, aAlertTitle, > >+ aAlertText, aAlertCookie, aAlertListener); > >+ } er, yes! We should probably file a new bug to get that fixed...
(In reply to comment #14) > er, yes! We should probably file a new bug to get that fixed... Filed bug 448054
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: