Bug 277296 - The print dialogs have no accesskeys; r=gavin, a191=beltzner
authorVlado Valastiak
Fri, 28 Nov 2008 22:07:51 +0100
changeset 22104 1551ebc4dbaa3a01459ec7ba6e2b42e7472430c4
parent 22103 b6f450bbbcd83f30067de46017c447eb39375262
child 22105 356e3865c629263d172eaad3d8b548355301bd74
push idunknown
push userunknown
push dateunknown
reviewersgavin
bugs277296
milestone1.9.1b3pre
Bug 277296 - The print dialogs have no accesskeys; r=gavin, a191=beltzner
toolkit/components/printing/content/printPageSetup.xul
toolkit/components/printing/content/printdialog.xul
toolkit/components/printing/content/printjoboptions.xul
toolkit/locales/en-US/chrome/global/printPageSetup.dtd
toolkit/locales/en-US/chrome/global/printdialog.dtd
toolkit/locales/en-US/chrome/global/printjoboptions.dtd
--- a/toolkit/components/printing/content/printPageSetup.xul
+++ b/toolkit/components/printing/content/printPageSetup.xul
@@ -73,56 +73,72 @@
       <vbox>
         <groupbox>
           <caption label="&formatGroup.label;"/>
           <vbox>
             <hbox align="center">
               <label control="orientation" value="&orientation.label;"/>
               <radiogroup id="orientation" oncommand="setOrientation()">
                 <hbox align="center">
-                  <radio id="portrait"  class="portrait-page"  label="&portrait;"/>
-                  <radio id="landscape" class="landscape-page" label="&landscape;"/>
+                  <radio id="portrait"
+                         class="portrait-page"
+                         label="&portrait.label;"
+                         accesskey="&portrait.accesskey;"/>
+                  <radio id="landscape"
+                         class="landscape-page"
+                         label="&landscape.label;"
+                         accesskey="&landscape.accesskey;"/>
                 </hbox>
               </radiogroup>
             </hbox>
             <separator/>
             <hbox align="center">
-              <label control="scalingInput" value="&scale.label;"/>
+              <label control="scalingInput"
+                     value="&scale.label;"
+                     accesskey="&scale.accesskey;"/>
               <textbox id="scalingInput" size="4" oninput="checkDouble(this)"/>
               <label value="&scalePercent;"/>
               <separator/>
-              <checkbox id="shrinkToFit" label="&shrinkToFit.label;"
+              <checkbox id="shrinkToFit"
+                        label="&shrinkToFit.label;"
+                        accesskey="&shrinkToFit.accesskey;"
                         oncommand="gDialog.scalingInput.disabled=gDialog.scalingLabel.disabled=this.checked"/>
             </hbox>
           </vbox>
         </groupbox>
         <groupbox>
           <caption label="&optionsGroup.label;"/>
-          <checkbox id="printBG" label="&printBG.label;"/>
+          <checkbox id="printBG"
+                    label="&printBG.label;"
+                    accesskey="&printBG.accesskey;"/>
         </groupbox>
       </vbox>
       <vbox>
         <groupbox>
           <caption id="marginGroup" label="&marginGroup.label;"/>
           <vbox>
             <hbox align="center">
               <spacer flex="1"/>
-              <label control="topInput" value="&marginTop.label;"/>
+              <label control="topInput"
+                     value="&marginTop.label;"
+                     accesskey="&marginTop.accesskey;"/>
               <textbox id="topInput" size="5" oninput="changeMargin(this)"/>
               <!-- This invisible label (with same content as the visible one!) is used
                    to ensure that the <textbox> is centered above the page.  The same
                    technique is deployed for the bottom/left/right input fields, below. -->
               <label value="&marginTop.label;" style="visibility: hidden;"/>
               <spacer flex="1"/>
             </hbox>
             <hbox dir="ltr">
               <spacer flex="1"/>
               <vbox>
                 <spacer flex="1"/>
-                <label control="leftInput" value="&marginLeft.label;"/>
+                <label control="leftInput"
+                       value="&marginLeft.label;"
+                       accesskey="&marginLeft.accesskey;"/>
                 <textbox id="leftInput" size="5" oninput="changeMargin(this)"/>
                 <label value="&marginLeft.label;" style="visibility: hidden;"/>
                 <spacer flex="1"/>
               </vbox>
               <!-- The "margin page" draws a simulated printout page with dashed lines
                    for the margins.  The height/width style attributes of the marginTop,
                    marginBottom, marginLeft, and marginRight elements are set by
                    the JS code dynamically based on the user input. -->
@@ -132,26 +148,30 @@
                   <box id="marginLeft" style="width:0.025in;"/>
                   <box style="border: 1px; border-style: dashed; border-color: gray;" flex="1"/>
                   <box id="marginRight" style="width:0.025in;"/>
                 </hbox>
                 <box id="marginBottom" style="height:0.05in;"/>
               </vbox>
               <vbox>
                 <spacer flex="1"/>
-                <label control="rightInput" value="&marginRight.label;"/>
+                <label control="rightInput"
+                       value="&marginRight.label;"
+                       accesskey="&marginRight.accesskey;"/>
                 <textbox id="rightInput" size="5" oninput="changeMargin(this)"/>
                 <label value="&marginRight.label;" style="visibility: hidden;"/>
                 <spacer flex="1"/>
               </vbox>
               <spacer flex="1"/>
             </hbox>
             <hbox align="center">
               <spacer flex="1"/>
-              <label control="bottomInput" value="&marginBottom.label;"/>
+              <label control="bottomInput"
+                     value="&marginBottom.label;"
+                     accesskey="&marginBottom.accesskey;"/>
               <textbox id="bottomInput" size="5" oninput="changeMargin(this)"/>
               <label value="&marginBottom.label;" style="visibility: hidden;"/>
               <spacer flex="1"/>
             </hbox>
           </vbox>
         </groupbox>
         <groupbox>
           <caption id="headersAndFooters" label="&headerFooter.label;"/>
--- a/toolkit/components/printing/content/printdialog.xul
+++ b/toolkit/components/printing/content/printdialog.xul
@@ -66,65 +66,98 @@
         <column/>
         <column flex="1"/>
         <column/>
       </columns>
 
       <rows>
         <row align="center">
           <hbox align="center" pack="end">
-            <label id="printerLabel" control="printerList" value="&printerInput.label;"/>
+            <label id="printerLabel"
+                   value="&printerInput.label;"
+                   accesskey="&printerInput.accesskey;"
+                   control="printerList"/>
           </hbox>
           <menulist id="printerList" flex="1" type="description" oncommand="setPrinterDefaultsForSelectedPrinter();"/>
-          <button id="properties" label="&propertiesButton.label;"
-                  icon="properties" oncommand="displayPropertiesDialog();"/>
+          <button id="properties"
+                  label="&propertiesButton.label;"
+                  accesskey="&propertiesButton.accesskey;"
+                  icon="properties"
+                  oncommand="displayPropertiesDialog();"/>
         </row>
         <row align="center">
           <hbox align="center" pack="end">
             <label id="descTextLabel" control="descText" value="&descText.label;"/>
           </hbox>
           <label id="descText"/>
-          <checkbox id="fileCheck" checked="false" label="&fileCheck.label;" pack="end"/>
+          <checkbox id="fileCheck"
+                    checked="false"
+                    label="&fileCheck.label;"
+                    accesskey="&fileCheck.accesskey;"
+                    pack="end"/>
         </row>
       </rows>
     </grid>
   </groupbox>
 
   <hbox>
     <groupbox flex="1">
       <caption label="&printrangeGroup.label;"/>
 
       <radiogroup id="printrangeGroup">
-        <radio id="allpagesRadio" label="&allpagesRadio.label;" oncommand="doPrintRange(0)"/>
+        <radio id="allpagesRadio"
+               label="&allpagesRadio.label;"
+               accesskey="&allpagesRadio.accesskey;"
+               oncommand="doPrintRange(0)"/>
         <hbox align="center">
-          <radio id="rangeRadio" label="&rangeRadio.label;" oncommand="doPrintRange(1)"/>
-          <label id="frompageLabel" control="frompageInput" value="&frompageInput.label;" />
+          <radio id="rangeRadio"
+                 label="&rangeRadio.label;"
+                 accesskey="&rangeRadio.accesskey;"
+                 oncommand="doPrintRange(1)"/>
+          <label id="frompageLabel"
+                 control="frompageInput"
+                 value="&frompageInput.label;"
+                 accesskey="&frompageInput.accesskey;"/>
           <textbox id="frompageInput" style="width:5em;" onkeyup="checkInteger(this)"/>
-          <label id="topageLabel" control="topageInput" value="&topageInput.label;" />
+          <label id="topageLabel"
+                 control="topageInput"
+                 value="&topageInput.label;"
+                 accesskey="&topageInput.accesskey;"/>
           <textbox id="topageInput" style="width:5em;" onkeyup="checkInteger(this)"/>
         </hbox>
-        <radio id="selectionRadio" label="&selectionRadio.label;" oncommand="doPrintRange(2)"/>
+        <radio id="selectionRadio"
+               label="&selectionRadio.label;"
+               accesskey="&selectionRadio.accesskey;"
+               oncommand="doPrintRange(2)"/>
       </radiogroup>
     </groupbox>
 
     <groupbox flex="1">
       <caption label="&copies.label;"/>
       <hbox align="center">
-        <label control="numCopiesInput" value="&numCopies.label;"/>  
+        <label control="numCopiesInput"
+               value="&numCopies.label;"
+               accesskey="&numCopies.accesskey;"/>
         <textbox id="numCopiesInput" style="width:5em;" onkeyup="checkInteger(this)"/>
       </hbox>
     </groupbox>
   </hbox>
 
   <groupbox flex="1">
     <caption label="&printframeGroup.label;" id="printframeGroupLabel"/>
     <radiogroup id="printframeGroup">
-      <radio id="aslaidoutRadio" label="&aslaidoutRadio.label;" />
-      <radio id="selectedframeRadio" label="&selectedframeRadio.label;" />
-      <radio id="eachframesepRadio" label="&eachframesepRadio.label;" />
+      <radio id="aslaidoutRadio"
+             label="&aslaidoutRadio.label;"
+             accesskey="&aslaidoutRadio.accesskey;"/>
+      <radio id="selectedframeRadio"
+             label="&selectedframeRadio.label;"
+             accesskey="&selectedframeRadio.accesskey;"/>
+      <radio id="eachframesepRadio"
+             label="&eachframesepRadio.label;"
+             accesskey="&eachframesepRadio.accesskey;"/>
     </radiogroup>
   </groupbox>
 
   <!-- used to store titles and labels -->
   <data style="display:none;" id="printButton" label="&printButton.label;"/>
   <data style="display:none;" id="fpDialog" label="&fpDialog.title;"/>
 
 </dialog>
--- a/toolkit/components/printing/content/printjoboptions.xul
+++ b/toolkit/components/printing/content/printjoboptions.xul
@@ -59,104 +59,140 @@
     <columns>
       <column/>
       <column flex="1"/>
     </columns>
 
     <rows>
       <row id="jobTitleGroup">
         <hbox align="center" pack="end">
-          <label id="jobTitleLabel" control="jobTitleInput" value="&jobTitleInput.label;"/>
+          <label id="jobTitleLabel"
+                 value="&jobTitleInput.label;"
+                 accesskey="&jobTitleInput.accesskey;"
+                 control="jobTitleInput"/>
         </hbox>
         <textbox id="jobTitleInput" flex="1"/>
       </row>
 
       <row id="paperGroup">
         <hbox align="center" pack="end">
-          <label id="paperLabel" control="paperList" value="&paperInput.label;"/>
+          <label id="paperLabel"
+                 value="&paperInput.label;"
+                 accesskey="&paperInput.accesskey;"
+                 control="paperList"/>
         </hbox>
         <menulist id="paperList" flex="1">
           <menupopup/>
         </menulist>
       </row>
 
       <row id="plexGroup">
         <hbox align="center" pack="end">
-          <label id="plexLabel" control="plexList" value="&plexInput.label;"/>
+          <label id="plexLabel"
+                 value="&plexInput.label;"
+                 accesskey="&plexInput.accesskey;"
+                 control="plexList"/>
         </hbox>
         <menulist id="plexList" flex="1">
           <menupopup/>
         </menulist>
       </row>
 
       <row id="resolutionGroup">
         <hbox align="center" pack="end">
-          <label id="resolutionLabel" control="resolutionList" value="&resolutionInput.label;"/>
+          <label id="resolutionLabel"
+                 value="&resolutionInput.label;"
+                 accesskey="&resolutionInput.accesskey;"
+                 control="resolutionList"/>
         </hbox>
         <menulist id="resolutionList" flex="1">
           <menupopup/>
         </menulist>
       </row>
 
       <row id="colorspaceGroup">
         <hbox align="center" pack="end">
-          <label id="colorspaceLabel" control="colorspaceList" value="&colorspaceInput.label;"/>
+          <label id="colorspaceLabel"
+                 value="&colorspaceInput.label;"
+                 accesskey="&colorspaceInput.accesskey;"
+                 control="colorspaceList"/>
         </hbox>
         <menulist id="colorspaceList" flex="1">
           <menupopup/>
         </menulist>
       </row>
 
       <row id="cmdGroup">
-        <label id="cmdLabel" control="cmdInput" value="&cmdInput.label;"/>
+        <label id="cmdLabel"
+               value="&cmdInput.label;"
+               accesskey="&cmdInput.accesskey;"
+               control="cmdInput"/>
         <textbox id="cmdInput" flex="1"/>
       </row>
 
       <row id="colorGroup">
         <hbox align="center" pack="end">
           <label control="colorRadioGroup" value="&colorGroup.label;"/>
         </hbox>
         <radiogroup id="colorRadioGroup" orient="horizontal">
-          <radio id="grayRadio" label="&grayRadio.label;"/>
-          <radio id="colorRadio" label="&colorRadio.label;"/>
+          <radio id="grayRadio"
+                 label="&grayRadio.label;"
+                 accesskey="&grayRadio.accesskey;"/>
+          <radio id="colorRadio"
+                 label="&colorRadio.label;"
+                 accesskey="&colorRadio.accesskey;"/>
         </radiogroup>
       </row>
 
       <row id="fontsGroup">
         <hbox align="center" pack="end">
-          <label control="downloadFonts" value="&fontsGroup.label;"/>
+          <label value="&fontsGroup.label;"/>
         </hbox>
-        <checkbox id="downloadFonts" label="&downloadFonts.label;" />
+        <checkbox id="downloadFonts"
+                  label="&downloadFonts.label;"
+                  accesskey="&downloadFonts.accesskey;"/>
       </row>
     </rows>
   </grid>
 
   <grid>
     <columns>
       <column/>
     </columns>
     <rows>
       <row>
        <groupbox flex="1">
         <caption label="&edgeMarginInput.label;"/>
         <hbox>
           <hbox align="center">
-            <label id="topLabel" control="topInput" value="&topInput.label;"/>
+            <label id="topLabel"
+                   value="&topInput.label;"
+                   accesskey="&topInput.accesskey;"
+                   control="topInput"/>
             <textbox id="topInput" style="width:5em;" onkeyup="checkDouble(this, 0.5)"/>
           </hbox>
           <hbox align="center">
-            <label id="bottomLabel" control="bottomInput" value="&bottomInput.label;"/>
+            <label id="bottomLabel"
+                   value="&bottomInput.label;"
+                   accesskey="&bottomInput.accesskey;"
+                   control="bottomInput"/>
             <textbox id="bottomInput" style="width:5em;" onkeyup="checkDouble(this, 0.5)"/>
           </hbox>
           <hbox align="center">
-            <label id="leftLabel" control="leftInput" value="&leftInput.label;"/>
+            <label id="leftLabel"
+                   value="&leftInput.label;"
+                   accesskey="&leftInput.accesskey;"
+                   control="leftInput"/>
             <textbox id="leftInput" style="width:5em;" onkeyup="checkDouble(this, 0.5)"/>
           </hbox>
           <hbox align="center">
-            <label id="rightLabel" control="rightInput" value="&rightInput.label;"/>
+            <label id="rightLabel"
+                   value="&rightInput.label;"
+                   accesskey="&rightInput.accesskey;"
+                   control="rightInput"/>
             <textbox id="rightInput" style="width:5em;" onkeyup="checkDouble(this, 0.5)"/>
           </hbox>
         </hbox>
         </groupbox>
       </row>
 
     </rows>
   </grid>
--- a/toolkit/locales/en-US/chrome/global/printPageSetup.dtd
+++ b/toolkit/locales/en-US/chrome/global/printPageSetup.dtd
@@ -2,37 +2,46 @@
 
 <!ENTITY printSetup.title    "Page Setup">
 
 <!ENTITY basic.tab           "Format &amp; Options">
 
 <!ENTITY formatGroup.label   "Format">
 
 <!ENTITY orientation.label   "Orientation:">
-<!ENTITY portrait            "Portrait">
-<!ENTITY landscape           "Landscape">
+<!ENTITY portrait.label      "Portrait">
+<!ENTITY portrait.accesskey  "P">
+<!ENTITY landscape.label     "Landscape">
+<!ENTITY landscape.accesskey "L">
 
 <!ENTITY scale.label         "Scale:">
+<!ENTITY scale.accesskey     "S">
 <!ENTITY scalePercent        "&#037;">
 
-<!ENTITY shrinkToFit.label   "Shrink To Fit Page Width">
+<!ENTITY shrinkToFit.label   "Shrink to fit Page Width">
+<!ENTITY shrinkToFit.accesskey "W">
 
 <!ENTITY optionsGroup.label  "Options">
 
 <!ENTITY printBG.label       "Print Background (colors &amp; images)">
+<!ENTITY printBG.accesskey   "B">
 
 <!ENTITY advanced.tab        "Margins &amp; Header/Footer">
 
 <!ENTITY marginGroup.label   "Margins (#1)">
 <!ENTITY marginUnits.inches  "inches">
 <!ENTITY marginUnits.metric  "millimeters">
 <!ENTITY marginTop.label     "Top:">
+<!ENTITY marginTop.accesskey "T">
 <!ENTITY marginBottom.label  "Bottom:">
+<!ENTITY marginBottom.accesskey "B">
 <!ENTITY marginLeft.label    "Left:">
+<!ENTITY marginLeft.accesskey "L">
 <!ENTITY marginRight.label   "Right:">
+<!ENTITY marginRight.accesskey "R">
 
 <!ENTITY headerFooter.label  "Headers &amp; Footers">
 
 <!ENTITY hfLeft.label        "Left:">
 <!ENTITY hfCenter.label      "Center:">
 <!ENTITY hfRight.label       "Right:">
 <!ENTITY headerLeft.tip      "Left header">
 <!ENTITY headerCenter.tip    "Center header">
--- a/toolkit/locales/en-US/chrome/global/printdialog.dtd
+++ b/toolkit/locales/en-US/chrome/global/printdialog.dtd
@@ -2,27 +2,39 @@
 
 <!ENTITY printButton.label "Print">
 
 <!ENTITY printDialog.title "Print">
 
 <!ENTITY fpDialog.title "Save File">
 
 <!ENTITY fileCheck.label "Print to File">
+<!ENTITY fileCheck.accesskey "F">
 <!ENTITY propertiesButton.label "Properties…">
+<!ENTITY propertiesButton.accesskey "o">
 <!ENTITY descText.label "Printer Description:">
 <!ENTITY printer.label "Printer">
 <!ENTITY printerInput.label "Printer Name:">
+<!ENTITY printerInput.accesskey "N">
 
 <!ENTITY printrangeGroup.label "Print Range">
 <!ENTITY allpagesRadio.label "All Pages">
+<!ENTITY allpagesRadio.accesskey "A">
 <!ENTITY rangeRadio.label  "Pages">
+<!ENTITY rangeRadio.accesskey  "P">
 <!ENTITY frompageInput.label  "from">
+<!ENTITY frompageInput.accesskey  "r">
 <!ENTITY topageInput.label  "to">
+<!ENTITY topageInput.accesskey  "t">
 <!ENTITY selectionRadio.label "Selection">
+<!ENTITY selectionRadio.accesskey "S">
 
 <!ENTITY copies.label "Copies">
 <!ENTITY numCopies.label "Number of copies:">
+<!ENTITY numCopies.accesskey "c">
 
 <!ENTITY printframeGroup.label "Print Frames">
 <!ENTITY aslaidoutRadio.label "As laid out on the screen">
+<!ENTITY aslaidoutRadio.accesskey "u">
 <!ENTITY selectedframeRadio.label  "The selected frame">
+<!ENTITY selectedframeRadio.accesskey  "m">
 <!ENTITY eachframesepRadio.label  "Each frame separately">
+<!ENTITY eachframesepRadio.accesskey  "E">
--- a/toolkit/locales/en-US/chrome/global/printjoboptions.dtd
+++ b/toolkit/locales/en-US/chrome/global/printjoboptions.dtd
@@ -1,28 +1,41 @@
 <!-- extracted from printjoboptions.xul -->
 
 <!ENTITY printJobOptions.title "Printer Properties">
 
 <!ENTITY paperInput.label "Paper Size:">
+<!ENTITY paperInput.accesskey "P">
 
 <!ENTITY plexInput.label "Plex mode:">
+<!ENTITY plexInput.accesskey "m">
 
 <!ENTITY resolutionInput.label "Resolution/Quality:">
+<!ENTITY resolutionInput.accesskey "e">
 
 <!ENTITY cmdInput.label "Print Command:">
+<!ENTITY cmdInput.accesskey "o">
 
 <!ENTITY jobTitleInput.label "Job Title:">
+<!ENTITY jobTitleInput.accesskey "J">
 
 <!ENTITY colorGroup.label "Color:">
-<!ENTITY grayRadio.label "GrayScale">
+<!ENTITY grayRadio.label "Grayscale">
+<!ENTITY grayRadio.accesskey "G">
 <!ENTITY colorRadio.label "Color">
+<!ENTITY colorRadio.accesskey "C">
 
 <!ENTITY colorspaceInput.label "Colorspace:">
+<!ENTITY colorspaceInput.accesskey "s">
 
 <!ENTITY fontsGroup.label "Fonts:">
-<!ENTITY downloadFonts.label "Download fonts to printer?">
+<!ENTITY downloadFonts.label "Download fonts to printer">
+<!ENTITY downloadFonts.accesskey "D">
 
 <!ENTITY edgeMarginInput.label "Gap from edge of paper to Margin">
 <!ENTITY topInput.label "Top:">
+<!ENTITY topInput.accesskey "T">
 <!ENTITY bottomInput.label "Bottom:">
+<!ENTITY bottomInput.accesskey "B">
 <!ENTITY leftInput.label "Left:">
+<!ENTITY leftInput.accesskey "L">
 <!ENTITY rightInput.label "Right:">
+<!ENTITY rightInput.accesskey "R">