Bug 1608610 - Pre-process calendar 'events and tasks' menu. r=Fallen
authorPaul Morris <paul@thunderbird.net>
Tue, 14 Jan 2020 14:19:51 -0500
changeset 38118 001eb334f82a2cdcb50403d25230edbfc22455a8
parent 38117 df845a3dbec6eed3199082683b2af39083a6192c
child 38119 5ab844270ca19e02a6d286138b41fa96765463a6
push id398
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:10:28 +0000
reviewersFallen
bugs1608610
Bug 1608610 - Pre-process calendar 'events and tasks' menu. r=Fallen
calendar/lightning/content/calendar-menu-events-tasks.inc.xhtml
calendar/lightning/content/messenger-overlay-sidebar.xhtml
calendar/lightning/jar.mn
mail/base/content/mainNavigationToolbox.inc.xhtml
new file mode 100644
--- /dev/null
+++ b/calendar/lightning/content/calendar-menu-events-tasks.inc.xhtml
@@ -0,0 +1,104 @@
+# This Source Code Form is subject to the terms of the Mozilla Public
+# License, v. 2.0. If a copy of the MPL was not distributed with this
+# file, You can obtain one at http://mozilla.org/MPL/2.0/.
+
+<menu id="menu_Event_Task"
+      label="&lightning.menu.eventtask.label;"
+      accesskey="&lightning.menu.eventtask.accesskey;">
+  <menupopup id="menu_Event_Task_Popup" onpopupshowing="changeMenuForTask(event); setupDeleteMenuitem('ltnDeleteSelectedCalendar')">
+    <menuitem id="ltnNewEvent2"
+              label="&event.new.event;"
+              accesskey="&event.new.event.accesskey;"
+              key="calendar-new-event-key"
+              command="calendar_new_event_command"/>
+    <menuitem id="ltnNewTask2"
+              label="&event.new.task;"
+              accesskey="&event.new.task.accesskey;"
+              key="calendar-new-todo-key"
+              command="calendar_new_todo_command"/>
+    <menuseparator id="before-Calendar-Mode-Section"/>
+    <menuitem id="ltnMenuSwitchToCalendar"
+              type="checkbox"
+              label="&lightning.toolbar.calendar.label;"
+              accesskey="&lightning.toolbar.calendar.accesskey;"
+              command="switch2calendar"
+              value="calendar"
+              key="openLightningKey"
+              autocheck="false">
+    </menuitem>
+    <menuitem id="ltnMenuSwitchToTask"
+              type="checkbox"
+              label="&lightning.toolbar.task.label;"
+              accesskey="&lightning.toolbar.task.accesskey;"
+              command="switch2task"
+              value="task"
+              key="openTasksKey"
+              autocheck="false">
+    </menuitem>
+    <menuseparator id="ltnBeforeCalendarSection"/>
+    <menuitem id="ltnExportCalendar"
+              label="&calendar.export.label;"
+              accesskey="&calendar.export.accesskey;"
+              command="calendar_export_command"/>
+    <menuitem id="ltnImportCalendar"
+              label="&calendar.import.label;"
+              accesskey="&calendar.import.accesskey;"
+              command="calendar_import_command"/>
+    <menuitem id="ltnPublishCalendar"
+              label="&calendar.publish.label;"
+              accesskey="&calendar.publish.accesskey;"
+              command="calendar_publish_calendar_command"/>
+    <menuitem id="ltnDeleteSelectedCalendar"
+              labeldelete="&calendar.deletecalendar.label;"
+              labelremove="&calendar.removecalendar.label;"
+              labelunsubscribe="&calendar.unsubscribecalendar.label;"
+              accesskeydelete="&calendar.deletecalendar.accesskey;"
+              accesskeyremove="&calendar.removecalendar.accesskey;"
+              accesskeyunsubscribe="&calendar.unsubscribecalendar.accesskey;"
+              command="calendar_delete_calendar_command"/>
+    <menuseparator id="ltnBeforeTaskActions"/>
+    <menuitem id="ltnTaskActionsMarkCompletedMenuitem"
+              type="checkbox"
+              label="&calendar.context.markcompleted.label;"
+              accesskey="&calendar.context.markcompleted.accesskey;"
+              command="calendar_toggle_completed_command"/>
+    <menu id="ltnTaskActionsPriorityMenuitem"
+          label="&calendar.context.priority.label;"
+          accesskey="&calendar.context.priority.accesskey;"
+          command="calendar_general-priority_command">
+      <menupopup is="calendar-task-priority-menupopup"/>
+    </menu>
+    <menu id="ltnTaskActionsProgressMenuitem"
+          label="&calendar.context.progress.label;"
+          accesskey="&calendar.context.progress.accesskey;"
+          command="calendar_general-progress_command">
+      <menupopup is="calendar-task-progress-menupopup"/>
+    </menu>
+    <menu id="ltnTaskActionsPostponeMenuitem"
+          label="&calendar.context.postpone.label;"
+          accesskey="&calendar.context.postpone.accesskey;"
+          command="calendar_general-postpone_command">
+      <menupopup id="ltnTaskActionsPostponeMenuPopup">
+        <menuitem id="ltnTaskActionsPostponeMenu-1hour"
+                  label="&calendar.context.postpone.1hour.label;"
+                  accesskey="&calendar.context.postpone.1hour.accesskey;"
+                  command="calendar_postpone-1hour_command"/>
+        <menuitem id="ltnTaskActionsPostponeMenu-1day"
+                  label="&calendar.context.postpone.1day.label;"
+                  accesskey="&calendar.context.postpone.1day.accesskey;"
+                  command="calendar_postpone-1day_command"/>
+        <menuitem id="ltnTaskActionsPostponeMenu-1week"
+                  label="&calendar.context.postpone.1week.label;"
+                  accesskey="&calendar.context.postpone.1week.accesskey;"
+                  command="calendar_postpone-1week_command"/>
+      </menupopup>
+    </menu>
+    <menuseparator id="ltnBeforeUnifinderSection" />
+    <menuitem id="ltnShowUnifinder"
+              type="checkbox"
+              checked="true"
+              label="&showUnifinderCmd.label;"
+              accesskey="&showUnifinderCmd.accesskey;"
+              command="calendar_show_unifinder_command"/>
+  </menupopup>
+</menu>
--- a/calendar/lightning/content/messenger-overlay-sidebar.xhtml
+++ b/calendar/lightning/content/messenger-overlay-sidebar.xhtml
@@ -311,120 +311,16 @@
               label-month="&lightning.toolbar.month.label;"
               accesskey-day="&lightning.toolbar.day.accesskey;"
               accesskey-week="&lightning.toolbar.week.accesskey;"
               accesskey-multiweek="&lightning.toolbar.week.accesskey;"
               accesskey-month="&lightning.toolbar.month.accesskey;"
               command="calendar_view_prev_command"/>
   </menupopup>
 
-  <menubar id="mail-menubar">
-    <menu id="menu_Event_Task"
-          label="&lightning.menu.eventtask.label;"
-          accesskey="&lightning.menu.eventtask.accesskey;"
-          insertafter="messageMenu">
-      <menupopup id="menu_Event_Task_Popup" onpopupshowing="changeMenuForTask(event); setupDeleteMenuitem('ltnDeleteSelectedCalendar')">
-        <menuitem id="ltnNewEvent2"
-                  label="&event.new.event;"
-                  accesskey="&event.new.event.accesskey;"
-                  key="calendar-new-event-key"
-                  command="calendar_new_event_command"/>
-        <menuitem id="ltnNewTask2"
-                  label="&event.new.task;"
-                  accesskey="&event.new.task.accesskey;"
-                  key="calendar-new-todo-key"
-                  command="calendar_new_todo_command"/>
-        <menuseparator id="before-Calendar-Mode-Section"/>
-        <menuitem id="ltnMenuSwitchToCalendar"
-                  type="checkbox"
-                  label="&lightning.toolbar.calendar.label;"
-                  accesskey="&lightning.toolbar.calendar.accesskey;"
-                  command="switch2calendar"
-                  value="calendar"
-                  key="openLightningKey"
-                  autocheck="false">
-        </menuitem>
-        <menuitem id="ltnMenuSwitchToTask"
-                  type="checkbox"
-                  label="&lightning.toolbar.task.label;"
-                  accesskey="&lightning.toolbar.task.accesskey;"
-                  command="switch2task"
-                  value="task"
-                  key="openTasksKey"
-                  autocheck="false">
-        </menuitem>
-        <menuseparator id="ltnBeforeCalendarSection"/>
-        <menuitem id="ltnExportCalendar"
-                  label="&calendar.export.label;"
-                  accesskey="&calendar.export.accesskey;"
-                  command="calendar_export_command"/>
-        <menuitem id="ltnImportCalendar"
-                  label="&calendar.import.label;"
-                  accesskey="&calendar.import.accesskey;"
-                  command="calendar_import_command"/>
-        <menuitem id="ltnPublishCalendar"
-                  label="&calendar.publish.label;"
-                  accesskey="&calendar.publish.accesskey;"
-                  command="calendar_publish_calendar_command"/>
-        <menuitem id="ltnDeleteSelectedCalendar"
-                  labeldelete="&calendar.deletecalendar.label;"
-                  labelremove="&calendar.removecalendar.label;"
-                  labelunsubscribe="&calendar.unsubscribecalendar.label;"
-                  accesskeydelete="&calendar.deletecalendar.accesskey;"
-                  accesskeyremove="&calendar.removecalendar.accesskey;"
-                  accesskeyunsubscribe="&calendar.unsubscribecalendar.accesskey;"
-                  command="calendar_delete_calendar_command"/>
-        <menuseparator id="ltnBeforeTaskActions"/>
-        <menuitem id="ltnTaskActionsMarkCompletedMenuitem"
-                  type="checkbox"
-                  label="&calendar.context.markcompleted.label;"
-                  accesskey="&calendar.context.markcompleted.accesskey;"
-                  command="calendar_toggle_completed_command"/>
-        <menu id="ltnTaskActionsPriorityMenuitem"
-              label="&calendar.context.priority.label;"
-              accesskey="&calendar.context.priority.accesskey;"
-              command="calendar_general-priority_command">
-          <menupopup is="calendar-task-priority-menupopup"/>
-        </menu>
-        <menu id="ltnTaskActionsProgressMenuitem"
-              label="&calendar.context.progress.label;"
-              accesskey="&calendar.context.progress.accesskey;"
-              command="calendar_general-progress_command">
-          <menupopup is="calendar-task-progress-menupopup"/>
-        </menu>
-        <menu id="ltnTaskActionsPostponeMenuitem"
-              label="&calendar.context.postpone.label;"
-              accesskey="&calendar.context.postpone.accesskey;"
-              command="calendar_general-postpone_command">
-          <menupopup id="ltnTaskActionsPostponeMenuPopup">
-            <menuitem id="ltnTaskActionsPostponeMenu-1hour"
-                      label="&calendar.context.postpone.1hour.label;"
-                      accesskey="&calendar.context.postpone.1hour.accesskey;"
-                      command="calendar_postpone-1hour_command"/>
-            <menuitem id="ltnTaskActionsPostponeMenu-1day"
-                      label="&calendar.context.postpone.1day.label;"
-                      accesskey="&calendar.context.postpone.1day.accesskey;"
-                      command="calendar_postpone-1day_command"/>
-            <menuitem id="ltnTaskActionsPostponeMenu-1week"
-                      label="&calendar.context.postpone.1week.label;"
-                      accesskey="&calendar.context.postpone.1week.accesskey;"
-                      command="calendar_postpone-1week_command"/>
-          </menupopup>
-        </menu>
-        <menuseparator id="ltnBeforeUnifinderSection" />
-        <menuitem id="ltnShowUnifinder"
-                  type="checkbox"
-                  checked="true"
-                  label="&showUnifinderCmd.label;"
-                  accesskey="&showUnifinderCmd.accesskey;"
-                  command="calendar_show_unifinder_command"/>
-      </menupopup>
-    </menu>
-  </menubar>
-
   <menupopup id="mailContext">
     <menu id="mailContext-calendar-convert-menu"
           insertafter="mailContext-moveToFolderAgain"
           label="&calendar.context.convertmenu.label;"
           accesskey="&calendar.context.convertmenu.accesskey.mail;">
       <menupopup id="mailContext-calendar-convert-menupopup">
         <menuitem id="mailContext-calendar-convert-event-menuitem"
                   label="&calendar.context.convertmenu.event.label;"
--- a/calendar/lightning/jar.mn
+++ b/calendar/lightning/jar.mn
@@ -12,16 +12,17 @@ lightning.jar:
 % overlay chrome://mozapps/content/extensions/extensions.xhtml chrome://lightning/content/suite-overlay-addons.xhtml application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
 % overlay chrome://lightning/content/messenger-overlay-sidebar.xhtml chrome://lightning/content/suite-overlay-sidebar.xhtml application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
 % override chrome://lightning-common/skin/accountCentral.css chrome://lightning-common/skin/suite-accountCentral.css application={92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}
 % content lightning %content/
     content/calendar-buttons-mail-toolbar.inc.xhtml        (content/calendar-buttons-mail-toolbar.inc.xhtml)
     content/calendar-commands.inc.xhtml                    (content/calendar-commands.inc.xhtml)
     content/calendar-context-menus-and-tooltips.inc.xhtml  (content/calendar-context-menus-and-tooltips.inc.xhtml)
     content/calendar-keys.inc.xhtml                        (content/calendar-keys.inc.xhtml)
+    content/calendar-menu-events-tasks.inc.xhtml           (content/calendar-menu-events-tasks.inc.xhtml)
     content/calendar-status-bar.inc.xhtml                  (content/calendar-status-bar.inc.xhtml)
     content/calendar-tab-panels.inc.xhtml                  (content/calendar-tab-panels.inc.xhtml)
     content/calendar-today-pane.inc.xhtml                  (content/calendar-today-pane.inc.xhtml)
     content/html-item-editing/lightning-item-iframe.html   (content/html-item-editing/lightning-item-iframe.html)
     content/html-item-editing/react-code.js                (content/html-item-editing/react-code.js)
     content/imip-bar.js                                    (content/imip-bar.js)
     content/imip-bar-overlay.inc.xhtml                     (content/imip-bar-overlay.inc.xhtml)
     content/lightning-calendar-creation.js                 (content/lightning-calendar-creation.js)
--- a/mail/base/content/mainNavigationToolbox.inc.xhtml
+++ b/mail/base/content/mainNavigationToolbox.inc.xhtml
@@ -918,16 +918,18 @@
                   label="&watchThreadMenu.label;"
                   accesskey="&watchThreadMenu.accesskey;"
                   type="checkbox"
                   command="cmd_watchThread"
                   key="key_watchThread"/>
       </menupopup>
     </menu>
 
+#include ../../../calendar/lightning/content/calendar-menu-events-tasks.inc.xhtml
+
     <!-- Tools -->
     <menu id="tasksMenu" label="&tasksMenu.label;" accesskey="&tasksMenu.accesskey;">
       <menupopup id="taskPopup" onpopupshowing="document.commandDispatcher.updateCommands('create-menu-tasks')">
 #ifndef XP_MACOSX
         <menuitem hidden="true" accesskey="&messengerCmd.accesskey;" label="&messengerCmd.label;"
                   key="key_mail" oncommand="toMessengerWindow();" id="tasksMenuMail" class="menuitem-iconic menu-iconic"/>
         <menuitem id="addressBook"
                   label="&addressBookCmd.label;"