Bug 596173 - Add a "Character Encoding" menu to the Firefox button if a hidden pref is turned on [r=gavin, ui-r=faaborg, a=blocking]

--HG--
rename : browser/base/content/test/tabview/browser_tabview_search.js => browser/base/content/test/tabview/browser_tabview_multiwindow_search.js
extra : rebase_source : c133155c88699a13686974fdf54b2a18f46ab6f4
This commit is contained in:
Patrick Walton 2010-09-21 14:56:52 -07:00
parent e08e388ec4
commit 47dca4530b
4 changed files with 33 additions and 1 deletions

View File

@ -1048,3 +1048,8 @@ pref("devtools.errorconsole.enabled", false);
// disable the Inspector
pref("devtools.inspector.enabled", false);
// Whether the character encoding menu is under the main Firefox button. This
// preference is a string so that localizers can alter it.
pref("browser.menu.showCharacterEncoding", "chrome://browser/locale/browser.properties");

View File

@ -52,6 +52,7 @@
# Gavin Sharp <gavin@gavinsharp.com>
# Justin Dolske <dolske@mozilla.com>
# Rob Campbell <rcampbell@mozilla.com>
# Patrick Walton <pcwalton@mozilla.com>
#
# Alternatively, the contents of this file may be used under the terms of
# either the GNU General Public License Version 2 or later (the "GPL"), or
@ -1599,6 +1600,18 @@ function delayedStartup(isLoadingBlank, mustLoadSidebar) {
document.getElementById("key_errorConsole").removeAttribute("disabled");
}
// If the user (or the locale) hasn't enabled the top-level "Character
// Encoding" menu via the "browser.menu.showCharacterEncoding" preference,
// hide it.
const showCharacterEncodingPref = "browser.menu.showCharacterEncoding";
let extraCharacterEncodingMenuEnabled = gPrefService.
getComplexValue(showCharacterEncodingPref, Ci.nsIPrefLocalizedString).data;
if (extraCharacterEncodingMenuEnabled !== "true") {
let charsetMenu = document.getElementById("appmenu_charsetMenu");
if (charsetMenu)
charsetMenu.setAttribute("hidden", "true");
}
Services.obs.notifyObservers(window, "browser-delayed-startup-finished", "");
}

View File

@ -568,7 +568,7 @@
command="View:PageSource"
key="key_viewSource"/>
<menuseparator/>
#define ID_PREFIX appmenu_
#define ID_PREFIX appmenu_developer_
#include browser-charsetmenu.inc
#undef ID_PREFIX
<menuseparator/>
@ -579,6 +579,9 @@
</menupopup>
</menu>
<menuseparator class="appmenu-menuseparator"/>
#define ID_PREFIX appmenu_
#include browser-charsetmenu.inc
#undef ID_PREFIX
<menuitem id="appmenu_fullScreen"
class="menuitem-tooltip"
label="&fullScreenCmd.label;"

View File

@ -318,3 +318,14 @@ tabView2.title=%S - Group Your Tabs
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.name=Default
extensions.{972ce4c6-7e08-4474-a285-3208198ce6fd}.description=The default theme.
# LOCALIZATION NOTE (browser.menu.showCharacterEncoding): Set to the string
# "true" (spelled and capitalized exactly that way) to show the "Character
# Encoding" menu in the main Firefox button on Windows. Any other value will
# hide it. Regardless of the value of this setting, the "Character Encoding"
# menu will always be accessible via the "Web Developer" menu.
# This is not a string to translate; it just controls whether the menu shows
# up in the Firefox button. If users frequently use the "Character Encoding"
# menu, set this to "true". Otherwise, you can leave it as "false".
browser.menu.showCharacterEncoding=false