Bug 730898 - Reuse editMenuKeys in scratchpad.xul, r=msucan
authorMark Capella <markcapella@twcny.rr.com>
Sun, 11 Mar 2012 11:47:01 +0200
changeset 88526 82531ecd89f17827b669017836555f9b6420cf22
parent 88525 fef8ed335cd28a9a4295b89a3cd1624dbd2e04e3
child 88527 310226a5234ab7098ec646c61dc0b26db9c78c44
push id590
push usermihai.sucan@gmail.com
push dateSun, 11 Mar 2012 10:13:09 +0000
treeherderfx-team@28cf4b50717c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmsucan
bugs730898
milestone13.0a1
Bug 730898 - Reuse editMenuKeys in scratchpad.xul, r=msucan
browser/devtools/scratchpad/scratchpad.xul
browser/devtools/sourceeditor/source-editor-overlay.xul
browser/locales/en-US/chrome/browser/devtools/scratchpad.dtd
browser/locales/en-US/chrome/browser/devtools/sourceeditor.dtd
--- a/browser/devtools/scratchpad/scratchpad.xul
+++ b/browser/devtools/scratchpad/scratchpad.xul
@@ -79,16 +79,17 @@
   <command id="sp-cmd-contentContext" oncommand="Scratchpad.setContentContext();"/>
   <command id="sp-cmd-browserContext" oncommand="Scratchpad.setBrowserContext();" disabled="true"/>
   <command id="sp-cmd-resetContext" oncommand="Scratchpad.resetContext();"/>
   <command id="sp-cmd-errorConsole" oncommand="Scratchpad.openErrorConsole();" disabled="true"/>
   <command id="sp-cmd-webConsole" oncommand="Scratchpad.openWebConsole();"/>
   <command id="sp-cmd-documentationLink" oncommand="Scratchpad.openDocumentationPage();"/>
 </commandset>
 
+<keyset id="editMenuKeys"/>
 <keyset id="sourceEditorKeys"/>
 
 <keyset id="sp-keyset">
   <key id="sp-key-window"
        key="&newWindowCmd.commandkey;"
        command="sp-cmd-newWindow"
        modifiers="accel"/>
   <key id="sp-key-open"
@@ -106,31 +107,16 @@
 
   <!-- TODO: bug 650340 - implement printFile
   <key id="sp-key-printFile"
        key="&printCmd.commandkey;"
        command="sp-cmd-printFile"
        modifiers="accel"/>
   -->
 
-  <key id="key_cut"
-       key="&cutCmd.key;"
-       modifiers="accel"/>
-
-  <key id="key_copy"
-       key="&copyCmd.key;"
-       modifiers="accel"/>
-  <key id="key_paste"
-       key="&pasteCmd.key;"
-       modifiers="accel"/>
-  <key id="key_selectAll" key="&selectAllCmd.key;" modifiers="accel"/>
-  <key id="key_undo" key="&undoCmd.key;" modifiers="accel"
-       command="se-cmd-undo"/>
-  <key id="key_redo" key="&undoCmd.key;" modifiers="accel,shift"
-       command="se-cmd-redo"/>
   <key id="sp-key-run"
        key="&run.key;"
        command="sp-cmd-run"
        modifiers="accel"/>
   <key id="sp-key-inspect"
        key="&inspect.key;"
        command="sp-cmd-inspect"
        modifiers="accel"/>
@@ -141,38 +127,16 @@
   <key id="sp-key-errorConsole"
        key="&errorConsoleCmd.commandkey;"
        command="sp-cmd-errorConsole"
        modifiers="accel,shift"/>
   <key id="sp-key-webConsole"
        key="&webConsoleCmd.commandkey;"
        command="sp-cmd-webConsole"
        modifiers="accel,shift"/>
-  <key id="key_find"
-       key="&findCmd.key;"
-       command="cmd_find"
-       modifiers="accel"/>
-#ifdef XP_MACOSX
-  <key id="key_findAgain"
-       key="&findAgainCmd.key;"
-       command="cmd_findAgain"
-       modifiers="accel"/>
-  <key id="key_findPrevious"
-       key="&findPreviousCmd.key;"
-       command="cmd_findPrevious"
-       modifiers="accel,shift"/>
-#else
-  <key id="key_findAgain"
-       keycode="VK_F3"
-       command="cmd_findAgain"/>
-  <key id="key_findPrevious"
-       keycode="VK_F3"
-       command="cmd_findPrevious"
-       modifiers="shift"/>
-#endif
   <key id="key_openHelp"
        keycode="VK_F1"
        command="sp-cmd-documentationLink"/>
 </keyset>
 
 
 <menubar id="sp-menubar">
   <menu id="sp-file-menu" label="&fileMenu.label;"
@@ -217,57 +181,33 @@
   </menu>
 
   <menu id="sp-edit-menu" label="&editMenu.label;"
         accesskey="&editMenu.accesskey;">
     <menupopup id="sp-menu_editpopup"
                onpopupshowing="goUpdateGlobalEditMenuItems()">
       <menuitem id="sp-menu-undo"
                 label="&undoCmd.label;"
-                key="key_undo"
                 accesskey="&undoCmd.accesskey;"
+                key="sp-key-undo"
                 command="se-cmd-undo"/>
       <menuitem id="sp-menu-redo"
                 label="&redoCmd.label;"
-                key="key_redo"
                 accesskey="&redoCmd.accesskey;"
+                key="sp-key-redo"
                 command="se-cmd-redo"/>
       <menuseparator/>
-      <menuitem id="sp-menu-cut"
-                label="&cutCmd.label;"
-                key="key_cut"
-                accesskey="&cutCmd.accesskey;"
-                command="cmd_cut"/>
-      <menuitem id="sp-menu-copy"
-                label="&copyCmd.label;"
-                key="key_copy"
-                accesskey="&copyCmd.accesskey;"
-                command="cmd_copy"/>
-      <menuitem id="sp-menu-paste"
-                label="&pasteCmd.label;"
-                key="key_paste"
-                accesskey="&pasteCmd.accesskey;"
-                command="cmd_paste"/>
+      <menuitem id="menu_cut"/>
+      <menuitem id="menu_copy"/>
+      <menuitem id="menu_paste"/>
       <menuseparator/>
-      <menuitem id="sp-menu-selectAll"
-                label="&selectAllCmd.label;"
-                key="key_selectAll"
-                accesskey="&selectAllCmd.accesskey;"
-                command="cmd_selectAll"/>
+      <menuitem id="menu_selectAll"/>
       <menuseparator/>
-      <menuitem id="sp-menu-find"
-                label="&findCmd.label;"
-                accesskey="&findCmd.accesskey;"
-                key="key_find"
-                command="cmd_find"/>
-      <menuitem id="sp-menu-findAgain"
-                label="&findAgainCmd.label;"
-                accesskey="&findAgainCmd.accesskey;"
-                key="key_findAgain"
-                command="cmd_findAgain"/>
+      <menuitem id="menu_find"/>
+      <menuitem id="menu_findAgain"/>
       <menuseparator/>
       <menuitem id="sp-menu-gotoLine"
                 label="&gotoLineCmd.label;"
                 accesskey="&gotoLineCmd.accesskey;"
                 key="key_gotoLine"
                 command="cmd_gotoLine"/>
     </menupopup>
   </menu>
@@ -334,22 +274,22 @@
                 key="key_openHelp"/>
     </menupopup>
   </menu>
 </menubar>
 
 <popupset id="scratchpad-popups">
   <menupopup id="scratchpad-text-popup"
              onpopupshowing="goUpdateGlobalEditMenuItems()">
-    <menuitem id="menu_cut"/>
-    <menuitem id="menu_copy"/>
-    <menuitem id="menu_paste"/>
-    <menuitem id="menu_delete"/>
+    <menuitem id="cMenu_cut" key="key_cut"/>
+    <menuitem id="cMenu_copy" key="key_copy"/>
+    <menuitem id="cMenu_paste" key="key_paste"/>
+    <menuitem id="cMenu_delete" key="key_delete"/>
     <menuseparator/>
-    <menuitem id="menu_selectAll"/>
+    <menuitem id="cMenu_selectAll" key="key_selectAll"/>
     <menuseparator/>
     <menuitem id="sp-text-run"
               label="&run.label;"
               accesskey="&run.accesskey;"
               key="sp-key-run"
               command="sp-cmd-run"/>
     <menuitem id="sp-text-inspect"
               label="&inspect.label;"
--- a/browser/devtools/sourceeditor/source-editor-overlay.xul
+++ b/browser/devtools/sourceeditor/source-editor-overlay.xul
@@ -48,16 +48,25 @@
     <command id="cmd_findAgain" oncommand="goDoCommand('cmd_findAgain')" disabled="true"/>
     <command id="cmd_findPrevious" oncommand="goDoCommand('cmd_findPrevious')" disabled="true"/>
     <command id="cmd_gotoLine" oncommand="goDoCommand('cmd_gotoLine')"/>
     <command id="se-cmd-undo" oncommand="goDoCommand('se-cmd-undo')" disabled="true"/>
     <command id="se-cmd-redo" oncommand="goDoCommand('se-cmd-redo')" disabled="true"/>
   </commandset>
 
   <keyset id="sourceEditorKeys">
+    <key id="sp-key-undo" key="&undoCmd.key;"
+         command="se-cmd-undo" modifiers="accel"/>
+#ifdef XP_UNIX
+    <key id="sp-key-redo" key="&undoCmd.key;"
+         command="se-cmd-redo" modifiers="accel,shift"/>
+#else
+    <key id="sp-key-redo" key="&redoCmd.key;"
+         command="se-cmd-redo" modifiers="accel"/>
+#endif
     <key id="key_gotoLine"
          key="&gotoLineCmd.key;"
          command="cmd_gotoLine"
          modifiers="accel"/>
   </keyset>
 
   <menupopup id="sourceEditorContextMenu"
              onpopupshowing="goUpdateGlobalEditMenuItems()">
--- a/browser/locales/en-US/chrome/browser/devtools/scratchpad.dtd
+++ b/browser/locales/en-US/chrome/browser/devtools/scratchpad.dtd
@@ -46,48 +46,16 @@
 <!ENTITY undoCmd.label                "Undo">
 <!ENTITY undoCmd.key                  "Z">
 <!ENTITY undoCmd.accesskey            "U">
 
 <!ENTITY redoCmd.label                "Redo">
 <!ENTITY redoCmd.key                  "Y">
 <!ENTITY redoCmd.accesskey            "R">
 
-<!ENTITY cutCmd.label                 "Cut">
-<!ENTITY cutCmd.key                   "X">
-<!ENTITY cutCmd.accesskey             "t">
-
-<!ENTITY copyCmd.label                "Copy">
-<!ENTITY copyCmd.key                  "C">
-<!ENTITY copyCmd.accesskey            "C">
-
-<!ENTITY pasteCmd.label               "Paste">
-<!ENTITY pasteCmd.key                 "V">
-<!ENTITY pasteCmd.accesskey           "P">
-
-<!ENTITY selectAllCmd.label           "Select All">
-<!ENTITY selectAllCmd.key             "A">
-<!ENTITY selectAllCmd.accesskey       "A">
-
-<!ENTITY findCmd.label                "Find…">
-<!ENTITY findCmd.key                  "F">
-<!ENTITY findCmd.accesskey            "F">
-
-<!ENTITY findAgainCmd.label           "Find Again…">
-<!-- LOCALIZATION NOTE (findAgainCmd.key): This key is used only on Macs.
-  -  Windows and Linux builds use the F3 key which is not localizable on purpose.
-  -->
-<!ENTITY findAgainCmd.key             "G">
-<!ENTITY findAgainCmd.accesskey       "g">
-<!-- LOCALIZATION NOTE (findPreviousCmd.key): This key is used only on Macs.
-  -  Windows and Linux builds use the Shift-F3 key which is not localizable on
-  -  purpose.
-  -->
-<!ENTITY findPreviousCmd.key          "G">
-
 <!ENTITY gotoLineCmd.label            "Jump to line…">
 <!ENTITY gotoLineCmd.key              "J">
 <!ENTITY gotoLineCmd.accesskey        "J">
 
 <!ENTITY run.label                    "Run">
 <!ENTITY run.accesskey                "R">
 <!ENTITY run.key                      "r">
 
--- a/browser/locales/en-US/chrome/browser/devtools/sourceeditor.dtd
+++ b/browser/locales/en-US/chrome/browser/devtools/sourceeditor.dtd
@@ -7,16 +7,20 @@
 <!-- LOCALIZATION NOTE : FILE The correct localization of this file might be to
   - keep it in English, or another language commonly spoken among web developers.
   - You want to make that choice consistent across the developer tools.
   - A good criteria is the language in which you'd find the best
   - documentation on web development on the web. -->
 
 <!ENTITY undoCmd.label             "Undo">
 <!ENTITY undoCmd.accesskey         "U">
+<!ENTITY undoCmd.key               "Z">
+<!ENTITY redoCmd.label             "Redo">
+<!ENTITY redoCmd.accesskey         "R">
+<!ENTITY redoCmd.key               "Y">
 <!ENTITY cutCmd.label              "Cut">
 <!ENTITY cutCmd.accesskey          "t">
 <!ENTITY copyCmd.label             "Copy">
 <!ENTITY copyCmd.accesskey         "C">
 <!ENTITY pasteCmd.label            "Paste">
 <!ENTITY pasteCmd.accesskey        "P">
 <!ENTITY deleteCmd.label           "Delete">
 <!ENTITY deleteCmd.accesskey       "D">