Bug 924614 - Fix duplicate Scratchpad menu items in Web Developer menu. r=mratcliffe

This commit is contained in:
Brandon Benvie 2013-10-09 11:47:00 -07:00
Родитель 60b798fb99
Коммит a8e0db8b42
3 изменённых файлов: 12 добавлений и 3 удалений

Просмотреть файл

@ -545,7 +545,7 @@ let gDevToolsBrowser = {
*/ */
_addToolToWindows: function DT_addToolToWindows(toolDefinition) { _addToolToWindows: function DT_addToolToWindows(toolDefinition) {
// No menu item or global shortcut is required for options panel. // No menu item or global shortcut is required for options panel.
if (toolDefinition.id == "options") { if (!toolDefinition.inMenu) {
return; return;
} }
@ -561,7 +561,7 @@ let gDevToolsBrowser = {
let allDefs = gDevTools.getToolDefinitionArray(); let allDefs = gDevTools.getToolDefinitionArray();
let prevDef; let prevDef;
for (let def of allDefs) { for (let def of allDefs) {
if (def.id == "options") { if (!def.inMenu) {
continue; continue;
} }
if (def === toolDefinition) { if (def === toolDefinition) {
@ -630,7 +630,7 @@ let gDevToolsBrowser = {
let fragMenuItems = doc.createDocumentFragment(); let fragMenuItems = doc.createDocumentFragment();
for (let toolDefinition of gDevTools.getToolDefinitionArray()) { for (let toolDefinition of gDevTools.getToolDefinitionArray()) {
if (toolDefinition.id == "options") { if (!toolDefinition.inMenu) {
continue; continue;
} }

Просмотреть файл

@ -27,6 +27,7 @@ function testRegister(aToolbox)
gDevTools.registerTool({ gDevTools.registerTool({
id: "test-tool", id: "test-tool",
label: "Test Tool", label: "Test Tool",
inMenu: true,
isTargetSupported: function() true, isTargetSupported: function() true,
build: function() {} build: function() {}
}); });

Просмотреть файл

@ -59,6 +59,7 @@ Tools.options = {
url: "chrome://browser/content/devtools/framework/toolbox-options.xul", url: "chrome://browser/content/devtools/framework/toolbox-options.xul",
icon: "chrome://browser/skin/devtools/tool-options.png", icon: "chrome://browser/skin/devtools/tool-options.png",
tooltip: l10n("optionsButton.tooltip", toolboxStrings), tooltip: l10n("optionsButton.tooltip", toolboxStrings),
inMenu: false,
isTargetSupported: function(target) { isTargetSupported: function(target) {
return true; return true;
}, },
@ -79,6 +80,7 @@ Tools.webConsole = {
label: l10n("ToolboxTabWebconsole.label", webConsoleStrings), label: l10n("ToolboxTabWebconsole.label", webConsoleStrings),
menuLabel: l10n("MenuWebconsole.label", webConsoleStrings), menuLabel: l10n("MenuWebconsole.label", webConsoleStrings),
tooltip: l10n("ToolboxWebconsole.tooltip", webConsoleStrings), tooltip: l10n("ToolboxWebconsole.tooltip", webConsoleStrings),
inMenu: true,
isTargetSupported: function(target) { isTargetSupported: function(target) {
return true; return true;
@ -99,6 +101,7 @@ Tools.inspector = {
url: "chrome://browser/content/devtools/inspector/inspector.xul", url: "chrome://browser/content/devtools/inspector/inspector.xul",
label: l10n("inspector.label", inspectorStrings), label: l10n("inspector.label", inspectorStrings),
tooltip: l10n("inspector.tooltip", inspectorStrings), tooltip: l10n("inspector.tooltip", inspectorStrings),
inMenu: true,
preventClosingOnKey: true, preventClosingOnKey: true,
onkey: function(panel) { onkey: function(panel) {
@ -129,6 +132,7 @@ Tools.jsdebugger = {
url: "chrome://browser/content/devtools/debugger.xul", url: "chrome://browser/content/devtools/debugger.xul",
label: l10n("ToolboxDebugger.label", debuggerStrings), label: l10n("ToolboxDebugger.label", debuggerStrings),
tooltip: l10n("ToolboxDebugger.tooltip", debuggerStrings), tooltip: l10n("ToolboxDebugger.tooltip", debuggerStrings),
inMenu: true,
isTargetSupported: function(target) { isTargetSupported: function(target) {
return true; return true;
@ -150,6 +154,7 @@ Tools.styleEditor = {
url: "chrome://browser/content/devtools/styleeditor.xul", url: "chrome://browser/content/devtools/styleeditor.xul",
label: l10n("ToolboxStyleEditor.label", styleEditorStrings), label: l10n("ToolboxStyleEditor.label", styleEditorStrings),
tooltip: l10n("ToolboxStyleEditor.tooltip2", styleEditorStrings), tooltip: l10n("ToolboxStyleEditor.tooltip2", styleEditorStrings),
inMenu: true,
isTargetSupported: function(target) { isTargetSupported: function(target) {
return true; return true;
@ -172,6 +177,7 @@ Tools.jsprofiler = {
url: "chrome://browser/content/devtools/profiler.xul", url: "chrome://browser/content/devtools/profiler.xul",
label: l10n("profiler.label", profilerStrings), label: l10n("profiler.label", profilerStrings),
tooltip: l10n("profiler.tooltip2", profilerStrings), tooltip: l10n("profiler.tooltip2", profilerStrings),
inMenu: true,
isTargetSupported: function (target) { isTargetSupported: function (target) {
return true; return true;
@ -194,6 +200,7 @@ Tools.netMonitor = {
url: "chrome://browser/content/devtools/netmonitor.xul", url: "chrome://browser/content/devtools/netmonitor.xul",
label: l10n("netmonitor.label", netMonitorStrings), label: l10n("netmonitor.label", netMonitorStrings),
tooltip: l10n("netmonitor.tooltip", netMonitorStrings), tooltip: l10n("netmonitor.tooltip", netMonitorStrings),
inMenu: true,
isTargetSupported: function(target) { isTargetSupported: function(target) {
return !target.isApp; return !target.isApp;
@ -213,6 +220,7 @@ Tools.scratchpad = {
url: "chrome://browser/content/devtools/scratchpad.xul", url: "chrome://browser/content/devtools/scratchpad.xul",
label: l10n("scratchpad.label", scratchpadStrings), label: l10n("scratchpad.label", scratchpadStrings),
tooltip: l10n("scratchpad.tooltip", scratchpadStrings), tooltip: l10n("scratchpad.tooltip", scratchpadStrings),
inMenu: false,
isTargetSupported: function(target) { isTargetSupported: function(target) {
return target.isRemote; return target.isRemote;