bug 441794: fix a mis-merge, and also make a few tweaks to my code to match the shifting main ui.
authorDaniel Brooks <db48x@db48x.net>
Tue, 29 Jul 2008 03:10:22 -0500
changeset 64886 7c33ed211804c1dc753389543781ad31d73a90bd
parent 64885 ab9e6854e0faf1066b12b84166def09cb7225252
child 64887 e11b438934ad7221685adcdecf6a86a4ef325c00
push id1
push userclegnitto@mozilla.com
push dateTue, 12 Apr 2011 01:19:02 +0000
treeherdermozilla-aurora@0cfe6840e0a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs441794
bug 441794: fix a mis-merge, and also make a few tweaks to my code to match the shifting main ui.
mobile/chrome/content/browser-ui.js
mobile/chrome/content/browser.xul
mobile/chrome/content/shortcuts.js
--- a/mobile/chrome/content/browser-ui.js
+++ b/mobile/chrome/content/browser-ui.js
@@ -570,17 +570,17 @@ var BrowserUI = {
           BookmarkHelper.edit(bookmarkURI);
         }
         break;
       }
       case "cmd_bookmarks":
         this.showBookmarks();
         break;
       case "cmd_shortcuts":
-        this._showMode(PANELMODE_SHORTCUTLIST);
+        this.show(PANELMODE_NONE);
         Shortcuts.edit();
         break;
       case "cmd_menu":
         if (this.mode == PANELMODE_FULL)
           this.show(PANELMODE_NONE);
         else
           this.show(PANELMODE_FULL);
         break;
--- a/mobile/chrome/content/browser.xul
+++ b/mobile/chrome/content/browser.xul
@@ -57,29 +57,30 @@
         titlemodifier="&brandShortName;"
         titleseparator="&mainWindow.titleseparator;"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
 
   <script type="application/x-javascript" src="chrome://global/content/inlineSpellCheckUI.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/commandUtil.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/browser.js"/>
   <script type="application/x-javascript" src="chrome://browser/content/browser-ui.js"/>
-  <script type="application/x-javascript;version=1.8" src="chrome://browser/content/shortcuts.js"/>
 
   <stringbundleset id="stringbundleset">
-    <stringbundle id="bundle_browser"  src="chrome://browser/locale/browser.properties"/>
-    <stringbundle id="bundle_brand"  src="chrome://branding/locale/brand.properties"/>
+    <stringbundle id="bundle_browser" src="chrome://browser/locale/browser.properties"/>
+    <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
     <stringbundle id="bundle-keys" src="chrome://global/locale/keys.properties"/>
     <stringbundle id="bundle-platformKeys" src="chrome://global-platform/locale/platformKeys.properties"/>
   </stringbundleset>
 
-  <stringbundleset id="stringbundleset">
-    <stringbundle id="bundle_browser"  src="chrome://browser/locale/browser.properties"/>
+  <stringbundleset id="shortcut-bundles">
+    <stringbundle src="chrome://browser/locale/shortcuts.properties"/>
   </stringbundleset>
 
+  <script type="application/x-javascript;version=1.8" src="chrome://browser/content/shortcuts.js"/>
+
   <commandset id="cmdset_main">
     <!-- basic navigation -->
     <command id="cmd_back" label="&back.label;" disabled="true" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_forward" label="&forward.label;" disabled="true" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_reload" label="&reload.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_stop" label="&stop.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_search" label="&search.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
     <command id="cmd_go" label="&go.label;" oncommand="CommandUpdater.doCommand(this.id);"/>
@@ -181,18 +182,39 @@
             </vbox>
             <description id="identity-popup-encryption-label" flex="1"/>
           </hbox>
         </vbox>
       </hbox>
     </panel>
   </popupset>
 
-  <toolbox id="toolbox-main">
-    <toolbar id="toolbar-main">
+  <stack id="browser-container" flex="1" style="overflow: hidden;">
+    <vbox id="browser">
+      <notificationbox id="notifications" flex="1">
+        <deckbrowser id="content" autocompletepopup="popup_autocomplete_content" flex="1"
+                     onnewtab="CommandUpdater.doCommand('cmd_newTab');"/>
+      </notificationbox>
+    </vbox>
+
+    <vbox id="browser-controls" style="-moz-stack-sizing: ignore; width: 80px;" top="60" left="0">
+      <toolbarbutton id="tool-back" class="browser-control-button" command="cmd_back"/>
+      <toolbarbutton id="tool-forward" class="browser-control-button" command="cmd_forward"/>
+      <toolbarbutton id="tool-star" class="browser-control-button" command="cmd_star"/>
+      <toolbarbutton id="tool-bookmarks" class="browser-control-button" command="cmd_bookmarks"/>
+      <toolbarbutton id="tool-actions" class="browser-control-button" command="cmd_actions"/>
+      <toolbarbutton id="tool-shortcuts" class="browser-control-button" command="cmd_shortcuts"/>
+    </vbox>
+
+    <vbox id="tab-list-container" style="-moz-stack-sizing: ignore;" top="60" left="0">
+      <richlistbox id="tab-list" onselect="BrowserUI.selectTab(this.selectedItem);"/>
+      <button id="newtab-button" label="+" command="cmd_newTab"/>
+    </vbox>
+
+    <toolbar id="toolbar-main" style="-moz-stack-sizing: ignore; height: 60px;" top="0" left="0">
       <hbox id="urlbar-container" flex="1">
         <box id="identity-box"
              onclick="getIdentityHandler().handleIdentityButtonEvent(event);"
              onkeypress="getIdentityHandler().handleIdentityButtonEvent(event);">
           <stack id="urlbar-image-stack">
             <image id="urlbar-throbber" src=""/>
             <image id="urlbar-favicon" src=""/>
           </stack>
@@ -212,34 +234,16 @@
                  clickSelectsAll="true"/>
       </hbox>
       <hbox id="urlbar-icons">
         <toolbarbutton id="tool-reload" class="urlbar-icon-button" command="cmd_reload"/>
         <toolbarbutton id="tool-stop" class="urlbar-icon-button" command="cmd_stop"/>
         <toolbarbutton id="tool-go" class="urlbar-icon-button" command="cmd_go"/>
       </hbox>
     </toolbar>
-  </toolbox>
-
-  <stack flex="1">
-    <hbox id="browser-container" flex="1">
-      <vbox id="browser" flex="1">
-        <notificationbox id="notifications" flex="1">
-          <deckbrowser id="content" autocompletepopup="popup_autocomplete_content" flex="1"/>
-        </notificationbox>
-      </vbox>
-      <vbox id="browser-controls" collapsed="true">
-        <toolbarbutton id="tool-back" class="browser-control-button" command="cmd_back"/>
-        <toolbarbutton id="tool-forward" class="browser-control-button" command="cmd_forward"/>
-        <toolbarbutton id="tool-star" class="browser-control-button" command="cmd_star"/>
-        <toolbarbutton id="tool-bookmarks" class="browser-control-button" command="cmd_bookmarks"/>
-        <toolbarbutton id="tool-actions" class="browser-control-button" command="cmd_actions"/>
-        <toolbarbutton id="tool-shortcuts" class="browser-control-button" command="cmd_shortcuts"/>
-      </vbox>
-    </hbox>
 
     <vbox id="urllist-container" hidden="true" style="-moz-stack-sizing: ignore;" top="60" left="0">
       <hbox id="urllist-items-container" flex="1">
         <richlistbox id="urllist-items" flex="1"/>
       </hbox>
     </vbox>
 
     <vbox id="bookmark-container" hidden="true" style="-moz-stack-sizing: ignore;" top="60" left="0">
--- a/mobile/chrome/content/shortcuts.js
+++ b/mobile/chrome/content/shortcuts.js
@@ -302,23 +302,24 @@ function ShortcutEditor()
 
     // This code is all about converting key elements into human-readable
     // descriptions of the keys they match. Copied essentially verbatim from
     // nsMenuFrame::BuildAcceleratorText
     // TODO: write some tests
 
     // first, we need to look up the right names of the various modifier keys.
     var platformBundle = document.getElementById("bundle-platformKeys");
+    function doGetString(n) { try { return platformBundle.getString(n); } catch (ex) { dump(">>"+ex+"\n"); return undefined; } };
     var platformKeys = {
-        shift: platformBundle.getString("VK_SHIFT"),
-        meta: platformBundle.getString("VK_META"),
-        alt: platformBundle.getString("VK_ALT"),
-        control: platformBundle.getString("VK_CONTROL")
+        shift: doGetString("VK_SHIFT") || "Shift",
+        meta: doGetString("VK_META") || "Meta",
+        alt: doGetString("VK_ALT") || "Alt",
+        control: doGetString("VK_CONTROL") || "Ctrl"
     };
-    var modifierSeparator = platformBundle.getString("MODIFIER_SEPARATOR");
+    var modifierSeparator = doGetString("MODIFIER_SEPARATOR") || "+";
 
 #ifdef XP_MACOSX
     var accelKey = Components.interfaces.nsIDOMKeyEvent.DOM_VK_META;
 #else
     var accelKey = Components.interfaces.nsIDOMKeyEvent.DOM_VK_CONTROL;
 #endif
 
     try {
@@ -405,17 +406,17 @@ function ShortcutEditor()
         }
     }
 
     // show the window
     this.edit = function()
     {
         tree = document.getElementById("shortcuts");
 
-        var nodes = document.getElementById("ui-stack").childNodes;
+        var nodes = document.getElementById("browser-container").childNodes;
         Array.forEach(nodes, function(n) { if (n.getAttribute("id") != "browser-container") n.hidden = true; });
         document.getElementById("shortcuts-container").hidden = false;
         fillShortcutList();
 
         var textbox = document.getAnonymousElementByAttribute(tree, "anonid", "input");
         textbox.addEventListener("keypress", keyListener, true);
         textbox.addEventListener("reset", resetListener, true);
         tree.addEventListener("DOMAttrModified", modificationListener, true);