Bug 1620123 - Do not include calendar menus and menu items in message windows. r=darktrojan
authorPaul Morris <paul@thunderbird.net>
Fri, 06 Mar 2020 22:28:05 +0200
changeset 37493 5b32371fa02fda770b355a4b66fb776bc6d7d5c1
parent 37492 ee485dde2e34c34cb3f91d20ecbd18768c2c0a05
child 37494 2b796fcf4c593ec9802e5045dd2491bef26151bb
push id2566
push userclokep@gmail.com
push dateMon, 09 Mar 2020 19:20:31 +0000
treeherdercomm-beta@a352facfa0a4 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdarktrojan
bugs1620123
Bug 1620123 - Do not include calendar menus and menu items in message windows. r=darktrojan
mail/base/content/mainNavigationToolbox.inc.xhtml
mail/components/customizableui/content/panelUI.inc.xhtml
--- a/mail/base/content/mainNavigationToolbox.inc.xhtml
+++ b/mail/base/content/mainNavigationToolbox.inc.xhtml
@@ -45,31 +45,33 @@
           <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"/>
+#ifdef MAIN_WINDOW
               <menuitem id="calendar-new-event-menuitem"
                         class="hide-when-calendar-deactivated"
                         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"
                         class="hide-when-calendar-deactivated"
                         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"
                              class="hide-when-calendar-deactivated"
                              observes="menu_newFolder"/>
+#endif
               <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"/>
@@ -89,20 +91,22 @@
               <menuitem id="newFeedAccountMenuItem"
                         label="&newFeedAccountCmd.label;"
                         accesskey="&newFeedAccountCmd.accesskey;"
                         oncommand="AddFeedAccount();"/>
               <menuitem id="newAccountMenuItem"
                         label="&newOtherAccountsCmd.label;"
                         accesskey="&newOtherAccountsCmd.accesskey;"
                         oncommand="MsgAccountWizard();"/>
+#ifdef MAIN_WINDOW
               <menuitem id="calendar-new-calendar-menuitem"
                         label="&lightning.menupopup.new.calendar.label;"
                         command="calendar_new_calendar_command"
                         accesskey="&lightning.menupopup.new.calendar.accesskey;"/>
+#endif
               <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;"
@@ -114,40 +118,44 @@
                 label="&openMenuCmd.label;"
                 accesskey="&openMenuCmd.accesskey;">
             <menupopup id="menu_OpenPopup">
               <menuitem id="openMessageFileMenuitem"
                         label="&openMessageFileCmd.label;"
                         class="menuitem-iconic"
                         accesskey="&openMessageFileCmd.accesskey;"
                         oncommand="MsgOpenFromFile();"/>
+#ifdef MAIN_WINDOW
               <menuitem id="calendar-open-calendar-file-menuitem"
                         label="&lightning.menupopup.open.calendar.label;"
                         accesskey="&lightning.menupopup.open.calendar.accesskey;"
                         oncommand="openLocalCalendar();"/>
+#endif
             </menupopup>
           </menu>
           <menuitem id="menu_close"
                     label="&closeCmd.label;"
                     key="key_close"
                     accesskey="&closeCmd.accesskey;"
                     command="cmd_close"
                     class="menuitem-iconic"/>
           <menuseparator id="fileMenuAfterCloseSeparator"/>
+#ifdef MAIN_WINDOW
           <menuitem id="calendar-save-menuitem"
                     class="hide-when-calendar-deactivated"
                     label="&event.menu.item.save.label;"
                     accesskey="&event.menu.item.save.tab.accesskey;"
                     key="save-key"
                     command="cmd_save"/>
           <menuitem id="calendar-save-and-close-menuitem"
                     class="hide-when-calendar-deactivated"
                     label="&event.menu.item.saveandclose.label;"
                     accesskey="&event.menu.item.saveandclose.tab.accesskey;"
                     command="cmd_accept"/>
+#endif
           <menu id="menu_saveAs" class="menu-iconic menuitem-iconic"
                 label="&saveAsMenu.label;" accesskey="&saveAsMenu.accesskey;">
             <menupopup id="menu_SavePopup">
               <menuitem id="menu_saveAsFile" label="&saveAsFileCmd.label;"
                accesskey="&saveAsFileCmd.accesskey;"
                key="key_saveAsFile"
                command="cmd_saveAsFile"/>
               <menuitem id="menu_saveAsTemplate" label="&saveAsTemplateCmd.label;"
@@ -346,20 +354,22 @@
                   type="checkbox"
                   label="&menuFavoriteFolder.label;"
                   accesskey="&menuFavoriteFolder.accesskey;"
                   checked="false"
                   oncommand="ToggleFavoriteFolderFlag();"/>
         <menuitem id="menu_properties" label="&folderPropsCmd2.label;"
                   accesskey="&folderPropsCmd.accesskey;"
                   command="cmd_properties"/>
+#ifdef MAIN_WINDOW
         <menuitem id="calendar-properties-menuitem"
                   label="&calendar.properties.label;"
                   accesskey="&calendar.properties.accesskey;"
                   command="calendar_edit_calendar_command"/>
+#endif
 #ifdef XP_UNIX
 #ifndef XP_MACOSX
         <menuitem id="menu_accountmgr"
                   label="&accountManagerCmd2.label;"
                   accesskey="&accountManagerCmdUnix2.accesskey;"
                   oncommand="MsgAccountManager(null);"/>
         <menuitem id="menu_preferences"
                   oncommand="openOptionsDialog()"
@@ -448,17 +458,19 @@
             <menuitem id="menu_compactFolderView"
                       label="&compactVersion.label;"
                       accesskey="&compactVersion.accesskey;"
                       type="checkbox"
                       oncommand="gFolderTreeView.toggleCompact(this.getAttribute('checked') == 'true');"/>
           </menupopup>
         </menu>
 
+#ifdef MAIN_WINDOW
 #include ../../../calendar/lightning/content/calendar-view-menu.inc.xhtml
+#endif
 
         <menuseparator id="viewSortMenuSeparator"/>
         <menu id="viewSortMenu" accesskey="&sortMenu.accesskey;" label="&sortMenu.label;">
           <menupopup id="menu_viewSortPopup" onpopupshowing="InitViewSortByMenu()">
             <menuitem id="sortByDateMenuitem" type="radio" name="sortby" label="&sortByDateCmd.label;" accesskey="&sortByDateCmd.accesskey;" oncommand="MsgSortThreadPane('byDate')"/>
             <menuitem id="sortByReceivedMenuitem" type="radio" name="sortby" label="&sortByReceivedCmd.label;" accesskey="&sortByReceivedCmd.accesskey;" oncommand="MsgSortThreadPane('byReceived')"/>
             <menuitem id="sortByFlagMenuitem" type="radio" name="sortby" label="&sortByStarCmd.label;" accesskey="&sortByStarCmd.accesskey;" oncommand="MsgSortThreadPane('byFlagged')"/>
             <menuitem id="sortByOrderReceivedMenuitem" type="radio" name="sortby" label="&sortByOrderReceivedCmd.label;"  accesskey="&sortByOrderReceivedCmd.accesskey;" oncommand="MsgSortThreadPane('byId')"/>
@@ -657,16 +669,17 @@
                         accesskey="&nextStarredMsgCmd.accesskey;"
                         command="cmd_nextFlaggedMsg"/>
               <menuseparator id="goNextAfterFlaggedSeparator"/>
               <menuitem id="menu_nextUnreadThread"
                         label="&nextUnreadThread.label;"
                         accesskey="&nextUnreadThread.accesskey;"
                         command="cmd_nextUnreadThread"
                         key="key_nextUnreadThread"/>
+#ifdef MAIN_WINDOW
               <menuseparator id="goNextAfterUnreadThreadSeparator"
                              class="hide-when-calendar-deactivated"/>
               <!-- Label is set up automatically using the view id. When writing
                    a view extension, add a `label-<myviewtype>` attribute with
                    the correct label. -->
               <menuitem id="calendar-go-menu-next"
                         class="hide-when-calendar-deactivated"
                         label=""
@@ -674,16 +687,17 @@
                         label-week="&lightning.toolbar.week.label;"
                         label-multiweek="&lightning.toolbar.week.label;"
                         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_next_command"/>
+#endif
             </menupopup>
           </menu>
           <menu id="goPreviousMenu" label="&prevMenu.label;" accesskey="&prevMenu.accesskey;">
             <menupopup id="menu_GoPreviousPopup">
               <menuitem id="menu_prevMsg"
                         label="&prevMsgCmd.label;"
                         accesskey="&prevMsgCmd.accesskey;"
                         command="cmd_previousMsg"
@@ -692,16 +706,17 @@
                         label="&prevUnreadMsgCmd.label;"
                         accesskey="&prevUnreadMsgCmd.accesskey;"
                         command="cmd_previousUnreadMsg"
                         key="key_previousUnreadMsg"/>
               <menuitem id="menu_prevFlaggedMsg"
                         label="&prevStarredMsgCmd.label;"
                         accesskey="&prevStarredMsgCmd.accesskey;"
                         command="cmd_previousFlaggedMsg"/>
+#ifdef MAIN_WINDOW
               <menuseparator id="goPreviousAfterFlaggedSeparator"
                              class="hide-when-calendar-deactivated"/>
               <!-- Label is set up automatically using the view id. When writing
                    a view extension, add a `label-<myviewtype>` attribute with
                    the correct label. -->
               <menuitem id="calendar-go-menu-previous"
                         class="hide-when-calendar-deactivated"
                         label=""
@@ -709,33 +724,36 @@
                         label-week="&lightning.toolbar.week.label;"
                         label-multiweek="&lightning.toolbar.week.label;"
                         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"/>
+#endif
             </menupopup>
           </menu>
           <menuitem id="menu_goForward" label="&goForwardCmd.label;"
                     accesskey="&goForwardCmd.accesskey;" command="cmd_goForward"
                     key="key_goForward"
                     class="menuitem-iconic"/>
           <menuitem id="menu_goBack" label="&goBackCmd.label;"
                     accesskey="&goBackCmd.accesskey;" command="cmd_goBack"
                     key="key_goBack"
                     class="menuitem-iconic"/>
           <menuseparator id="goNextSeparator"/>
+#ifdef MAIN_WINDOW
           <menuitem id="calendar-go-to-today-menuitem"
                     class="hide-when-calendar-deactivated"
                     label="&goTodayCmd.label;"
                     accesskey="&goTodayCmd.accesskey;"
                     command="calendar_go_to_today_command"
                     key="calendar-go-to-today-key"/>
+#endif
           <menuitem id="menu_goChat" label="&goChatCmd.label;"
                     accesskey="&goChatCmd.accesskey;"
                     command="cmd_chat"
                     key="key_goChat"/>
           <menuseparator id="goChatSeparator"/>
           <menu id="goFolderMenu"
                 label="&folderMenu.label;"
                 accesskey="&folderMenu.accesskey;"
@@ -1008,17 +1026,19 @@
                   label="&watchThreadMenu.label;"
                   accesskey="&watchThreadMenu.accesskey;"
                   type="checkbox"
                   command="cmd_watchThread"
                   key="key_watchThread"/>
       </menupopup>
     </menu>
 
+#ifdef MAIN_WINDOW
 #include ../../../calendar/lightning/content/calendar-menu-events-tasks.inc.xhtml
+#endif
 
     <!-- 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"
--- a/mail/components/customizableui/content/panelUI.inc.xhtml
+++ b/mail/components/customizableui/content/panelUI.inc.xhtml
@@ -120,21 +120,23 @@
                        label="&goMenu.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appMenu-goView', this)"/>
         <toolbarbutton id="appmenu_messageMenu"
                        class="subviewbutton subviewbutton-nav"
                        label="&msgMenu.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appMenu-messageView', this)"/>
+#ifdef MAIN_WINDOW
         <toolbarbutton id="appmenu_Event_Task"
                        class="subviewbutton subviewbutton-nav hide-when-calendar-deactivated"
                        label="&lightning.menu.eventtask.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appmenu_Event_Task_View', this)"/>
+#endif
         <toolbarbutton id="appmenu_tasksMenu"
                        class="subviewbutton subviewbutton-nav"
                        label="&tasksMenu.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appMenu-toolsView', this)"/>
         <toolbarbutton id="appmenu_help"
                        class="subviewbutton subviewbutton-iconic subviewbutton-nav"
                        label="&helpMenuWin.label;"
@@ -159,27 +161,29 @@
                class="PanelUI-subView">
       <vbox id="appMenu-newViewItems"
             class="panel-subview-body">
         <toolbarbutton id="appmenu_newNewMsgCmd"
                        class="subviewbutton subviewbutton-iconic"
                        label="&newNewMsgCmd.label;"
                        key="key_newMessage2"
                        command="cmd_newMessage"/>
+#ifdef MAIN_WINDOW
         <toolbarbutton id="appmenu_calendar-new-event-menu-item"
                        class="subviewbutton subviewbutton-iconic hide-when-calendar-deactivated"
                        label="&lightning.menupopup.new.event.label;"
                        command="calendar_new_event_command"/>
         <toolbarbutton id="appmenu_calendar-new-task-menu-item"
                        class="subviewbutton subviewbutton-iconic hide-when-calendar-deactivated"
                        label="&lightning.menupopup.new.task.label;"
                        command="calendar_new_todo_command"/>
         <toolbarseparator id="appmenu_calendar-after-new-task-separator"
                           class="hide-when-calendar-deactivated"
                           observes="appmenu_newFolder"/>
+#endif
         <toolbarbutton id="appmenu_newFolder"
                        class="subviewbutton subviewbutton-iconic"
                        label="&newFolderCmd.label;"
                        command="cmd_newFolder"/>
         <toolbarbutton id="appmenu_newVirtualFolder"
                        class="subviewbutton subviewbutton-iconic"
                        label="&newVirtualFolderCmd.label;"
                        command="cmd_newVirtualFolder"/>
@@ -200,20 +204,22 @@
                        class="subviewbutton subviewbutton-iconic"
                        label="&newFeedAccountCmd.label;"
                        accesskey="&newFeedAccountCmd.accesskey;"
                        oncommand="AddFeedAccount();"/>
         <toolbarbutton id="appmenu_newAccountMenuItem"
                        class="subviewbutton subviewbutton-iconic"
                        label="&newOtherAccountsCmd.label;"
                        oncommand="MsgAccountWizard();"/>
+#ifdef MAIN_WINDOW
         <toolbarbutton id="appmenu_calendar-new-calendar-menu-item"
                        class="subviewbutton subviewbutton-iconic"
                        label="&lightning.menupopup.new.calendar.label;"
                        command="calendar_new_calendar_command"/>
+#endif
         <toolbarseparator id="appmenu_newPopupMenuSeparator"/>
         <toolbarbutton id="appmenu_newCard"
                        class="subviewbutton subviewbutton-iconic"
                        label="&appmenuNewContactCmd.label;"
                        command="cmd_newCard"/>
         <toolbarbutton id="appmenu_newIMContactMenuItem"
                        class="subviewbutton subviewbutton-iconic"
                        label="&newIMContactCmd.label;"
@@ -657,16 +663,17 @@
                class="PanelUI-subView">
       <vbox id="appMenu-viewViewItems"
             class="panel-subview-body">
         <toolbarbutton id="appmenu_FolderViews"
                        class="subviewbutton subviewbutton-nav"
                        label="&folderView.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appMenu-foldersView', this)"/>
+#ifdef MAIN_WINDOW
         <toolbarseparator id="appmenu_calendar-view-menu-separator"
                           class="hide-when-calendar-deactivated"/>
         <toolbarbutton id="appmenu_calendar-today-pane-menu"
                       class="subviewbutton subviewbutton-nav hide-when-calendar-deactivated"
                       label="&calendar.context.button.label;"
                       closemenu="none"
                       oncommand="PanelUI.showSubView('appmenu_calendar-today-pane-view', this)"/>
         <toolbarbutton id="appmenu_calendar-calendar-menu"
@@ -676,16 +683,17 @@
                       closemenu="none"
                       oncommand="PanelUI.showSubView('appmenu_calendar-calendar-view', this)"/>
         <toolbarbutton id="appmenu_calendar-tasks-menu"
                       class="subviewbutton subviewbutton-nav hide-when-calendar-deactivated"
                       observes="calendar_mode_task"
                       label="&lightning.menu.view.tasks.label;"
                       closemenu="none"
                       oncommand="PanelUI.showSubView('appmenu_calendar-tasks-view', this)"/>
+#endif
         <toolbarseparator id="appmenu_viewSortMenuSeparator"/>
         <toolbarbutton id="appmenu_viewSortMenu"
                        class="subviewbutton subviewbutton-nav"
                        label="&sortMenu.label;"
                        closemenu="none"
                        oncommand="PanelUI.showSubView('appMenu-viewSortByView', this)"/>
         <toolbarbutton id="appmenu_viewMessageViewMenu"
                        class="subviewbutton subviewbutton-nav"
@@ -1225,20 +1233,22 @@
                        key="key_goForward"
                        command="cmd_goForward"/>
         <toolbarbutton id="appmenu_goBack"
                        class="subviewbutton subviewbutton-iconic"
                        label="&goBackCmd.label;"
                        key="key_goBack"
                        command="cmd_goBack"/>
         <toolbarseparator id="appmenu_goNextSeparator"/>
+#ifdef MAIN_WINDOW
         <toolbarbutton id="appmenu_calendar-go-to-today"
                        class="subviewbutton subviewbutton-iconic hide-when-calendar-deactivated"
                        label="&goTodayCmd.label;"
                        command="calendar_go_to_today_command"/>
+#endif
         <toolbarbutton id="appmenu_goChat"
                        class="subviewbutton subviewbutton-iconic"
                        label="&goChatCmd.label;"
                        key="key_goChat"
                        command="cmd_chat"/>
         <toolbarseparator id="appmenu_goChatSeparator"/>
         <toolbarbutton id="appmenu_goFolderMenu"
                        class="subviewbutton subviewbutton-nav"
@@ -1282,29 +1292,31 @@
                        label="&nextStarredMsgCmd.label;"
                        command="cmd_nextFlaggedMsg"/>
         <toolbarseparator id="appmenu_goNextAfterFlaggedSeparator"/>
         <toolbarbutton id="appmenu_nextUnreadThread"
                        class="subviewbutton subviewbutton-iconic"
                        label="&nextUnreadThread.label;"
                        key="key_nextUnreadThread"
                        command="cmd_nextUnreadThread"/>
+#ifdef MAIN_WINDOW
         <toolbarseparator id="appmenu_GoNextAfterUnreadThreadSeparator"
                           class="hide-when-calendar-deactivated"/>
         <!-- Label is set up automatically using the view id. When writing a
              view extension, add a `label-<myviewtype>` attribute with the
              correct label. -->
         <toolbarbutton id="appmenu_calendar-go-menu-next"
                        class="subviewbutton subviewbutton-iconic hide-when-calendar-deactivated"
                        label=""
                        label-day="&lightning.toolbar.day.label;"
                        label-week="&lightning.toolbar.week.label;"
                        label-multiweek="&lightning.toolbar.week.label;"
                        label-month="&lightning.toolbar.month.label;"
                        command="calendar_view_next_command"/>
+#endif
       </vbox>
     </panelview>
 
     <!-- Go / Previous -->
     <panelview id="appMenu-goPreviousView"
                title="&prevMenu.label;"
                class="PanelUI-subView">
       <vbox id="appMenu-goPreviousViewItems"
@@ -1318,29 +1330,31 @@
                        class="subviewbutton subviewbutton-iconic"
                        label="&prevUnreadMsgCmd.label;"
                        key="key_previousUnreadMsg"
                        command="cmd_previousUnreadMsg"/>
         <toolbarbutton id="appmenu_prevFlaggedMsg"
                        class="subviewbutton subviewbutton-iconic"
                        label="&prevStarredMsgCmd.label;"
                        command="cmd_previousFlaggedMsg"/>
+#ifdef MAIN_WINDOW
         <toolbarseparator id="appmenu_goPreviousAfterFlaggedSeparator"
                           class="hide-when-calendar-deactivated"/>
         <!-- Label is set up automatically using the view id. When writing a
              view extension, add a `label-<myviewtype>` attribute with the
              correct label. -->
         <toolbarbutton id="appmenu_calendar-go-menu-previous"
                        class="subviewbutton subviewbutton-iconic hide-when-calendar-deactivated"
                        label=""
                        label-day="&lightning.toolbar.day.label;"
                        label-week="&lightning.toolbar.week.label;"
                        label-multiweek="&lightning.toolbar.week.label;"
                        label-month="&lightning.toolbar.month.label;"
                        command="calendar_view_prev_command"/>
+#endif
       </vbox>
     </panelview>
 
     <!-- Go / Folder -->
     <!-- toolbarbuttons are dynamically added by folder-panelview custom element. -->
     <panelview is="folder-panelview" id="appMenu-goFolderView"
                title="&folderMenu.label;"
                class="PanelUI-subView"
@@ -1813,12 +1827,14 @@
         <toolbarseparator/>
         <toolbarbutton id="appmenu_about"
                        class="subviewbutton subviewbutton-iconic"
                        label="&aboutProduct2.label;"
                        oncommand="openAboutDialog();"/>
       </vbox>
     </panelview>
 
+#ifdef MAIN_WINDOW
 #include ../../../../calendar/lightning/content/calendar-appmenu-panelviews.inc.xhtml
+#endif
 
   </panelmultiview>
 </panel>