Closed Bug 322395 Opened 19 years ago Closed 19 years ago

Preferences not working for firefox extension

Categories

(Calendar :: Preferences, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: mostafah, Assigned: mostafah)

References

Details

Attachments

(1 file)

The Edit->Preferences menu doesn't bring up the Preferences window when calendar is installed as an extension or if it's included in a firefox build. The reason lies in the launchPreferences() function in calendar.js: http://lxr.mozilla.org/seamonkey/source/calendar/resources/content/calendar.js#188 The current method of getting the application name (navigator.vendor) is not doing what the function expects (it's returning blank in firefox). Even if it does the conditional clause for directing the app to the proper pref window is not correct. It even has reference to "Firebird" which indicates that the code is quite out-of-date.
Blocks: 200257
http://weblogs.macromedia.com/mesh/archives/2005/11/macromedia_news_3.cfm suggests that the following code should replace the navigator.vendor detection of Firefox: var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo); switch (appInfo.ID) { // Firefox case "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}": firefox = true; break; }
Components.classes["@mozilla.org/xre/app-info;1"] was not defined for Seamonkey trunk. It was for Seamonkey 1.0b though. So this should be a better way of determining what to do. I wish I could've just done if( goPreferences ) but for some reason that would cause it to just bail out of the function with no js errors.
Attachment #207568 - Flags: first-review?(mvl)
Comment on attachment 207568 [details] [diff] [review] Use nsIXULAppInfo to determine which method of preferences to use r=mvl, but i have some minor style nits: >+ if( Components.classes["@mozilla.org/xre/app-info;1"] ) { The usual mozilla-style is not to include spaces around the part in parentheses, but add them after the if. So it becomes: + if (Components.classes["@mozilla.org/xre/app-info;1"]) { >+ var appInfo = Components.classes["@mozilla.org/xre/app-info;1"].getService(Components.interfaces.nsIXULAppInfo); Please move the .getService() part to the next line: + var appInfo = Components.classes["@mozilla.org/xre/app-info;1"] + .getService(Components.interfaces.nsIXULAppInfo); >+ if( applicationName == "SeaMonkey" || applicationName == "" ) Same whitespace nit as above.
Attachment #207568 - Flags: first-review?(mvl) → first-review+
Patch checked in with formatting fixed. Thanks for the review. I tried to use cross-commit but it bailed out on me (will work more on that later) so I manually committed to both places.
Status: NEW → RESOLVED
Closed: 19 years ago
Resolution: --- → FIXED
Component: Sunbird Only → Preferences
QA Contact: sunbird → preferences
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: