Bug 1608610 - Inline calendar file new menu items. r=Fallen
authorPaul Morris <paul@thunderbird.net>
Tue, 14 Jan 2020 15:46:23 -0500
changeset 38120 0fe506be8ccaa7e872be8d52c1782465a18af7a6
parent 38119 5ab844270ca19e02a6d286138b41fa96765463a6
child 38121 822561223c277b32a72187bcc16247c57f8c3cc0
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
reviewersFallen
bugs1608610
Bug 1608610 - Inline calendar file new menu items. r=Fallen
calendar/lightning/content/messenger-overlay-sidebar.xhtml
calendar/test/browser/browser_localICS.js
calendar/test/browser/eventDialog/browser_alarmDialog.js
calendar/test/browser/eventDialog/browser_eventDialog.js
calendar/test/browser/eventDialog/browser_eventDialogSize.js
mail/base/content/mainNavigationToolbox.inc.xhtml
--- a/calendar/lightning/content/messenger-overlay-sidebar.xhtml
+++ b/calendar/lightning/content/messenger-overlay-sidebar.xhtml
@@ -5,38 +5,16 @@
    - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->
 
 <overlay id="ltnSidebarOverlay"
          xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:xul="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
          xmlns:html="http://www.w3.org/1999/xhtml">
 
   <!-- CALENDAR MENUS -->
-  <menupopup id="menu_NewPopup">
-    <menuitem id="ltnNewEvent"
-              label="&lightning.menupopup.new.event.label;"
-              insertbefore="menu_newFolder"
-              accesskey="&lightning.menupopup.new.event.accesskey;"
-              key="calendar-new-event-key"
-              command="calendar_new_event_command"/>
-    <menuitem id="ltnNewTask"
-              label="&lightning.menupopup.new.task.label;"
-              insertbefore="menu_newFolder"
-              accesskey="&lightning.menupopup.new.task.accesskey;"
-              key="calendar-new-todo-key"
-              command="calendar_new_todo_command"/>
-    <menuseparator id="afterltnNewTask"
-                   insertbefore="menu_newFolder"
-                   observes="menu_newFolder"/>
-    <menuitem id="ltnNewCalendar" label="&lightning.menupopup.new.calendar.label;"
-               command="calendar_new_calendar_command"
-               accesskey="&lightning.menupopup.new.calendar.accesskey;"
-               insertafter="newAccountMenuItem"/>
-  </menupopup>
-
   <menupopup id="menu_EditPopup">
     <menuitem id="ltnCalendarProperties"
               insertafter="menu_properties"
               label="&calendar.properties.label;"
               accesskey="&calendar.properties.accesskey;"
               command="calendar_edit_calendar_command"/>
   </menupopup>
 
--- a/calendar/test/browser/browser_localICS.js
+++ b/calendar/test/browser/browser_localICS.js
@@ -33,17 +33,17 @@ var calendarFile = Services.dirsvc.get("
 calendarFile.append(calendarName + ".ics");
 
 add_task(async function testLocalICS() {
   await setCalendarView("day");
 
   plan_for_modal_dialog("Calendar:NewCalendarWizard", wizard => {
     handleNewCalendarWizard(wizard, calendarName, { network: { format: "ics" } });
   });
-  controller.mainMenu.click("#ltnNewCalendar");
+  controller.mainMenu.click("#calendar-new-calendar-menuitem");
   wait_for_modal_dialog("Calendar:NewCalendarWizard", TIMEOUT_MODAL_DIALOG);
 
   // Create new event.
   let box = lookupEventBox("day", CANVAS_BOX, null, 1, HOUR);
   await invokeEventDialog(controller, box, async (event, iframe) => {
     let { eid: eventid } = helpersForController(event);
 
     await setData(event, iframe, { title: calendarName, calendar: calendarName });
--- a/calendar/test/browser/eventDialog/browser_alarmDialog.js
+++ b/calendar/test/browser/eventDialog/browser_alarmDialog.js
@@ -30,17 +30,17 @@ add_task(async function testAlarmDialog(
   let now = new Date();
 
   createCalendar(controller, CALENDARNAME);
   switchToView(controller, "day");
   goToDate(controller, now.getFullYear(), now.getMonth() + 1, now.getDate());
   viewForward(controller, 1);
 
   controller.click(lookupEventBox("day", ALLDAY, undefined, 1));
-  controller.mainMenu.click("#ltnNewEvent");
+  controller.mainMenu.click("#calendar-new-event-menuitem");
 
   // Create a new all-day event tomorrow.
   await invokeEventDialog(controller, null, async (event, iframe) => {
     let { eid: eventid } = helpersForController(event);
 
     await setData(event, iframe, {
       allday: true,
       reminder: "1day",
--- a/calendar/test/browser/eventDialog/browser_eventDialog.js
+++ b/calendar/test/browser/eventDialog/browser_eventDialog.js
@@ -71,17 +71,17 @@ add_task(async function testEventDialog(
     0,
     0,
     cal.dtz.floating
   );
   let endTime = dateFormatter.formatTime(nextHour);
 
   // Create new event on first day in view.
   controller.click(lookupEventBox("month", CANVAS_BOX, 1, 1, null));
-  controller.mainMenu.click("#ltnNewEvent");
+  controller.mainMenu.click("#calendar-new-event-menuitem");
 
   await invokeEventDialog(controller, null, async (event, iframe) => {
     let { eid: eventid } = helpersForController(event);
     let { eid: iframeId } = helpersForController(iframe);
     let { iframeLookup, getDateTimePicker } = helpersForEditUI(iframe);
 
     // First check all standard-values are set correctly.
     let startTimeInput = getDateTimePicker("STARTTIME");
--- a/calendar/test/browser/eventDialog/browser_eventDialogSize.js
+++ b/calendar/test/browser/eventDialog/browser_eventDialogSize.js
@@ -20,50 +20,50 @@ var controller = mozmill.getMail3PaneCon
 const SMALL_TOLERANCE = 5;
 const LARGE_TOLERANCE = 10;
 
 add_task(function setupModule(module) {
   createCalendar(controller, CALENDARNAME);
 });
 
 add_task(async function testEventDialog() {
-  dump("#ltnNewEvent click\n");
-  controller.mainMenu.click("#ltnNewEvent");
+  dump("#calendar-new-event-menuitem click\n");
+  controller.mainMenu.click("#calendar-new-event-menuitem");
   await invokeEventDialog(controller, null, (event, iframe) => {
     checkLargeEnough(event, iframe);
 
     // Much larger than necessary.
     event.window.resizeTo(640, 690);
     checkWithinTolerance(event.window.outerWidth, 640);
     checkWithinTolerance(event.window.outerHeight, 690);
     event.keypress(null, "VK_ESCAPE", {});
   });
 
   checkWithinTolerance(getPersistedValue("width"), 640, LARGE_TOLERANCE);
   checkWithinTolerance(getPersistedValue("height"), 690, LARGE_TOLERANCE);
 
-  dump("#ltnNewEvent click\n");
-  controller.mainMenu.click("#ltnNewEvent");
+  dump("#calendar-new-event-menuitem click\n");
+  controller.mainMenu.click("#calendar-new-event-menuitem");
   await invokeEventDialog(controller, null, (event, iframe) => {
     checkWithinTolerance(event.window.outerWidth, 640, LARGE_TOLERANCE);
     checkWithinTolerance(event.window.outerHeight, 690, LARGE_TOLERANCE);
     checkLargeEnough(event, iframe);
 
     // Much smaller than necessary.
     event.window.resizeTo(350, 400);
     controller.assert(() => event.window.outerWidth < 640);
     controller.assert(() => event.window.outerHeight < 690);
     controller.assert(() => event.window.outerWidth > 350);
     controller.assert(() => event.window.outerHeight > 400);
     checkLargeEnough(event, iframe);
     event.keypress(null, "VK_ESCAPE", {});
   });
 
-  dump("#ltnNewEvent click\n");
-  controller.mainMenu.click("#ltnNewEvent");
+  dump("#calendar-new-event-menuitem click\n");
+  controller.mainMenu.click("#calendar-new-event-menuitem");
   await invokeEventDialog(controller, null, (event, iframe) => {
     checkLargeEnough(event, iframe);
 
     // Much larger than necessary.
     event.window.resizeTo(640, 690);
     checkWithinTolerance(event.window.outerWidth, 640);
     checkWithinTolerance(event.window.outerHeight, 690);
     event.keypress(null, "VK_ESCAPE", {});
@@ -71,53 +71,53 @@ add_task(async function testEventDialog(
 
   checkWithinTolerance(getPersistedValue("width"), 640, LARGE_TOLERANCE);
   checkWithinTolerance(getPersistedValue("height"), 690, LARGE_TOLERANCE);
 
   Assert.ok(true, "Test ran to completion");
 });
 
 add_task(async function testTaskDialog() {
-  dump("#ltnNewTask click\n");
-  controller.mainMenu.click("#ltnNewTask");
+  dump("#calendar-new-task-menuitem click\n");
+  controller.mainMenu.click("#calendar-new-task-menuitem");
   await invokeEventDialog(controller, null, (task, iframe) => {
     checkWithinTolerance(getPersistedValue("width"), 640, LARGE_TOLERANCE);
     checkWithinTolerance(getPersistedValue("height"), 690, LARGE_TOLERANCE);
 
     checkLargeEnough(task, iframe);
 
     // Much larger than necessary.
     task.window.resizeTo(650, 700);
     checkWithinTolerance(task.window.outerWidth, 650);
     checkWithinTolerance(task.window.outerHeight, 700);
     task.keypress(null, "VK_ESCAPE", {});
   });
 
   checkWithinTolerance(getPersistedValue("width"), 650, LARGE_TOLERANCE);
   checkWithinTolerance(getPersistedValue("height"), 700, LARGE_TOLERANCE);
 
-  dump("#ltnNewTask click\n");
-  controller.mainMenu.click("#ltnNewTask");
+  dump("#calendar-new-task-menuitem click\n");
+  controller.mainMenu.click("#calendar-new-task-menuitem");
   await invokeEventDialog(controller, null, (task, iframe) => {
     checkWithinTolerance(task.window.outerWidth, 650, LARGE_TOLERANCE);
     checkWithinTolerance(task.window.outerHeight, 700, LARGE_TOLERANCE);
     checkLargeEnough(task, iframe);
 
     // Much smaller than necessary.
     task.window.resizeTo(350, 400);
     controller.assert(() => task.window.outerWidth < 650);
     controller.assert(() => task.window.outerHeight < 700);
     controller.assert(() => task.window.outerWidth > 350);
     controller.assert(() => task.window.outerHeight > 400);
     checkLargeEnough(task, iframe);
     task.keypress(null, "VK_ESCAPE", {});
   });
 
-  dump("#ltnNewTask click\n");
-  controller.mainMenu.click("#ltnNewTask");
+  dump("#calendar-new-task-menuitem click\n");
+  controller.mainMenu.click("#calendar-new-task-menuitem");
   await invokeEventDialog(controller, null, (task, iframe) => {
     checkLargeEnough(task, iframe);
 
     // Much larger than necessary.
     task.window.resizeTo(650, 700);
     checkWithinTolerance(task.window.outerWidth, 650);
     checkWithinTolerance(task.window.outerHeight, 700);
     task.keypress(null, "VK_ESCAPE", {});
--- a/mail/base/content/mainNavigationToolbox.inc.xhtml
+++ b/mail/base/content/mainNavigationToolbox.inc.xhtml
@@ -45,16 +45,28 @@
           <menu id="menu_New" class="menu-iconic"
                 label="&newMenu.label;"
                 accesskey="&newMenu.accesskey;">
             <menupopup id="menu_NewPopup" onpopupshowing="menu_new_init();">
               <menuitem id="menu_newNewMsgCmd" label="&newNewMsgCmd.label;"
                         accesskey="&newNewMsgCmd.accesskey;"
                         key="key_newMessage2"
                         command="cmd_newMessage"/>
+              <menuitem id="calendar-new-event-menuitem"
+                        label="&lightning.menupopup.new.event.label;"
+                        accesskey="&lightning.menupopup.new.event.accesskey;"
+                        key="calendar-new-event-key"
+                        command="calendar_new_event_command"/>
+              <menuitem id="calendar-new-task-menuitem"
+                        label="&lightning.menupopup.new.task.label;"
+                        accesskey="&lightning.menupopup.new.task.accesskey;"
+                        key="calendar-new-todo-key"
+                        command="calendar_new_todo_command"/>
+              <menuseparator id="calendar-after-new-task-menuseparator"
+                             observes="menu_newFolder"/>
               <menuitem id="menu_newFolder" label="&newFolderCmd.label;"
                         command="cmd_newFolder"
                         accesskey="&newFolderCmd.accesskey;"
                         class="menuitem-iconic"/>
               <menuitem id="menu_newVirtualFolder" label="&newVirtualFolderCmd.label;"
                         command="cmd_newVirtualFolder"
                         accesskey="&newVirtualFolderCmd.accesskey;"
                         class="menuitem-iconic"/>
@@ -74,16 +86,20 @@
               <menuitem id="newFeedAccountMenuItem"
                         label="&newFeedAccountCmd.label;"
                         accesskey="&newFeedAccountCmd.accesskey;"
                         oncommand="AddFeedAccount();"/>
               <menuitem id="newAccountMenuItem"
                         label="&newOtherAccountsCmd.label;"
                         accesskey="&newOtherAccountsCmd.accesskey;"
                         oncommand="MsgAccountWizard();"/>
+              <menuitem id="calendar-new-calendar-menuitem"
+                        label="&lightning.menupopup.new.calendar.label;"
+                        command="calendar_new_calendar_command"
+                        accesskey="&lightning.menupopup.new.calendar.accesskey;"/>
               <menuseparator id="newPopupMenuSeparator"/>
               <menuitem id="menu_newCard"
                         label="&newContactCmd.label;"
                         accesskey="&newContactCmd.accesskey;"
                         command="cmd_newCard"/>
               <menuitem id="newIMContactMenuItem"
                         label="&newIMContactCmd.label;"
                         accesskey="&newIMContactCmd.accesskey;"