bug 395640: rename the 'always ask' and 'handle internally' actions for the feed type in the Applications prefpane to 'Preview in &brandShortName;' and 'Live Bookmarks in &brandShortName;', respectively; r=gavin, a=mconnor
This commit is contained in:
@@ -699,10 +699,15 @@ var gApplicationsPane = {
|
||||
// objects, indexed by type.
|
||||
_handledTypes: {},
|
||||
|
||||
_brandBundle : null,
|
||||
_prefsBundle : null,
|
||||
_list : null,
|
||||
_filter : null,
|
||||
|
||||
//**************************************************************************//
|
||||
// Convenience & Performance Shortcuts
|
||||
|
||||
// These get defined by init().
|
||||
_brandShortName : null,
|
||||
_prefsBundle : null,
|
||||
_list : null,
|
||||
_filter : null,
|
||||
|
||||
// Retrieve this as nsIPrefBranch and then immediately QI to nsIPrefBranch2
|
||||
// so both interfaces are available to callers.
|
||||
@@ -727,8 +732,9 @@ var gApplicationsPane = {
|
||||
// Initialization & Destruction
|
||||
|
||||
init: function() {
|
||||
// Initialize shortcuts to some commonly accessed elements.
|
||||
this._brandBundle = document.getElementById("bundleBrand");
|
||||
// Initialize shortcuts to some commonly accessed elements & values.
|
||||
this._brandShortName =
|
||||
document.getElementById("bundleBrand").getString("brandShortName");
|
||||
this._prefsBundle = document.getElementById("bundlePreferences");
|
||||
this._list = document.getElementById("handlersView");
|
||||
this._filter = document.getElementById("filter");
|
||||
@@ -992,7 +998,8 @@ var gApplicationsPane = {
|
||||
// with alwaysAskBeforeHandling except for the feed type, so here we use
|
||||
// a feed-specific message to describe the behavior.
|
||||
if (aHandlerInfo.alwaysAskBeforeHandling)
|
||||
return this._prefsBundle.getString("alwaysAskAboutFeed");
|
||||
return this._prefsBundle.getFormattedString("previewInApp",
|
||||
[this._brandShortName]);
|
||||
|
||||
switch (aHandlerInfo.preferredAction) {
|
||||
case Ci.nsIHandlerInfo.saveToDisk:
|
||||
@@ -1004,7 +1011,8 @@ var gApplicationsPane = {
|
||||
case Ci.nsIHandlerInfo.handleInternally:
|
||||
// For the feed type, handleInternally means live bookmarks.
|
||||
if (aHandlerInfo.type == TYPE_MAYBE_FEED)
|
||||
return this._prefsBundle.getString("liveBookmarks");
|
||||
return this._prefsBundle.getFormattedString("liveBookmarksInApp",
|
||||
[this._brandShortName]);
|
||||
|
||||
// For other types, handleInternally looks like either useHelperApp
|
||||
// or useSystemDefault depending on whether or not there's a preferred
|
||||
@@ -1023,10 +1031,9 @@ var gApplicationsPane = {
|
||||
return aHandlerInfo.defaultDescription;
|
||||
|
||||
case kActionUsePlugin:
|
||||
let brandShortName = this._brandBundle.getString("brandShortName");
|
||||
return this._prefsBundle.getFormattedString("pluginName",
|
||||
[aHandlerInfo.plugin.name,
|
||||
brandShortName]);
|
||||
this._brandShortName]);
|
||||
}
|
||||
},
|
||||
|
||||
@@ -1074,15 +1081,18 @@ var gApplicationsPane = {
|
||||
if (handlerInfo.type == TYPE_MAYBE_FEED) {
|
||||
let menuItem = document.createElementNS(kXULNS, "menuitem");
|
||||
menuItem.setAttribute("alwaysAsk", "true");
|
||||
menuItem.setAttribute("label",
|
||||
this._prefsBundle.getString("alwaysAskAboutFeed"));
|
||||
let label = this._prefsBundle.getFormattedString("previewInApp",
|
||||
[this._brandShortName]);
|
||||
menuItem.setAttribute("label", label);
|
||||
menuPopup.appendChild(menuItem);
|
||||
if (handlerInfo.alwaysAskBeforeHandling)
|
||||
menu.selectedItem = menuItem;
|
||||
|
||||
menuItem = document.createElementNS(kXULNS, "menuitem");
|
||||
menuItem.setAttribute("action", Ci.nsIHandlerInfo.handleInternally);
|
||||
menuItem.setAttribute("label", this._prefsBundle.getString("liveBookmarks"));
|
||||
label = this._prefsBundle.getFormattedString("liveBookmarksInApp",
|
||||
[this._brandShortName]);
|
||||
menuItem.setAttribute("label", label);
|
||||
menuItem.setAttribute("image", "chrome://browser/skin/page-livemarks.png");
|
||||
menuPopup.appendChild(menuItem);
|
||||
if (handlerInfo.preferredAction == Ci.nsIHandlerInfo.handleInternally)
|
||||
@@ -1142,10 +1152,9 @@ var gApplicationsPane = {
|
||||
if (handlerInfo.plugin) {
|
||||
let menuItem = document.createElementNS(kXULNS, "menuitem");
|
||||
menuItem.setAttribute("action", kActionUsePlugin);
|
||||
let brandShortName = this._brandBundle.getString("brandShortName");
|
||||
let label = this._prefsBundle.getFormattedString("pluginName",
|
||||
[handlerInfo.plugin.name,
|
||||
brandShortName]);
|
||||
this._brandShortName]);
|
||||
menuItem.setAttribute("label", label);
|
||||
menuPopup.appendChild(menuItem);
|
||||
if (handlerInfo.preferredAction == kActionUsePlugin)
|
||||
|
||||
Reference in New Issue
Block a user