Fix bug 394771 - Lightning calendar view context menus use wrong entities. r=ssitter
authorPhilipp Kewisch <mozilla@kewis.ch>
Thu, 25 Mar 2010 22:05:04 +0100
changeset 5266 98e96c27cb83ea42a73d4015890bf2841e988f4c
parent 5265 bbd3d3684c04880925cfb2a19a6a0643d5c3fcac
child 5267 cb2333d711340a9a9b042b77e0b63f34412b3aa7
push id4066
push usermozilla@kewis.ch
push dateThu, 25 Mar 2010 21:24:14 +0000
treeherdercomm-central@98e96c27cb83 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersssitter
bugs394771
Fix bug 394771 - Lightning calendar view context menus use wrong entities. r=ssitter
calendar/base/content/calendar-common-sets.xul
calendar/base/content/calendar-views.js
calendar/locales/en-US/chrome/calendar/calendar.dtd
calendar/locales/en-US/chrome/calendar/menuOverlay.dtd
calendar/sunbird/base/content/calendar-menubar.inc
--- a/calendar/base/content/calendar-common-sets.xul
+++ b/calendar/base/content/calendar-common-sets.xul
@@ -249,30 +249,37 @@
       <menuitem id="calendar-view-context-menu-newtodo"
                 label="&calendar.context.newtodo.label;"
                 observes="calendar_new_todo_command"
                 accesskey="&calendar.context.newtodo.accesskey;"
                 key="calendar-new-todo-key"/>
       <!-- These labels are set dynamically, based on the current view -->
       <menuitem id="calendar-view-context-menu-previous"
                 label=""
+                accesskey=""
                 observes="calendar_view_prev_command"
-                label-day="&calendar.prevday.button.tooltip;"
-                label-week="&calendar.prevweek.button.tooltip;"
-                label-multiweek="&calendar.prevweek.button.tooltip;"
-                label-month="&calendar.prevmonth.button.tooltip;"
-                accesskey="&goPreviousCmd.accesskey;"/>
+                label-day="&calendar.prevday.label;"
+                label-week="&calendar.prevweek.label;"
+                label-multiweek="&calendar.prevweek.label;"
+                label-month="&calendar.prevmonth.label;"
+                accesskey-day="&calendar.prevday.accesskey;"
+                accesskey-week="&calendar.prevweek.accesskey;"
+                accesskey-multiweek="&calendar.prevweek.accesskey;"
+                accesskey-month="&calendar.prevmonth.accesskey;"/>
       <menuitem id="calendar-view-context-menu-next"
                 label=""
                 observes="calendar_view_next_command"
-                label-day="&calendar.nextday.button.tooltip;"
-                label-week="&calendar.nextweek.button.tooltip;"
-                label-multiweek="&calendar.nextweek.button.tooltip;"
-                label-month="&calendar.nextmonth.button.tooltip;"
-                accesskey="&goNextCmd.all.accesskey;"/>
+                label-day="&calendar.nextday.label;"
+                label-week="&calendar.nextweek.label;"
+                label-multiweek="&calendar.nextweek.label;"
+                label-month="&calendar.nextmonth.label;"
+                accesskey-day="&calendar.nextday.accesskey;"
+                accesskey-week="&calendar.nextweek.accesskey;"
+                accesskey-multiweek="&calendar.nextweek.accesskey;"
+                accesskey-month="&calendar.nextmonth.accesskey;"/>
       <menuseparator id="calendar-item-context-separator-cutcopypaste"/>
       <!-- Cut and copy doesn't make sense in the views, but only showing paste
            makes it look like something is missing. Disable by default. -->
       <menuitem id="calendar-view-context-menu-cut-menuitem"
                 label="&calendar.context.cutevent.label;"
                 accesskey="&calendar.context.cutevent.accesskey;"
                 key="key_cut"
                 disabled="true"/>
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -339,24 +339,24 @@ function switchToView(aViewType) {
         let node = document.getElementById(id);
         if (node.hasAttribute(attr + "-" + aViewType)) {
             node.setAttribute(attr, node.getAttribute(attr + "-" + aViewType));
         } else {
             node.setAttribute(attr, node.getAttribute(attr + "-all"));
         }
     }
 
-    // Set up the labels for the context menu
+    // Set up the labels and accesskeys for the context menu
     ["calendar-view-context-menu-next",
      "calendar-view-context-menu-previous",
      "calendar-go-menu-next",
-     "calendar-go-menu-previous"].forEach(function(x) setupViewNode(x, "label"));
-
-    ["calendar-go-menu-next",
-     "calendar-go-menu-previous"].forEach(function(x) setupViewNode(x, "accesskey"));
+     "calendar-go-menu-previous"].forEach(function(x) {
+            setupViewNode(x, "label");
+            setupViewNode(x, "accesskey")
+     });
 
     // Set up the labels for the view navigation
     ["previous-view-button",
      "today-view-button",
      "next-view-button"].forEach(function(x) setupViewNode(x, "tooltiptext"));
     
     try {
         selectedDay = viewDeck.selectedPanel.selectedDay;
--- a/calendar/locales/en-US/chrome/calendar/calendar.dtd
+++ b/calendar/locales/en-US/chrome/calendar/calendar.dtd
@@ -83,22 +83,28 @@
 <!ENTITY calendar.today.button.tooltip            "Go to today" >
 <!ENTITY calendar.todaypane.button.tooltip        "Show Today pane" >
 
 <!ENTITY calendar.day.button.tooltip            "Switch to day view" >
 <!ENTITY calendar.week.button.tooltip           "Switch to week view" >
 <!ENTITY calendar.month.button.tooltip          "Switch to month view" >
 <!ENTITY calendar.multiweek.button.tooltip      "Switch to multiweek view" >
 
-<!ENTITY calendar.nextday.button.tooltip        "Next Day" >
-<!ENTITY calendar.prevday.button.tooltip        "Previous Day" >
-<!ENTITY calendar.nextweek.button.tooltip       "Next Week" >
-<!ENTITY calendar.prevweek.button.tooltip       "Previous Week" >
-<!ENTITY calendar.nextmonth.button.tooltip      "Next Month" >
-<!ENTITY calendar.prevmonth.button.tooltip      "Previous Month" >
+<!ENTITY calendar.nextday.label                 "Next Day" >
+<!ENTITY calendar.prevday.label                 "Previous Day" >
+<!ENTITY calendar.nextday.accesskey             "x" >
+<!ENTITY calendar.prevday.accesskey             "s" >
+<!ENTITY calendar.nextweek.label                "Next Week" >
+<!ENTITY calendar.prevweek.label                "Previous Week" >
+<!ENTITY calendar.nextweek.accesskey            "x" >
+<!ENTITY calendar.prevweek.accesskey            "s" >
+<!ENTITY calendar.nextmonth.label               "Next Month" >
+<!ENTITY calendar.prevmonth.label               "Previous Month" >
+<!ENTITY calendar.nextmonth.accesskey           "x" >
+<!ENTITY calendar.prevmonth.accesskey           "s" >
 
 <!ENTITY calendar.navigation.nextday.tooltip    "One Day Forward" >
 <!ENTITY calendar.navigation.prevday.tooltip    "One Day Back" >
 <!ENTITY calendar.navigation.nextweek.tooltip   "One Week Forward" >
 <!ENTITY calendar.navigation.prevweek.tooltip   "One Week Back" >
 <!ENTITY calendar.navigation.nextmonth.tooltip  "One Month Forward" >
 <!ENTITY calendar.navigation.prevmonth.tooltip  "One Month Back" >
 
--- a/calendar/locales/en-US/chrome/calendar/menuOverlay.dtd
+++ b/calendar/locales/en-US/chrome/calendar/menuOverlay.dtd
@@ -87,23 +87,13 @@
 <!ENTITY calendar.menu.numberofweeks.3          "Three Weeks">
 <!ENTITY calendar.menu.numberofweeks.4          "Four Weeks">
 <!ENTITY calendar.menu.numberofweeks.5          "Five Weeks">
 <!ENTITY calendar.menu.numberofweeks.6          "Six Weeks">
 
 <!ENTITY goTodayCmd.label                       "Today">
 <!ENTITY goTodayCmd.accesskey                   "T">
 
-<!ENTITY goPreviousCmd.day.label                "Previous Day">
-<!ENTITY goPreviousCmd.week.label               "Previous Week">
-<!ENTITY goPreviousCmd.month.label              "Previous Month">
-<!ENTITY goPreviousCmd.accesskey                "P">
-
-<!ENTITY goNextCmd.day.label                    "Next Day">
-<!ENTITY goNextCmd.week.label                   "Next Week">
-<!ENTITY goNextCmd.month.label                  "Next Month">
-<!ENTITY goNextCmd.all.accesskey                "e">
-
 <!ENTITY showCurrentView.label                  "Current View">
 <!ENTITY showCurrentView.accesskey              "V">
 
 <!ENTITY calendar.properties.label              "Calendar Properties…">
 <!ENTITY calendar.properties.accesskey          "C">
--- a/calendar/sunbird/base/content/calendar-menubar.inc
+++ b/calendar/sunbird/base/content/calendar-menubar.inc
@@ -350,29 +350,37 @@
                      accesskey="&goDateCmd.accesskey;"
                      observes="go_date_command"/>
            <menuseparator/>
            <!-- Label is set up automatically using the view id. When writing a
                 view extension, overlay this menuitem and add a label-<myviewtype>
                 attribute with the correct label -->
            <menuitem id="calendar-go-menu-previous"
                      label=""
-                     label-day="&goPreviousCmd.day.label;"
-                     label-week="&goPreviousCmd.week.label;"
-                     label-multiweek="&goPreviousCmd.week.label;"
-                     label-month="&goPreviousCmd.month.label;"
-                     accesskey="&goPreviousCmd.accesskey;"
+                     accesskey=""
+                     label-day="&calendar.prevday.label;"
+                     label-week="&calendar.prevweek.label;"
+                     label-multiweek="&calendar.prevweek.label;"
+                     label-month="&calendar.prevmonth.label;"
+                     accesskey-day="&calendar.prevday.accesskey;"
+                     accesskey-week="&calendar.prevweek.accesskey;"
+                     accesskey-multiweek="&calendar.prevweek.accesskey;"
+                     accesskey-month="&calendar.prevmonth.accesskey;"
                      observes="calendar_view_prev_command"/>
            <menuitem id="calendar-go-menu-next"
                      label=""
-                     label-day="&goNextCmd.day.label;"
-                     label-week="&goNextCmd.week.label;"
-                     label-multiweek="&goNextCmd.week.label;"
-                     label-month="&goNextCmd.month.label;"
-                     accesskey="&goNextCmd.all.accesskey;"
+                     accesskey=""
+                     label-day="&calendar.nextday.label;"
+                     label-week="&calendar.nextweek.label;"
+                     label-multiweek="&calendar.nextweek.label;"
+                     label-month="&calendar.nextmonth.label;"
+                     accesskey-day="&calendar.nextday.accesskey;"
+                     accesskey-week="&calendar.nextweek.accesskey;"
+                     accesskey-multiweek="&calendar.nextweek.accesskey;"
+                     accesskey-month="&calendar.nextmonth.accesskey;"
                      observes="calendar_view_next_command"/>
          </menupopup>
        </menu>
 
        <menu id="menu_Tools"
              label="&toolsMenu.label;"
              accesskey="&toolsMenu.accesskey;">
          <menupopup id="menu_ToolsPopup">