Bug 819929 - [toolbox] Buttons (close, undock and tabs) don't have tooltips, r=jwalker

This commit is contained in:
Girish Sharma 2012-12-18 20:41:27 +05:30
Родитель 8dec630528
Коммит 45e064e121
10 изменённых файлов: 57 добавлений и 3 удалений

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

@ -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) {

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

@ -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;

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

@ -2,6 +2,10 @@
<!-- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
<!DOCTYPE window [
<!ENTITY % toolboxDTD SYSTEM "chrome://browser/locale/devtools/toolbox.dtd" >
%toolboxDTD;
]>
<?xml-stylesheet href="chrome://browser/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/devtools/shared/common.css" type="text/css"?>
<?xml-stylesheet href="chrome://browser/content/devtools/framework/toolbox.css" type="text/css"?>
@ -15,7 +19,9 @@
<toolbar class="devtools-tabbar">
#ifdef XP_MACOSX
<hbox id="toolbox-controls">
<toolbarbutton id="toolbox-close" class="devtools-closebutton"></toolbarbutton>
<toolbarbutton id="toolbox-close"
class="devtools-closebutton"
tooltiptext="&toolboxCloseButton.tooltip;"/>
<hbox id="toolbox-dock-buttons"/>
</hbox>
#endif
@ -25,7 +31,9 @@
#ifndef XP_MACOSX
<hbox id="toolbox-controls">
<hbox id="toolbox-dock-buttons"/>
<toolbarbutton id="toolbox-close" class="devtools-closebutton"></toolbarbutton>
<toolbarbutton id="toolbox-close"
class="devtools-closebutton"
tooltiptext="&toolboxCloseButton.tooltip;"/>
</hbox>
#endif
</toolbar>

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

@ -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

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

@ -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

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

@ -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
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

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

@ -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

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

@ -5,3 +5,5 @@
<!ENTITY window.title "Developer Tools">
<!ENTITY closeCmd.key "W">
<!ENTITY toolboxCloseButton.tooltip "Close Developer Tools">

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

@ -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

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

@ -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.