From f4770a573b221d978a853a7a2c639f821151a3cc Mon Sep 17 00:00:00 2001 From: Girish Sharma Date: Tue, 18 Dec 2012 20:41:27 +0530 Subject: [PATCH] Bug 819929 - [toolbox] Buttons (close, undock and tabs) don't have tooltips, r=jwalker --- browser/devtools/framework/ToolDefinitions.jsm | 6 ++++++ browser/devtools/framework/Toolbox.jsm | 14 ++++++++++++++ browser/devtools/framework/toolbox.xul | 12 ++++++++++-- .../chrome/browser/devtools/debugger.properties | 5 +++++ .../chrome/browser/devtools/inspector.properties | 1 + .../chrome/browser/devtools/profiler.properties | 7 ++++++- .../chrome/browser/devtools/styleeditor.properties | 5 +++++ .../en-US/chrome/browser/devtools/toolbox.dtd | 2 ++ .../chrome/browser/devtools/toolbox.properties | 3 +++ .../chrome/browser/devtools/webconsole.properties | 5 +++++ 10 files changed, 57 insertions(+), 3 deletions(-) create mode 100644 browser/locales/en-US/chrome/browser/devtools/toolbox.properties diff --git a/browser/devtools/framework/ToolDefinitions.jsm b/browser/devtools/framework/ToolDefinitions.jsm index 35f9885a50b..e23dd1a6ac9 100644 --- a/browser/devtools/framework/ToolDefinitions.jsm +++ b/browser/devtools/framework/ToolDefinitions.jsm @@ -69,6 +69,8 @@ let webConsoleDefinition = { icon: "chrome://browser/skin/devtools/webconsole-tool-icon.png", url: "chrome://browser/content/devtools/webconsole.xul", label: l10n("ToolboxWebconsole.label", webConsoleStrings), + tooltip: l10n("ToolboxWebconsole.tooltip", webConsoleStrings), + isTargetSupported: function(target) { return true; }, @@ -88,6 +90,7 @@ let debuggerDefinition = { icon: "chrome://browser/skin/devtools/tools-icons-small.png", url: "chrome://browser/content/debugger.xul", label: l10n("ToolboxDebugger.label", debuggerStrings), + tooltip: l10n("ToolboxDebugger.tooltip", debuggerStrings), isTargetSupported: function(target) { return true; @@ -108,6 +111,7 @@ let inspectorDefinition = { icon: "chrome://browser/skin/devtools/tools-icons-small.png", url: "chrome://browser/content/devtools/inspector/inspector.xul", label: l10n("inspector.label", inspectorStrings), + tooltip: l10n("inspector.tooltip", inspectorStrings), isTargetSupported: function(target) { return !target.isRemote; @@ -127,6 +131,7 @@ let styleEditorDefinition = { modifiers: "shift", label: l10n("ToolboxStyleEditor.label", styleEditorStrings), url: "chrome://browser/content/styleeditor.xul", + tooltip: l10n("ToolboxStyleEditor.tooltip", styleEditorStrings), isTargetSupported: function(target) { return !target.isRemote && !target.isChrome; @@ -144,6 +149,7 @@ let profilerDefinition = { icon: "chrome://browser/skin/devtools/tools-icons-small.png", url: "chrome://browser/content/profiler.xul", label: l10n("profiler.label", profilerStrings), + tooltip: l10n("profiler.tooltip", profilerStrings), isTargetSupported: function (target) { if (target.isRemote || target.isChrome) { diff --git a/browser/devtools/framework/Toolbox.jsm b/browser/devtools/framework/Toolbox.jsm index 165a26d0c71..51f439851df 100644 --- a/browser/devtools/framework/Toolbox.jsm +++ b/browser/devtools/framework/Toolbox.jsm @@ -16,6 +16,17 @@ XPCOMUtils.defineLazyModuleGetter(this, "Hosts", "resource:///modules/devtools/ToolboxHosts.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "CommandUtils", "resource:///modules/devtools/DeveloperToolbar.jsm"); +XPCOMUtils.defineLazyGetter(this, "toolboxStrings", function() { + let bundle = Services.strings.createBundle("chrome://browser/locale/devtools/toolbox.properties"); + let l10n = function(name) { + try { + return bundle.GetStringFromName(name); + } catch (ex) { + Services.console.logStringMessage("Error reading '" + name + "'"); + } + }; + return l10n; +}); // DO NOT put Require.jsm or gcli.jsm into lazy getters as this breaks the // requisition import a few lines down. @@ -285,6 +296,8 @@ Toolbox.prototype = { let button = this.doc.createElement("toolbarbutton"); button.id = "toolbox-dock-" + position; button.className = "toolbox-dock-button"; + button.setAttribute("tooltiptext", toolboxStrings("toolboxDockButtons." + + position + ".tooltip")); button.addEventListener("command", function(position) { this.switchHost(position); }.bind(this, position)); @@ -348,6 +361,7 @@ Toolbox.prototype = { radio.className = "toolbox-tab devtools-tab"; radio.id = "toolbox-tab-" + id; radio.setAttribute("toolid", id); + radio.setAttribute("tooltiptext", toolDefinition.tooltip); let ordinal = (typeof toolDefinition.ordinal == "number") ? toolDefinition.ordinal : MAX_ORDINAL; diff --git a/browser/devtools/framework/toolbox.xul b/browser/devtools/framework/toolbox.xul index 8fa7e1ddc4d..b7c97a7b90b 100644 --- a/browser/devtools/framework/toolbox.xul +++ b/browser/devtools/framework/toolbox.xul @@ -2,6 +2,10 @@ + + %toolboxDTD; +]> @@ -15,7 +19,9 @@ #ifdef XP_MACOSX - + #endif @@ -25,7 +31,9 @@ #ifndef XP_MACOSX - + #endif diff --git a/browser/locales/en-US/chrome/browser/devtools/debugger.properties b/browser/locales/en-US/chrome/browser/devtools/debugger.properties index 3547726e5d6..b8628fd4332 100644 --- a/browser/locales/en-US/chrome/browser/devtools/debugger.properties +++ b/browser/locales/en-US/chrome/browser/devtools/debugger.properties @@ -186,6 +186,11 @@ globalScopeLabel=Global # displayed inside the developer tools window and in the Developer Tools Menu. ToolboxDebugger.label=Debugger +# LOCALIZATION NOTE (ToolboxDebugger.tooltip): +# This string is displayed in the tooltip of the tab when the debugger is +# displayed inside the developer tools window.. +ToolboxDebugger.tooltip=JavaScript Debugger + # LOCALIZATION NOTE (variablesEditableNameTooltip): The text that is displayed # in the variables list on an item with an editable name. variablesEditableNameTooltip=Double click to edit diff --git a/browser/locales/en-US/chrome/browser/devtools/inspector.properties b/browser/locales/en-US/chrome/browser/devtools/inspector.properties index 7379ca223bb..bd4729c3480 100644 --- a/browser/locales/en-US/chrome/browser/devtools/inspector.properties +++ b/browser/locales/en-US/chrome/browser/devtools/inspector.properties @@ -33,6 +33,7 @@ nodeMenu.tooltiptext=Node operations inspector.label=Inspector inspector.commandkey=I inspector.accesskey=I +inspector.tooltip=DOM and Style Inspector # LOCALIZATION NOTE (markupView.more.*) # When there are too many nodes to load at once, we will offer to diff --git a/browser/locales/en-US/chrome/browser/devtools/profiler.properties b/browser/locales/en-US/chrome/browser/devtools/profiler.properties index c0254d32a6b..e77dfabd8c2 100644 --- a/browser/locales/en-US/chrome/browser/devtools/profiler.properties +++ b/browser/locales/en-US/chrome/browser/devtools/profiler.properties @@ -13,4 +13,9 @@ # LOCALIZATION NOTE (profiler.label): # This string is displayed in the title of the tab when the profiler is # displayed inside the developer tools window and in the Developer Tools Menu. -profiler.label=Profiler \ No newline at end of file +profiler.label=Profiler + +# LOCALIZATION NOTE (profiler.tooltip): +# This string is displayed in the tooltip of the tab when the profiler is +# displayed inside the developer tools window. +profiler.tooltip=Profiler diff --git a/browser/locales/en-US/chrome/browser/devtools/styleeditor.properties b/browser/locales/en-US/chrome/browser/devtools/styleeditor.properties index dca0bc6d81c..6ae596ca8e4 100644 --- a/browser/locales/en-US/chrome/browser/devtools/styleeditor.properties +++ b/browser/locales/en-US/chrome/browser/devtools/styleeditor.properties @@ -78,3 +78,8 @@ redo.commandkey=Z # This string is displayed in the title of the tab when the debugger is # displayed inside the developer tools window and in the Developer Tools Menu. ToolboxStyleEditor.label=Style Editor + +# LOCALIZATION NOTE (ToolboxStyleEditor.tooltip): +# This string is displayed in the tooltip of the tab when the debugger is +# displayed inside the developer tools window. +ToolboxStyleEditor.tooltip=CSS Stylesheets Editor diff --git a/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd b/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd index 29b63269353..b8fb9eccf0c 100644 --- a/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd +++ b/browser/locales/en-US/chrome/browser/devtools/toolbox.dtd @@ -5,3 +5,5 @@ + + \ No newline at end of file diff --git a/browser/locales/en-US/chrome/browser/devtools/toolbox.properties b/browser/locales/en-US/chrome/browser/devtools/toolbox.properties new file mode 100644 index 00000000000..74f672b7295 --- /dev/null +++ b/browser/locales/en-US/chrome/browser/devtools/toolbox.properties @@ -0,0 +1,3 @@ +toolboxDockButtons.bottom.tooltip=Dock to bottom of browser window +toolboxDockButtons.side.tooltip=Dock to side of browser window +toolboxDockButtons.window.tooltip=Show in separate window diff --git a/browser/locales/en-US/chrome/browser/devtools/webconsole.properties b/browser/locales/en-US/chrome/browser/devtools/webconsole.properties index 75784473847..1f8e1ad41d2 100644 --- a/browser/locales/en-US/chrome/browser/devtools/webconsole.properties +++ b/browser/locales/en-US/chrome/browser/devtools/webconsole.properties @@ -174,6 +174,11 @@ listTabs.globalConsoleActor=*Global Console* # as webConsoleWindowTitleAndURL before the '-' ToolboxWebconsole.label=Web Console +# LOCALIZATION NOTE (ToolboxWebconsole.tooltip): +# This string is displayed in the tooltip of the tab when the web console is +# displayed inside the developer tools window. +ToolboxWebconsole.tooltip=Web Console + # LOCALIZATION NOTE (longStringEllipsis): The string displayed after a long # string. This string is clickable such that the rest of the string is retrieved # from the server.