Bug 1589005 - Let default 'Home' calendar be disabled by default. r=darktrojan
☠☠ backed out by 6b7f4b4acf12 ☠ ☠
authorPaul Morris <paul@thunderbird.net>
Wed, 04 Mar 2020 17:08:06 -0500
changeset 38499 7b3549479ead955071d25aa89e17e0ae50b95082
parent 38498 d3be91942e370b708a1ff63bab301528ff4bbd44
child 38500 4c328c3d6c01f5c09d2259963034cae8135af160
push id400
push userclokep@gmail.com
push dateMon, 04 May 2020 18:56:09 +0000
reviewersdarktrojan
bugs1589005
Bug 1589005 - Let default 'Home' calendar be disabled by default. r=darktrojan
calendar/base/content/calendar-management.js
calendar/base/modules/calCalendarDeactivator.jsm
mail/base/content/messenger.xhtml
--- a/calendar/base/content/calendar-management.js
+++ b/calendar/base/content/calendar-management.js
@@ -405,16 +405,18 @@ function loadCalendarManager() {
  * Creates the initial "Home" calendar if no calendar exists.
  */
 function initHomeCalendar() {
   let calMgr = cal.getCalendarManager();
   let composite = cal.view.getCompositeCalendar(window);
   let url = Services.io.newURI("moz-storage-calendar://");
   let homeCalendar = calMgr.createCalendar("storage", url);
   homeCalendar.name = cal.l10n.getCalString("homeCalendarName");
+  homeCalendar.setProperty("disabled", true);
+
   calMgr.registerCalendar(homeCalendar);
   Services.prefs.setStringPref("calendar.list.sortOrder", homeCalendar.id);
   composite.addCalendar(homeCalendar);
 
   // Wrapping this in a try/catch block, as if any of the migration code
   // fails, the app may not load.
   if (Services.prefs.getBoolPref("calendar.migrator.enabled", true)) {
     try {
--- a/calendar/base/modules/calCalendarDeactivator.jsm
+++ b/calendar/base/modules/calCalendarDeactivator.jsm
@@ -45,18 +45,18 @@ var calendarDeactivator = {
    */
   registerWindow(window) {
     if (this.calendars === null) {
       this.initializeDeactivator();
     }
     this.windows.add(window);
     window.addEventListener("unload", () => this.windows.delete(window));
 
-    if (!this.isCalendarActivated) {
-      window.document.documentElement.setAttribute("calendar-deactivated", "");
+    if (this.isCalendarActivated) {
+      window.document.documentElement.removeAttribute("calendar-deactivated");
     }
   },
 
   /**
    * Check the enabled state of all of the user's calendars.
    *
    * @return {boolean} True if any calendars are enabled, false if all are disabled.
    */
--- a/mail/base/content/messenger.xhtml
+++ b/mail/base/content/messenger.xhtml
@@ -117,17 +117,18 @@
         onunload="OnUnloadMessenger()"
         onresize="OnResizeExpandedHeaderView()"
         screenX="10" screenY="10"
         persist="width height screenX screenY sizemode"
         toggletoolbar="true"
         windowtype="mail:3pane"
         macanimationtype="document"
         lightweightthemes="true"
-        fullscreenbutton="true">
+        fullscreenbutton="true"
+        calendar-deactivated="">
 
 <stringbundle id="bundle_brand" src="chrome://branding/locale/brand.properties"/>
 <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
 <stringbundle id="bundle_search" src="chrome://messenger/locale/search.properties"/>
 <stringbundle id="chatBundle" src="chrome://messenger/locale/chat.properties"/>
 <stringbundle id="bundle_dateformat" src="chrome://chat/locale/dateFormat.properties"/>
 <stringbundle id="bundle_places" src="chrome://places/locale/places.properties"/>
 <stringbundle id="bundle_editContact" src="chrome://messenger/locale/editContactOverlay.properties"/>