Bug 426501 ZoomIn/ZoomOut/ZoomReset should have alternative accel keys for localized builds. XUL part: r+ui-r=mconnor, a1.9=beltzner, XBL part: r=enndeakin, sr=neil, a1.9=dsicore
authormasayuki@d-toybox.com
Wed, 23 Apr 2008 01:04:08 -0700
changeset 14611 7f36918e86d47f8dcab6ce2b786002488bb84fdd
parent 14610 ab2b23999d09f75e9773725720b0fa2520a8cbed
child 14612 5637d069f9f662cdb70efd5c637cedfecb928f40
push idunknown
push userunknown
push dateunknown
reviewersenndeakin, neil
bugs426501
milestone1.9pre
Bug 426501 ZoomIn/ZoomOut/ZoomReset should have alternative accel keys for localized builds. XUL part: r+ui-r=mconnor, a1.9=beltzner, XBL part: r=enndeakin, sr=neil, a1.9=dsicore
browser/base/content/browser-sets.inc
content/xbl/src/nsXBLWindowKeyHandler.cpp
toolkit/components/help/content/help.xul
toolkit/components/viewsource/content/viewPartialSource.xul
toolkit/components/viewsource/content/viewSource.xul
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -289,19 +289,22 @@
 #ifdef XP_MACOSX
          modifiers="accel,shift"
 #else
          modifiers="accel"
 #endif
          command="viewHistorySidebar"/>
 
     <key id="key_fullZoomReduce"  key="&fullZoomReduceCmd.commandkey;"   command="cmd_fullZoomReduce"  modifiers="accel"/>
+    <key                          key="&fullZoomReduceCmd.commandkey2;"  command="cmd_fullZoomReduce"  modifiers="accel"/>
     <key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;"  command="cmd_fullZoomEnlarge" modifiers="accel"/>
     <key                          key="&fullZoomEnlargeCmd.commandkey2;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
+    <key                          key="&fullZoomEnlargeCmd.commandkey3;" command="cmd_fullZoomEnlarge" modifiers="accel"/>
     <key id="key_fullZoomReset"   key="&fullZoomResetCmd.commandkey;"    command="cmd_fullZoomReset"   modifiers="accel"/>
+    <key                          key="&fullZoomResetCmd.commandkey2;"   command="cmd_fullZoomReset"   modifiers="accel"/>
     
     <key id="key_switchTextDirection" key="&bidiSwitchTextDirectionItem.commandkey;" command="cmd_switchTextDirection" modifiers="accel,shift" />
 
     <key id="key_sanitize" command="Tools:Sanitize" keycode="VK_DELETE" modifiers="accel,shift"/>
 #ifdef XP_MACOSX
     <key id="key_sanitize_mac" command="Tools:Sanitize" keycode="VK_BACK" modifiers="accel,shift"/>
 #endif
 #ifdef XP_UNIX
--- a/content/xbl/src/nsXBLWindowKeyHandler.cpp
+++ b/content/xbl/src/nsXBLWindowKeyHandler.cpp
@@ -215,21 +215,23 @@ BuildHandlerChain(nsIContent* aContent, 
   // walk the chain they'll come out in the original order
   for (PRUint32 j = aContent->GetChildCount(); j--; ) {
     nsIContent *key = aContent->GetChildAt(j);
 
     if (key->NodeInfo()->Equals(nsGkAtoms::key, kNameSpaceID_XUL)) {
       // Check whether the key element has empty value at key/char attribute.
       // Such element is used by localizers for alternative shortcut key
       // definition on the locale. See bug 426501.
-      nsAutoString valKey, valChar;
+      nsAutoString valKey, valCharCode, valKeyCode;
       PRBool attrExists =
-               key->GetAttr(kNameSpaceID_None, nsGkAtoms::key, valKey) ||
-               key->GetAttr(kNameSpaceID_None, nsGkAtoms::charcode, valChar);
-      if (attrExists && valKey.IsEmpty() && valChar.IsEmpty())
+        key->GetAttr(kNameSpaceID_None, nsGkAtoms::key, valKey) ||
+        key->GetAttr(kNameSpaceID_None, nsGkAtoms::charcode, valCharCode) ||
+        key->GetAttr(kNameSpaceID_None, nsGkAtoms::keycode, valKeyCode);
+      if (attrExists &&
+          valKey.IsEmpty() && valCharCode.IsEmpty() && valKeyCode.IsEmpty())
         continue;
 
       nsXBLPrototypeHandler* handler = new nsXBLPrototypeHandler(key);
 
       if (!handler)
         return;
 
       handler->SetNextHandler(*aResult);
--- a/toolkit/components/help/content/help.xul
+++ b/toolkit/components/help/content/help.xul
@@ -128,20 +128,26 @@
     <key id="key_closeWindow" key="&closeWindow.commandkey;"
          command="cmd_closeWindow" modifiers="accel"/>
     <key id="key_closeSearchSidebar" keycode="VK_ESCAPE"
          oncommand="hideSearchSidebar(event)"/>
     <key id="key_fullZoomEnlarge" key="&fullZoomEnlargeCmd.commandkey;"
          command="cmd_fullZoomEnlarge" modifiers="accel"/>
     <key id="key_fullZoomEnlarge2" key="&fullZoomEnlargeCmd.commandkey2;"
          command="cmd_fullZoomEnlarge" modifiers="accel"/>
+    <key id="key_fullZoomEnlarge3" key="&fullZoomEnlargeCmd.commandkey3;"
+         command="cmd_fullZoomEnlarge" modifiers="accel"/>
     <key id="key_fullZoomReduce" key="&fullZoomReduceCmd.commandkey;"
          command="cmd_fullZoomReduce" modifiers="accel"/>
+    <key id="key_fullZoomReduce2" key="&fullZoomReduceCmd.commandkey2;"
+         command="cmd_fullZoomReduce" modifiers="accel"/>
     <key id="key_fullZoomReset" key="&fullZoomResetCmd.commandkey;"
          command="cmd_fullZoomReset" modifiers="accel"/>
+    <key id="key_fullZoomReset2" key="&fullZoomResetCmd.commandkey2;"
+         command="cmd_fullZoomReset" modifiers="accel"/>
     <key id="key_focusSearch" key="&helpSearch.commandkey;"
          oncommand="focusSearch()" modifiers="accel"/>
 
   </keyset>
   <stringbundle id="bundle_viewZoom"/>
   <stringbundle id="findBundle"
                 src="chrome://global/locale/finddialog.properties"/>
   <stringbundle id="bundle_help"
--- a/toolkit/components/viewsource/content/viewPartialSource.xul
+++ b/toolkit/components/viewsource/content/viewPartialSource.xul
@@ -100,18 +100,21 @@
   <keyset id="viewSourceKeys">
     <key id="key_savePage" key="&savePageCmd.commandkey;" modifiers="accel" command="cmd_savePage"/>
     <key id="key_print" key="&printCmd.commandkey;" modifiers="accel" command="cmd_print"/>
     <key id="key_close" key="&closeCmd.commandkey;" modifiers="accel" command="cmd_close"/>
     <key keycode="VK_ESCAPE" command="cmd_close"/>
 
     <key id="key_textZoomEnlarge" key="&textEnlarge.commandkey;" command="cmd_textZoomEnlarge" modifiers="accel"/>
     <key id="key_textZoomEnlarge2" key="&textEnlarge.commandkey2;" command="cmd_textZoomEnlarge" modifiers="accel"/>
+    <key id="key_textZoomEnlarge3" key="&textEnlarge.commandkey3;" command="cmd_textZoomEnlarge" modifiers="accel"/>
     <key id="key_textZoomReduce"  key="&textReduce.commandkey;" command="cmd_textZoomReduce" modifiers="accel"/>
+    <key id="key_textZoomReduce2"  key="&textReduce.commandkey2;" command="cmd_textZoomReduce" modifiers="accel"/>
     <key id="key_textZoomReset" key="&textReset.commandkey;" command="cmd_textZoomReset" modifiers="accel"/>
+    <key id="key_textZoomReset2" key="&textReset.commandkey2;" command="cmd_textZoomReset" modifiers="accel"/>
   </keyset>
 
   <popup id="viewSourceContextMenu">
     <menuitem id="cMenu_findAgain"/>
     <menuseparator/>
     <menuitem id="cMenu_copy"/>
     <menuseparator/>
     <menuitem id="cMenu_selectAll"/>
--- a/toolkit/components/viewsource/content/viewSource.xul
+++ b/toolkit/components/viewsource/content/viewSource.xul
@@ -101,18 +101,21 @@
   <keyset id="viewSourceKeys">
     <key id="key_savePage" key="&savePageCmd.commandkey;" modifiers="accel" command="cmd_savePage"/>
     <key id="key_print" key="&printCmd.commandkey;" modifiers="accel" command="cmd_print"/>
     <key id="key_close" key="&closeCmd.commandkey;" modifiers="accel" command="cmd_close"/>
     <key id="key_goToLine"     key="&goToLineCmd.commandkey;"  command="cmd_goToLine"  modifiers="accel"/>
 
     <key id="key_textZoomEnlarge" key="&textEnlarge.commandkey;" command="cmd_textZoomEnlarge" modifiers="accel"/>
     <key id="key_textZoomEnlarge2" key="&textEnlarge.commandkey2;" command="cmd_textZoomEnlarge" modifiers="accel"/>
+    <key id="key_textZoomEnlarge3" key="&textEnlarge.commandkey3;" command="cmd_textZoomEnlarge" modifiers="accel"/>
     <key id="key_textZoomReduce"  key="&textReduce.commandkey;" command="cmd_textZoomReduce" modifiers="accel"/>
+    <key id="key_textZoomReduce2"  key="&textReduce.commandkey2;" command="cmd_textZoomReduce" modifiers="accel"/>
     <key id="key_textZoomReset" key="&textReset.commandkey;" command="cmd_textZoomReset" modifiers="accel"/>
+    <key id="key_textZoomReset2" key="&textReset.commandkey2;" command="cmd_textZoomReset" modifiers="accel"/>
 
     <key id="key_reload" key="&reloadCmd.commandkey;" command="cmd_reload" modifiers="accel"/>
     <key key="&reloadCmd.commandkey;" command="cmd_reload" modifiers="accel,shift"/>
     <key keycode="VK_F5" command="cmd_reload"/>
     <key keycode="VK_F5" command="cmd_reload" modifiers="accel"/>
     <key id="key_find" key="&findOnCmd.commandkey;" command="cmd_find" modifiers="accel"/>
     <key id="key_findAgain" key="&findAgainCmd.commandkey;" command="cmd_findAgain" modifiers="accel"/>
     <key id="key_findPrevious" key="&findAgainCmd.commandkey;" command="cmd_findPrevious" modifiers="accel,shift"/>