Bug 639578 - Reorder context menu items to be consistent with Firefox's r=sid0 ui-r=clarkbw
authorJonathan Protzenko <jonathan.protzenko@gmail.com>
Wed, 09 Mar 2011 22:58:54 +0100
changeset 7293 06cf8a4770ac5397f91dbb2a3915247b2851984a
parent 7292 34dc4195f5fd2fb8b77b7fb4ba326996e9c216ff
child 7294 675814419cd87399d0a12a1568cdb9f49a7e1249
push idunknown
push userunknown
push dateunknown
reviewerssid0, clarkbw
bugs639578
Bug 639578 - Reorder context menu items to be consistent with Firefox's r=sid0 ui-r=clarkbw The order of context menu items, esp. after I added the spellcheck items, was somehow chaotic. This patch makes it more consistent, mainly by copying the order from Firefox, adding extra separators, etc.
mail/base/content/mailWindowOverlay.xul
mail/base/content/nsContextMenu.js
--- a/mail/base/content/mailWindowOverlay.xul
+++ b/mail/base/content/mailWindowOverlay.xul
@@ -541,16 +541,27 @@
   <!-- Common keys for the base menu overlay -->
   <keyset id="baseMenuKeyset"/>
 </keyset>
 
   <!-- "Please keep all items and separators up to date in nsContextMenu.js when making changes here" -->
   <menupopup id="mailContext"
              onpopupshowing="return fillMailContextMenu(event);"
              onpopuphiding="mailContextOnPopupHiding(event);">
+
+    <!-- Spellchecking suggestions -->
+    <menuitem id="mailContext-spell-no-suggestions"
+              disabled="true"
+              label="&spellNoSuggestions.label;"/>
+    <menuitem id="mailContext-spell-add-to-dictionary"
+              label="&spellAddToDictionary.label;"
+              accesskey="&spellAddToDictionary.accesskey;"
+              oncommand="gSpellChecker.addToDictionary();"/>
+    <menuseparator id="mailContext-spell-suggestions-separator"/>
+
     <menuitem id="mailContext-openInBrowser"
               label="&openInBrowser.label;"
               accesskey="&openInBrowser.accesskey;"
               oncommand="gContextMenu.openInBrowser();"/>
     <menuitem id="mailContext-openLinkInBrowser"
               label="&openLinkInBrowser.label;"
               accesskey="&openLinkInBrowser.accesskey;"
               oncommand="gContextMenu.openLinkInBrowser();"/>
@@ -563,32 +574,58 @@
               label="&stopCmd.label;"
               accesskey="&stopCmd.accesskey;"
               command="cmd_stop"/>
     <menuseparator id="mailContext-sep-link"/>
     <menuitem id="mailContext-undo"
               label="&undoDefaultCmd.label;"
               accesskey="&undoDefaultCmd.accesskey;"
               command="cmd_undo"/>
-    <menuitem id="mailContext-selectall"
-              label="&selectAllCmd.label;"
-              accesskey="&selectAllCmd.accesskey;"
-              command="cmd_selectAll"/>
+    <menuseparator id="mailContext-sep-undo"/>
     <menuitem id="mailContext-cut"
               label="&cutCmd.label;"
               accesskey="&cutCmd.accesskey;"
               command="cmd_copy"/>
     <menuitem id="mailContext-copy"
               label="&copyCmd.label;"
               accesskey="&copyCmd.accesskey;"
               command="cmd_copy"/>
     <menuitem id="mailContext-paste"
               label="&pasteCmd.label;"
               accesskey="&pasteCmd.accesskey;"
               command="cmd_paste"/>
+    <menuseparator id="mailContext-sep-clipboard"/>
+    <menuitem id="mailContext-selectall"
+              label="&selectAllCmd.label;"
+              accesskey="&selectAllCmd.accesskey;"
+              command="cmd_selectAll"/>
+
+    <!-- Spellchecking general menu items (enable, add dictionaries...) -->
+    <menuseparator id="mailContext-spell-separator"/>
+    <menuitem id="mailContext-spell-check-enabled"
+              label="&spellCheckEnable.label;"
+              type="checkbox"
+              accesskey="&spellCheckEnable.accesskey;"
+              oncommand="gSpellChecker.toggleEnabled();"/>
+    <menuitem id="mailContext-spell-add-dictionaries-main"
+              label="&spellAddDictionaries.label;"
+              accesskey="&spellAddDictionaries.accesskey;"
+              oncommand="gContextMenu.addDictionaries();"/>
+    <menu id="mailContext-spell-dictionaries"
+          label="&spellDictionaries.label;"
+          accesskey="&spellDictionaries.accesskey;">
+        <menupopup id="mailContext-spell-dictionaries-menu">
+            <menuseparator id="mailContext-spell-language-separator"/>
+            <menuitem id="mailContext-spell-add-dictionaries"
+                      label="&spellAddDictionaries.label;"
+                      accesskey="&spellAddDictionaries.accesskey;"
+                      oncommand="gContextMenu.addDictionaries();"/>
+        </menupopup>
+    </menu>
+
     <menuseparator id="mailContext-sep-open"/>
     <menuitem id="mailContext-media-play"
               label="&contextPlay.label;"
               accesskey="&contextPlay.accesskey;"
               oncommand="gContextMenu.mediaCommand('play');"/>
     <menuitem id="mailContext-media-pause"
               label="&contextPause.label;"
               accesskey="&contextPause.accesskey;"
@@ -795,47 +832,16 @@
               accesskey="&saveImageAsCmd.accesskey;"
               oncommand="gContextMenu.saveImage();"/>
     <menuseparator id="mailContext-sep-reportPhishing"/>
     <menuitem id="mailContext-reportPhishingURL"
               label="&reportPhishingURL.label;"
               accesskey="&reportPhishingURL.accesskey;"
               oncommand="gPhishingDetector.reportPhishingURL(gContextMenu.linkURL);"/>
 
-    <!-- Spellchecking menu items -->
-    <menuseparator id="mailContext-spell-suggestions-separator"/>
-    <menuitem id="mailContext-spell-no-suggestions"
-              disabled="true"
-              label="&spellNoSuggestions.label;"/>
-    <menuitem id="mailContext-spell-add-to-dictionary"
-              label="&spellAddToDictionary.label;"
-              accesskey="&spellAddToDictionary.accesskey;"
-              oncommand="gSpellChecker.addToDictionary();"/>
-    <menuseparator id="mailContext-spell-separator"/>
-    <menuitem id="mailContext-spell-check-enabled"
-              label="&spellCheckEnable.label;"
-              type="checkbox"
-              accesskey="&spellCheckEnable.accesskey;"
-              oncommand="gSpellChecker.toggleEnabled();"/>
-    <menuitem id="mailContext-spell-add-dictionaries-main"
-              label="&spellAddDictionaries.label;"
-              accesskey="&spellAddDictionaries.accesskey;"
-              oncommand="gContextMenu.addDictionaries();"/>
-    <menu id="mailContext-spell-dictionaries"
-          label="&spellDictionaries.label;"
-          accesskey="&spellDictionaries.accesskey;">
-        <menupopup id="mailContext-spell-dictionaries-menu">
-            <menuseparator id="mailContext-spell-language-separator"/>
-            <menuitem id="mailContext-spell-add-dictionaries"
-                      label="&spellAddDictionaries.label;"
-                      accesskey="&spellAddDictionaries.accesskey;"
-                      oncommand="gContextMenu.addDictionaries();"/>
-        </menupopup>
-    </menu>
-
   </menupopup>
 
   <menupopup id="folderPaneContext"
              onpopupshowing="return fillFolderPaneContextMenu();"
              onpopuphiding="if (event.target == this) folderPaneOnPopupHiding();">
     <menuitem id="folderPaneContext-getMessages"
               label="&folderContextGetMessages.label;"
               accesskey="&folderContextGetMessages.accesskey;"
--- a/mail/base/content/nsContextMenu.js
+++ b/mail/base/content/nsContextMenu.js
@@ -343,16 +343,17 @@ nsContextMenu.prototype = {
     const mailContextSeparators = [
       "mailContext-sep-open-browser", "mailContext-sep-link",
       "mailContext-sep-open", "mailContext-sep-open2",
       "mailContext-sep-reply", "paneContext-afterMove",
       "mailContext-sep-afterTagAddNew", "mailContext-sep-afterTagRemoveAll",
       "mailContext-sep-afterMarkAllRead", "mailContext-sep-afterMarkFlagged",
       "mailContext-sep-afterMarkMenu", "mailContext-sep-edit",
       "mailContext-sep-copy", "mailContext-sep-reportPhishing",
+      "mailContext-sep-undo", "mailContext-sep-clipboard",
       "mailContext-spell-suggestions-separator", "mailContext-spell-separator",
     ];
     mailContextSeparators.forEach(this.hideIfAppropriate, this);
 
     this.checkLastSeparator(this.menu);
   },
 
   /**