Bug #369109 --> thunderbird release notes url should use the url formatter to get formatted instead of making it a string property. r=axel

This commit is contained in:
scott%scott-macgregor.org 2007-02-06 05:03:16 +00:00
parent 6b341f00f5
commit 702bf54014
6 changed files with 32 additions and 12 deletions

View File

@ -74,10 +74,10 @@ pref("app.update.vendorName.override", "Mozilla");
// URL user can browse to manually if for some reason all update installation
// attempts fail. TODO: Change this URL
pref("app.update.url.manual", "http://www.mozilla.org/products/thunderbird/");
pref("app.update.url.manual", "http://%LOCALE%.www.mozilla.com/%LOCALE%/%APP%/");
// A default value for the "More information about this update" link
// supplied in the "An update is available" page of the update wizard.
pref("app.update.url.details", "chrome://messenger-region/locale/region.properties");
pref("app.update.url.details", "http://%LOCALE%.www.mozilla.com/%LOCALE%/%APP%/releases/");
// User-settable override to app.update.url for testing purposes.
//pref("app.update.url.override", "");
@ -101,6 +101,9 @@ pref("app.update.timer", 600000);
// which tells users what's new in this new update.
pref("app.update.showInstalledUI", false);
// Release notes URL
pref("app.releaseNotesURL", "http://%LOCALE%.www.mozilla.com/%LOCALE%/%APP%/%VERSION%/releasenotes/");
// Blocklist preferences
pref("extensions.blocklist.enabled", true);
pref("extensions.blocklist.interval", 86400);

View File

@ -249,3 +249,24 @@ function openRegionURL(aResourceName)
protocolSvc.loadUrl(uri);
} catch (ex) {}
}
/**
* Fetches the url for the passed in pref name, formats it and then loads it in the default
* browser.
*
* @param aPrefName - name of the pref that holds the url we want to format and open
*/
function openFormattedRegionURL(aPrefName)
{
var formatter = Components.classes["@mozilla.org/toolkit/URLFormatterService;1"]
.getService(Components.interfaces.nsIURLFormatter);
var formattedUrl = formatter.formatURLPref(aPrefName);
var uri = Components.classes["@mozilla.org/network/io-service;1"]
.getService(Components.interfaces.nsIIOService)
.newURI(formattedUrl, null, null);
var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
.getService(Components.interfaces.nsIExternalProtocolService);
protocolSvc.loadUrl(uri);
}

View File

@ -1875,9 +1875,9 @@
<menupopup id="menu_HelpPopup" onpopupshowing="buildHelpMenu();">
#ifdef XP_MACOSX
<menuitem id="hintsAndTips" label="&hintsAndTips.label;" key="key_macHelp" oncommand="openRegionURL('mailnews.hints_and_tips.url');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openRegionURL('releaseNotesURL');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openFormattedRegionURL('app.releaseNotesURL');"/>
#else
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openRegionURL('releaseNotesURL');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openFormattedRegionURL('app.releaseNotesURL');"/>
<menuitem id="hintsAndTips" accesskey="&hintsAndTips.accesskey;" label="&hintsAndTips.label;" oncommand="openRegionURL('mailnews.hints_and_tips.url');"/>
#endif
<menuseparator id="menu_HelpAboutSeparator"/>

View File

@ -485,9 +485,9 @@
<menupopup id="menu_HelpPopup">
#ifdef XP_MACOSX
<menuitem id="hintsAndTips" label="&hintsAndTips.label;" key="key_macHelp" oncommand="openRegionURL('mailnews.hints_and_tips.url');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openRegionURL('releaseNotesURL');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openFormattedRegionURL('app.releaseNotesURL');"/>
#else
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openRegionURL('releaseNotesURL');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openFormattedRegionURL('app.releaseNotesURL');"/>
<menuitem id="hintsAndTips" accesskey="&hintsAndTips.accesskey;" label="&hintsAndTips.label;" oncommand="openRegionURL('mailnews.hints_and_tips.url');"/>
<menuseparator id="menu_HelpAboutSeparator"/>
#endif

View File

@ -539,9 +539,9 @@
<menupopup id="menu_HelpPopup">
#ifdef XP_MACOSX
<menuitem id="hintsAndTips" label="&hintsAndTips.label;" key="key_macHelp" oncommand="openRegionURL('mailnews.hints_and_tips.url');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openRegionURL('releaseNotesURL');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openFormattedRegionURL('app.releaseNotesURL');"/>
#else
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openRegionURL('releaseNotesURL');"/>
<menuitem id="releaseNotes" accesskey="&releaseCmd.accesskey;" label="&releaseCmd.label;" oncommand="openFormattedRegionURL('app.releaseNotesURL');"/>
<menuitem id="hintsAndTips" accesskey="&hintsAndTips.accesskey;" label="&hintsAndTips.label;" oncommand="openRegionURL('mailnews.hints_and_tips.url');"/>
<menuseparator id="menu_HelpAboutSeparator"/>
#endif

View File

@ -2,7 +2,6 @@
# messenger.properties
# mailnews.js
mailnews.start_page.url=chrome://messenger/content/start.xhtml
releaseNotesURL=http://www.mozilla.org/products/thunderbird/releases/%S.html
mailnews.hints_and_tips.url=http://www.mozilla.org/support/thunderbird/
# To make mapit buttons to disappear in the addressbook, specify empty string. For example:
@ -16,6 +15,3 @@ mailnews.hints_and_tips.url=http://www.mozilla.org/support/thunderbird/
# @CO == country
mail.addr_book.mapit_url.format=http://maps.google.com/maps?q=@A1%20@A2%20@CI%20@ST%20@ZI%20@CO
# This is the fallback URL for release notes. Do not change this
# unless you are providing localized release notes!
app.update.url.details=http://www.mozilla.org/products/thunderbird/releases/