No bug yet - Remove remaining Sunbird code. try: -b do -p all -u all -t none draft
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 14 Mar 2014 16:15:50 +0100
changeset 23453 c6282d3535071d29090bd4ba83a94d420e6faee4
parent 23452 27516289f0889bdea3877e5908e890bb79da543b
push id1331
push userarchaeopteryx@coole-files.de
push dateFri, 14 Mar 2014 18:50:01 +0000
treeherdertry-comm-central@c6282d353507 [default view] [failures only]
No bug yet - Remove remaining Sunbird code. try: -b do -p all -u all -t none
calendar/base/content/calendar-chrome-startup.js
calendar/base/content/calendar-common-sets.js
calendar/base/content/calendar-task-tree.js
calendar/base/content/calendar-unifinder-todo.js
calendar/base/content/calendar-views.js
calendar/base/content/dialogs/calendar-alarm-dialog.js
calendar/base/content/dialogs/calendar-event-dialog.js
calendar/base/content/dialogs/calendar-event-dialog.xul
calendar/base/content/dialogs/calendar-migration-dialog.js
calendar/base/content/dialogs/calendar-migration-dialog.xul
calendar/base/content/today-pane.js
calendar/base/jar.mn
calendar/base/modules/calProviderUtils.jsm
calendar/base/src/calAlarmService.js
calendar/base/src/calApplicationUtils.js
calendar/base/src/calCalendarManager.js
calendar/base/src/calUtils.js
calendar/lightning/jar.mn
calendar/locales/en-US/README.txt
calendar/locales/en-US/chrome/calendar/calendar.properties
calendar/locales/filter.py
calendar/locales/l10n-1.9.2.ini
calendar/locales/l10n.ini
calendar/providers/gdata/content/gdata-migration.js
calendar/providers/gdata/install.rdf
calendar/providers/gdata/jar.mn
calendar/resources/content/calendar.js
calendar/resources/content/calendarService.js
calendar/resources/content/calendarService.manifest
calendar/resources/jar.mn
calendar/resources/moz.build
calendar/timezones/install.rdf
--- a/calendar/base/content/calendar-chrome-startup.js
+++ b/calendar/base/content/calendar-chrome-startup.js
@@ -12,17 +12,17 @@ Components.utils.import("resource://gre/
 function commonInitCalendar() {
     // Move around toolbarbuttons and whatever is needed in the UI.
     migrateCalendarUI();
 
     // Load the Calendar Manager
     loadCalendarManager();
 
     // Restore the last shown calendar view
-    switchCalendarView(getLastCalendarView(), false);
+    ltnSwitchCalendarView(getLastCalendarView(), false);
 
     // set up the unifinder
     prepareCalendarToDoUnifinder();
 
     // Make sure we update ourselves if the program stays open over midnight
     scheduleMidnightUpdate(refreshUIBits);
 
     // Set up the command controller from calendar-common-sets.js
--- a/calendar/base/content/calendar-common-sets.js
+++ b/calendar/base/content/calendar-common-sets.js
@@ -233,18 +233,17 @@ var calendarController = {
                                  return this.writable &&
                                         this.todo_items_selected &&
                                         this.todo_items_writable;
                             }
                         }
                     }
 
                     // If calendar is not in foreground, let the default controller take
-                    // care. If we don't have a default controller (i.e sunbird), just
-                    // continue.
+                    // care. If we don't have a default controller, just continue.
                     if (this.defaultController.supportsCommand(aCommand)) {
                         return this.defaultController.isCommandEnabled(aCommand);
                     }
                 }
                 if (aCommand in this.commands) {
                     // All other commands we support should be enabled by default
                     return true;
                 }
@@ -384,26 +383,26 @@ var calendarController = {
             case "calendar_toggle_orientation_command":
                 toggleOrientation();
                 break;
             case "calendar_toggle_workdays_only_command":
                 toggleWorkdaysOnly();
                 break;
 
             case "calendar_day-view_command":
-                switchCalendarView("day", true);
+                ltnSwitchCalendarView("day", true);
                 break;
             case "calendar_week-view_command":
-                switchCalendarView("week", true);
+                ltnSwitchCalendarView("week", true);
                 break;
             case "calendar_multiweek-view_command":
-                switchCalendarView("multiweek", true);
+                ltnSwitchCalendarView("multiweek", true);
                 break;
             case "calendar_month-view_command":
-                switchCalendarView("month", true);
+                ltnSwitchCalendarView("month", true);
                 break;
             case "calendar_attendance_command":
                 // This command is actually handled inline, since it takes a value
                 break;
 
             case "cmd_selectAll":
                 if (!this.todo_tasktree_focused &&
                     this.defaultController && !this.isCalendarInForeground()) {
@@ -413,43 +412,40 @@ var calendarController = {
                 } else {
                     selectAllItems();
                 }
                 break;
 
             default:
                 if (this.defaultController && !this.isCalendarInForeground()) {
                     // If calendar is not in foreground, let the default controller take
-                    // care. If we don't have a default controller (i.e sunbird), just
-                    // continue.
+                    // care. If we don't have a default controller, just continue.
                     this.defaultController.doCommand(aCommand);
                     return;
                 }
 
         }
         return;
     },
 
     onEvent: function cC_onEvent(aEvent) {
     },
 
     isCalendarInForeground: function cC_isCalendarInForeground() {
-        // For sunbird, calendar is always in foreground. Otherwise check if
-        // we are in the correct mode.
-        return isSunbird() || (gCurrentMode && gCurrentMode != "mail");
+        return gCurrentMode && gCurrentMode != "mail";
     },
 
     isInMode: function cC_isInMode(mode) {
         switch (mode) {
             case "mail":
                 return !isCalendarInForeground();
             case "calendar":
-                return isSunbird() || (gCurrentMode && gCurrentMode == "calendar");
+                return gCurrentMode && gCurrentMode == "calendar";
             case "task":
-                return !isSunbird() && (gCurrentMode && gCurrentMode == "task");
+                return gCurrentMode && gCurrentMode == "task";
         }
         return false;
     },
 
     onSelectionChanged: function cC_onSelectionChanged(aEvent) {
         var selectedItems = aEvent.detail;
 
         calendarUpdateDeleteCommand(selectedItems);
@@ -489,19 +485,17 @@ var calendarController = {
 
         calendarController.selected_events_requires_network =
               (selected_events_requires_network == selLength);
         calendarController.selected_events_invitation =
               (selected_events_invitation == selLength);
 
         calendarController.updateCommands();
         calendarController2.updateCommands();
-        if(!isSunbird()) {
-            document.commandDispatcher.updateCommands('mail-toolbar');
-        }
+        document.commandDispatcher.updateCommands('mail-toolbar');
     },
 
     /**
      * Condition Helpers
      */
 
     // These attributes will be set up manually.
     item_selected: false,
@@ -745,17 +739,17 @@ var calendarController2 = {
                 return calendarController.isInMode("task");
             default:
                 return true;
         }
     },
 
     doCommand: function doCommand(aCommand) {
         switch (aCommand) {
-            // These commands are overridden in lightning and native in sunbird.
+            // These commands are overridden.
             case "cmd_cut":
                 cutToClipboard();
                 break;
             case "cmd_copy":
                 copyToClipboard();
                 break;
             case "cmd_paste":
                 pasteFromClipboard();
@@ -803,34 +797,29 @@ var calendarController2 = {
 };
 
 /**
  * Inserts the command controller into the document. On Lightning, also make
  * sure that it is inserted before the conflicting thunderbird command
  * controller.
  */
 function injectCalendarCommandController() {
-    if (!isSunbird()) {
-        // We need to put our new command controller *before* the one that
-        // gets installed by thunderbird. Since we get called pretty early
-        // during startup we need to install the function below as a callback
-        // that periodically checks when the original thunderbird controller
-        // gets alive. Please note that setTimeout with a value of 0 means that
-        // we leave the current thread in order to re-enter the message loop.
+    // We need to put our new command controller *before* the one that
+    // gets installed by thunderbird. Since we get called pretty early
+    // during startup we need to install the function below as a callback
+    // that periodically checks when the original thunderbird controller
+    // gets alive. Please note that setTimeout with a value of 0 means that
+    // we leave the current thread in order to re-enter the message loop.
 
-        let tbController = top.controllers.getControllerForCommand("cmd_runJunkControls");
-        if (!tbController) {
-            setTimeout(injectCalendarCommandController, 0);
-            return;
-        } else {
-            calendarController.defaultController = tbController;
-        }
+    let tbController = top.controllers.getControllerForCommand("cmd_runJunkControls");
+    if (!tbController) {
+        setTimeout(injectCalendarCommandController, 0);
+        return;
     } else {
-        // On Sunbird, we also need to set up our hacky command controller.
-        top.controllers.insertControllerAt(0, calendarController2);
+        calendarController.defaultController = tbController;
     }
 
     // This needs to be done for all applications
     top.controllers.insertControllerAt(0, calendarController);
     document.commandDispatcher.updateCommands("calendar_commands");
 }
 
 /**
@@ -882,23 +871,23 @@ function setupContextItemType(event, ite
  * Shows the given date in the current view, if in calendar mode.
  *
  * XXX This function is misplaced, should go to calendar-views.js or a minimonth
  * specific js file.
  *
  * @param aNewDate      The new date as a JSDate.
  */
 function minimonthPick(aNewDate) {
-  if (cal.isSunbird() || gCurrentMode == "calendar" || gCurrentMode == "task") {
+  if (gCurrentMode == "calendar" || gCurrentMode == "task") {
       let cdt = cal.jsDateToDateTime(aNewDate, currentView().timezone);
       cdt.isDate = true;
       currentView().goToDay(cdt);
 
       // update date filter for task tree
-      let tree = document.getElementById(cal.isSunbird() ? "unifinder-todo-tree" : "calendar-task-tree");
+      let tree = document.getElementById("calendar-task-tree");
       tree.updateFilter();
   }
 }
 
 /**
  * Selects all items, based on which mode we are currently in and what task tree is focused
  */
 function selectAllItems() {
--- a/calendar/base/content/calendar-task-tree.js
+++ b/calendar/base/content/calendar-task-tree.js
@@ -31,30 +31,29 @@ function addCalendarNames(aEvent) {
  * Change the opening context menu for the selected tasks.
  *
  * @param aEvent    The popupshowing event of the opening menu.
  */
 function changeContextMenuForTask(aEvent) {
     handleTaskContextMenuStateChange(aEvent);
 
     let idnode = document.popupNode.id;
-    let sunbird = cal.isSunbird();
     let items = getSelectedTasks(aEvent);
     document.getElementById("task-context-menu-new").hidden =
-        (idnode == "unifinder-todo-tree" && !sunbird);
+        (idnode == "unifinder-todo-tree");
     document.getElementById("task-context-menu-modify").hidden =
-        (idnode == "unifinder-todo-tree" && !sunbird);
+        (idnode == "unifinder-todo-tree");
     document.getElementById("task-context-menu-new-todaypane").hidden =
-        (idnode == "calendar-task-tree" || sunbird);
+        (idnode == "calendar-task-tree");
     document.getElementById("task-context-menu-modify-todaypane").hidden =
-        (idnode == "calendar-task-tree" || sunbird);
+        (idnode == "calendar-task-tree");
     document.getElementById("task-context-menu-filter-todaypane").hidden =
-        (idnode == "calendar-task-tree" || sunbird);
+        (idnode == "calendar-task-tree");
     document.getElementById("task-context-menu-separator-filter").hidden =
-        (idnode == "calendar-task-tree" || sunbird);
+        (idnode == "calendar-task-tree");
 
     let tasksSelected = (items.length > 0);
     applyAttributeToMenuChildren(aEvent.target, "disabled", (!tasksSelected));
     if (calendarController.isCommandEnabled("calendar_new_todo_command") &&
         calendarController.isCommandEnabled("calendar_new_todo_todaypane_command")) {
         document.getElementById("calendar_new_todo_command").removeAttribute("disabled");
         document.getElementById("calendar_new_todo_todaypane_command").removeAttribute("disabled");
     } else {
--- a/calendar/base/content/calendar-unifinder-todo.js
+++ b/calendar/base/content/calendar-unifinder-todo.js
@@ -1,20 +1,16 @@
 /* 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/. */
 
 /**
  * Called when the window is loaded to set up the unifinder-todo.
  */
 function prepareCalendarToDoUnifinder() {
-    if (isSunbird()) {
-        document.getElementById("todo-label").removeAttribute("collapsed");
-    }
-
     // add listener to update the date filters
     getViewDeck().addEventListener("dayselect", updateCalendarToDoUnifinder, false);
 
     updateCalendarToDoUnifinder();
 }
 
 /**
  * Updates the applied filter and show completed view of the unifinder todo.
--- a/calendar/base/content/calendar-views.js
+++ b/calendar/base/content/calendar-views.js
@@ -236,32 +236,16 @@ var calendarViewController = {
                           ritem.oldItem,
                           null);
         }
         endBatchTransaction();
     }
 };
 
 /**
- * This function provides a neutral way to switch between views.
- *
- * @param aType     The type of view to select.
- * @param aShow     If true, the calendar view is forced to be shown, i.e.
- *                    bringing the view to the front if the application is
- *                    showing other elements (Lightning).
- */
-function switchCalendarView(aType, aShow) {
-    if (cal.isSunbird()) {
-        sbSwitchToView(aType);
-    } else {
-        ltnSwitchCalendarView(aType, aShow);
-    }
-}
-
-/**
  * This function does the common steps to switch between views. Should be called
  * from app-specific view switching functions
  *
  * @param aViewType     The type of view to select.
  */
 function switchToView(aViewType) {
     var viewDeck = getViewDeck();
     var selectedDay;
--- a/calendar/base/content/dialogs/calendar-alarm-dialog.js
+++ b/calendar/base/content/dialogs/calendar-alarm-dialog.js
@@ -60,17 +60,17 @@ function onDismissAllAlarms() {
             parentItems[node.item.parentItem.hashId] = node.item.parentItem;
             getAlarmService().dismissAlarm(node.item, node.alarm);
         }
     }
 }
 
 /**
  * Event handler fired when the alarm widget's "Details..." label was clicked.
- * Open the event dialog in the most recent Sunbird or Thunderbird window
+ * Open the event dialog in the most recent Thunderbird window.
  *
  * @param event     The itemdetails event.
  */
 function onItemDetails(event) {
     // We want this to happen in a calendar window if possible. Otherwise open
     // it using our window.
     let calWindow = cal.getCalendarWindow();
     if (calWindow) {
--- a/calendar/base/content/dialogs/calendar-event-dialog.js
+++ b/calendar/base/content/dialogs/calendar-event-dialog.js
@@ -1108,29 +1108,22 @@ function updateTitle() {
 
 /**
  * Updates the stylesheet to add rules to hide certain aspects (i.e task only
  * elements when editing an event).
  *
  * TODO We can use general rules here, i.e
  *      dialog[itemType="task"] .event-only,
  *      dialog[itemType="event"] .task-only,
- *      dialog:not([product="lightning"]) .lightning-only {
- *          display: none;
- *      }
  */
 function updateStyle() {
     const kDialogStylesheet = "chrome://calendar/skin/calendar-event-dialog.css";
 
     for each (let stylesheet in document.styleSheets) {
         if (stylesheet.href == kDialogStylesheet) {
-            if (cal.isSunbird()) {
-                stylesheet.insertRule(".lightning-only { display: none; }",
-                                      stylesheet.cssRules.length);
-            }
             if (cal.isEvent(window.calendarItem)) {
                 stylesheet.insertRule(".todo-only { display: none; }",
                                       stylesheet.cssRules.length);
             } else if (cal.isToDo(window.calendarItem)) {
                 stylesheet.insertRule(".event-only { display: none; }",
                                       stylesheet.cssRules.length);
             }
             return;
@@ -2956,32 +2949,26 @@ function onCommandCustomize() {
     for (var i = 0; i < menubar.childNodes.length; ++i) {
         menubar.childNodes[i].setAttribute("disabled", true);
     }
 
     // Disable the toolbar context menu items
     document.getElementById("cmd_customize").setAttribute("disabled", "true");
 
     var id = "event-toolbox";
-    if (isSunbird()) {
-        window.openDialog("chrome://global/content/customizeToolbar.xul",
-                          "CustomizeToolbar",
-                          "chrome,all,dependent",
-                          document.getElementById(id));
-    } else {
-        var wintype = document.documentElement.getAttribute("windowtype");
-        wintype = wintype.replace(/:/g, "");
-
-        window.openDialog("chrome://global/content/customizeToolbar.xul",
-                          "CustomizeToolbar" + wintype,
-                          "chrome,all,dependent",
-                          document.getElementById(id), // toolbar dom node
-                          false,                       // is mode toolbar yes/no?
-                          null,                        // callback function
-                          "dialog");                   // name of this mode
+    var wintype = document.documentElement.getAttribute("windowtype");
+    wintype = wintype.replace(/:/g, "");
+
+    window.openDialog("chrome://global/content/customizeToolbar.xul",
+                      "CustomizeToolbar" + wintype,
+                      "chrome,all,dependent",
+                      document.getElementById(id), // toolbar dom node
+                      false,                       // is mode toolbar yes/no?
+                      null,                        // callback function
+                      "dialog");                   // name of this mode
     }
 }
 
 /**
  * Prompts the user to change the start timezone.
  */
 function editStartTimezone() {
     editTimezone("timezone-starttime",
--- a/calendar/base/content/dialogs/calendar-event-dialog.xul
+++ b/calendar/base/content/dialogs/calendar-event-dialog.xul
@@ -285,38 +285,35 @@
                           label="&event.menu.item.new.label;"
                           accesskey="&event.menu.item.new.accesskey;">
                         <menupopup id="item-new-menupopup">
                             <menuitem id="item-new-message-menuitem"
                                       label="&event.menu.item.new.message.label;"
                                       accesskey="&event.menu.item.new.message.accesskey;"
                                       key="new-message-key"
                                       command="cmd_item_new_message"
-                                      disable-on-readonly="true"
-                                      class="lightning-only"/>
+                                      disable-on-readonly="true"/>
                             <menuitem id="item-new-event-menuitem"
                                       label="&event.menu.item.new.event.label;"
                                       accesskey="&event.menu.item.new.event.accesskey;"
                                       key="new-event-key"
                                       command="cmd_item_new_event"
                                       disable-on-readonly="true"/>
                             <menuitem id="item-new-task-menuitem"
                                       label="&event.menu.item.new.task.label;"
                                       accesskey="&event.menu.item.new.task.accesskey;"
                                       key="new-task-key"
                                       command="cmd_item_new_task"
                                       disable-on-readonly="true"/>
-                            <menuseparator id="item-new-menuseparator1"
-                                           class="lightning-only"/>
+                            <menuseparator id="item-new-menuseparator1"/>
                             <menuitem id="item-new-address-menuitem"
                                       label="&event.menu.item.new.contact.label;"
                                       accesskey="&event.menu.item.new.contact.accesskey;"
                                       command="cmd_item_new_card"
-                                      disable-on-readonly="true"
-                                      class="lightning-only"/>
+                                      disable-on-readonly="true"/>
                         </menupopup>
                     </menu>
                     <menuseparator id="item-menuseparator1"/>
                     <menuitem id="item-save-menuitem"
                               label="&event.menu.item.save.label;"
                               accesskey="&event.menu.item.save.accesskey;"
                               key="save-key"
                               command="cmd_save"/>
@@ -815,25 +812,23 @@
                        class="text-link"
                        crop="right"
                        tooltiptext=""
                        onclick="showAttendeePopup(event)"/>
             </row>
             <row id="event-grid-attendee-row-2" align="center">
                 <spacer/>
                 <checkbox id="notify-attendees-checkbox"
-                          class="lightning-only"
                           label="&newevent.attendees.notify.label;"
                           oncommand="changeUndiscloseCheckboxStatus();"
                           pack="start"/>
             </row>
             <row id="event-grid-attendee-row-3" align="center">
                 <spacer/>
                 <checkbox id="undisclose-attendees-checkbox"
-                          class="lightning-only"
                           label="&newevent.attendees.notifyundisclosed.label;"
                           tooltiptext="&newevent.attendees.notifyundisclosed.tooltip;"
                           pack="start"/>
             </row>
 
             <separator class="groove" id="event-grid-basic-separator"/>
 
             <!-- All-Day -->
deleted file mode 100644
--- a/calendar/base/content/dialogs/calendar-migration-dialog.js
+++ /dev/null
@@ -1,720 +0,0 @@
-/* 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/. */
-
-const SUNBIRD_UID = "{718e30fb-e89b-41dd-9da7-e25a45638b28}";
-const FIREFOX_UID = "{ec8030f7-c20a-464f-9b0e-13a3a9e97384}";
-
-Components.utils.import("resource://calendar/modules/calUtils.jsm");
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/Preferences.jsm");
-
-//
-// The front-end wizard bits.
-//
-var gMigrateWizard = {
-    /**
-     * Called from onload of the migrator window.  Takes all of the migrators
-     * that were passed in via window.arguments and adds them to checklist. The
-     * user can then check these off to migrate the data from those sources.
-     */
-    loadMigrators: function gmw_load() {
-        var listbox = document.getElementById("datasource-list");
-
-        //XXX Once we have branding for lightning, this hack can go away
-        var props = Services.strings.createBundle("chrome://calendar/locale/migration.properties");
-
-        if (!cal.isSunbird()) {
-            var wizard = document.getElementById("migration-wizard");
-            var desc = document.getElementById("wizard-desc");
-            // Since we don't translate "Lightning"...
-            wizard.title = props.formatStringFromName("migrationTitle",
-                                                      ["Lightning"],
-                                                      1);
-            desc.textContent = props.formatStringFromName("migrationDescription",
-                                                          ["Lightning"],
-                                                          1);
-        }
-
-        migLOG("migrators: " + window.arguments.length);
-        for each (var migrator in window.arguments[0]) {
-            var listItem = document.createElement("listitem");
-            listItem.setAttribute("type", "checkbox");
-            listItem.setAttribute("checked", true);
-            listItem.setAttribute("label", migrator.title);
-            listItem.migrator = migrator;
-            listbox.appendChild(listItem);
-        }
-    },
-
-    /**
-     * Called from the second page of the wizard.  Finds all of the migrators
-     * that were checked and begins migrating their data.  Also controls the
-     * progress dialog so the user can see what is happening. (somewhat)
-     */
-    migrateChecked: function gmw_migrate() {
-        var migrators = [];
-
-        // Get all the checked migrators into an array
-        var listbox = document.getElementById("datasource-list");
-        for (var i = listbox.childNodes.length-1; i >= 0; i--) {
-            if (listbox.childNodes[i].getAttribute("checked")) {
-                migrators.push(listbox.childNodes[i].migrator);
-            }
-        }
-
-        // If no migrators were checked, then we're done
-        if (migrators.length == 0) {
-            window.close();
-        }
-
-        // Don't let the user get away while we're migrating
-        //XXX may want to wire this into the 'cancel' function once that's
-        //    written
-        var wizard = document.getElementById("migration-wizard");
-        wizard.canAdvance = false;
-        wizard.canRewind = false;
-
-        // We're going to need this for the progress meter's description
-        var props = Services.strings.createBundle("chrome://calendar/locale/migration.properties");
-        var label = document.getElementById("progress-label");
-        var meter = document.getElementById("migrate-progressmeter");
-
-        var i = 0;
-        // Because some of our migrators involve async code, we need this
-        // call-back function so we know when to start the next migrator.
-        function getNextMigrator() {
-            if (migrators[i]) {
-                var mig = migrators[i];
-
-                // Increment i to point to the next migrator
-                i++;
-                migLOG("starting migrator: " + mig.title);
-                label.value = props.formatStringFromName("migratingApp",
-                                                         [mig.title],
-                                                         1);
-                meter.value = (i-1)/migrators.length*100;
-                mig.args.push(getNextMigrator);
-
-                try {
-                    mig.migrate.apply(mig, mig.args);
-                } catch (e) {
-                    migLOG("Failed to migrate: " + mig.title);
-                    migLOG(e);
-                    getNextMigrator();
-                }
-            } else {
-                migLOG("migration done");
-                wizard.canAdvance = true;
-                label.value = props.GetStringFromName("finished");
-                meter.value = 100;
-                gMigrateWizard.setCanRewindFalse();
-            }
-         }
-
-        // And get the first migrator
-        getNextMigrator();
-   },
-
-    /**
-     * Makes sure the wizard "back" button can not be pressed.
-     */
-    setCanRewindFalse: function gmw_finish() {
-        document.getElementById('migration-wizard').canRewind = false;
-    }
-};
-
-//
-// The more back-end data detection bits
-//
-
-
-/**
- * A data migrator prototype, holding the information for migration
- *
- * @class
- * @param aTitle    The title of the migrator
- * @param aMigrateFunction    The function to call when migrating
- * @param aArguments          The arguments to pass in.
- */
-function dataMigrator(aTitle, aMigrateFunction, aArguments) {
-    this.title = aTitle;
-    this.migrate = aMigrateFunction;
-    this.args = aArguments || [];
-}
-
-var gDataMigrator = {
-    mIsInFirefox: false,
-    mPlatform: null,
-    mDirService: null,
-    mIoService: null,
-
-    /**
-     * Cached getter for the directory service.
-     */
-    get dirService() {
-        if (!this.mDirService) {
-            this.mDirService = Services.dirsvc;
-        }
-        return this.mDirService;
-    },
-
-    /**
-     * Call to do a general data migration (for a clean profile)  Will run
-     * through all of the known migrator-checkers.  These checkers will return
-     * an array of valid dataMigrator objects, for each kind of data they find.
-     * If there is at least one valid migrator, we'll pop open the migration
-     * wizard, otherwise, we'll return silently.
-     */
-    checkAndMigrate: function gdm_migrate() {
-        if (Services.appinfo.ID == FIREFOX_UID) {
-            this.mIsInFirefox = true;
-            // We can't handle Firefox Lightning yet
-            migLOG("Holy cow, you're Firefox-Lightning! sorry, can't help.");
-            return;
-        }
-
-        this.mPlatform = Services.appinfo.OS.toLowerCase();
-
-        migLOG("mPlatform is: " + this.mPlatform);
-
-        var DMs = [];
-        var migrators = [this.checkOldCal,
-                         this.checkEvolution,
-                         this.checkWindowsMail,
-                         this.checkIcal];
-        // XXX also define a category and an interface here for pluggability
-        for each (var migrator in migrators) {
-            var migs = migrator.call(this);
-            for each (var dm in migs) {
-                DMs.push(dm);
-            }
-        }
-
-        if (DMs.length == 0) {
-            // No migration available
-            return;
-        }
-        migLOG("DMs: " + DMs.length);
-
-        var url = "chrome://calendar/content/calendar-migration-dialog.xul";
-#ifdef XP_MACOSX
-        var win = Services.wm.getMostRecentWindow("Calendar:MigrationWizard");
-        if (win) {
-            win.focus();
-        } else {
-            openDialog(url, "migration", "centerscreen,chrome,resizable=no,width=500,height=400", DMs);
-        }
-#else
-        openDialog(url, "migration", "modal,centerscreen,chrome,resizable=no,width=500,height=400", DMs);
-#endif
-    },
-
-    /**
-     * Checks to see if we can find any traces of an older moz-cal program.
-     * This could be either the old calendar-extension, or Sunbird 0.2.  If so,
-     * it offers to move that data into our new storage format.
-     */
-    checkOldCal: function gdm_calold() {
-        migLOG("Checking for the old calendar extension/app");
-
-        // This is the function that the migration wizard will call to actually
-        // migrate the data.  It's defined here because we may use it multiple
-        // times (with different aProfileDirs), for instance if there is both
-        // a Thunderbird and Firefox cal-extension
-        function extMigrator(aProfileDir, aCallback) {
-            // Get the old datasource
-            var dataSource = aProfileDir.clone();
-            dataSource.append("CalendarManager.rdf");
-            if (!dataSource.exists()) {
-                return;
-            }
-
-            // Let this be a lesson to anyone designing APIs. The RDF API is so
-            // impossibly confusing that it's actually simpler/cleaner/shorter
-            // to simply parse as XML and use the better DOM APIs.
-            var req = Components.classes["@mozilla.org/xmlextras/xmlhttprequest;1"]
-                      .createInstance(Components.interfaces.nsIXMLHttpRequest);
-            req.open('GET', "file://" + dataSource.path, true);
-            req.onreadystatechange = function calext_onreadychange() {
-                if (req.readyState == 4) {
-                    migLOG(req.responseText);
-                    parseAndMigrate(req.responseXML, aCallback)
-                }
-            };
-            req.send(null);
-        }
-
-        // Callback from the XHR above.  Parses CalendarManager.rdf and imports
-        // the data describe therein.
-        function parseAndMigrate(aDoc, aCallback) {
-            // For duplicate detection
-            var calManager = getCalendarManager();
-            var uris = [];
-            for each (var oldCal in calManager.getCalendars({})) {
-                uris.push(oldCal.uri);
-            }
-
-            function getRDFAttr(aNode, aAttr) {
-                return aNode.getAttributeNS("http://home.netscape.com/NC-rdf#",
-                                            aAttr);
-            }
-
-            const RDFNS = "http://www.w3.org/1999/02/22-rdf-syntax-ns#";
-            var nodes = aDoc.getElementsByTagNameNS(RDFNS, "Description");
-            migLOG("nodes: " + nodes.length);
-            for (var i = 0; i < nodes.length; i++) {
-                migLOG("Beginning calendar node");
-                var calendar;
-                var node = nodes[i];
-                if (getRDFAttr(node, "remote") == "false") {
-                    migLOG("not remote");
-                    var localFile = Components.classes["@mozilla.org/file/local;1"]
-                                    .createInstance(Components.interfaces.nsILocalFile);
-                    localFile.initWithPath(getRDFAttr(node, "path"));
-                    calendar = gDataMigrator.importICSToStorage(localFile);
-                } else {
-                    // Remote subscription
-                    // XXX check for duplicates
-                    var url = makeURL(getRDFAttr(node, "remotePath"));
-                    calendar = calManager.createCalendar("ics", url);
-                }
-                calendar.name = getRDFAttr(node, "name");
-                calendar.setProperty("color", getRDFAttr(node, "color"));
-                calManager.registerCalendar(calendar);
-                getCompositeCalendar().addCalendar(calendar);
-            }
-            aCallback();
-        }
-
-        var migrators = [];
-
-        // Look in our current profile directory, in case we're upgrading in
-        // place
-        var profileDir = this.dirService.get("ProfD", Components.interfaces.nsILocalFile);
-        profileDir.append("Calendar");
-        if (profileDir.exists()) {
-            migLOG("Found old extension directory in current app");
-            var title;
-            if (!cal.isSunbird()) {
-                title = "Mozilla Calendar Extension";
-            } else {
-                title = "Sunbird 0.2";
-            }
-            migrators.push(new dataMigrator(title, extMigrator, [profileDir]));
-        }
-
-        // Check the profiles of the various other moz-apps for calendar data
-        var profiles = [];
-
-        // Do they use Firefox?
-        var ffProf, sbProf, tbProf;
-        if ((ffProf = this.getFirefoxProfile())) {
-            profiles.push(ffProf);
-        }
-
-        if (!cal.isSunbird()) {
-            // If we're lightning, check Sunbird
-            if ((sbProf = this.getSunbirdProfile())) {
-                profiles.push(sbProf);
-            }
-        } else {
-            // Otherwise, check Thunderbird
-            if ((tbProf = this.getThunderbirdProfile())) {
-                profiles.push(tbProf);
-            }
-        }
-
-        // Now check all of the profiles in each of these folders for data
-        for each (var prof in profiles) {
-            var dirEnum = prof.directoryEntries;
-            while (dirEnum.hasMoreElements()) {
-                var profile = dirEnum.getNext().QueryInterface(Components.interfaces.nsIFile);
-                if (profile.isFile()) {
-                    continue;
-                } else {
-                    profile.append("Calendar");
-                    if (profile.exists()) {
-                        migLOG("Found old extension directory at" + profile.path);
-                        var title = "Mozilla Calendar";
-                        migrators.push(new dataMigrator(title, extMigrator, [profile]));
-                    }
-                }
-            }
-        }
-
-        return migrators;
-    },
-
-    /**
-     * Checks to see if Apple's iCal is installed and offers to migrate any data
-     * the user has created in it.
-     */
-    checkIcal: function gdm_ical() {
-        migLOG("Checking for ical data");
-
-        function icalMigrate(aDataDir, aCallback) {
-            aDataDir.append("Sources");
-            var dirs = aDataDir.directoryEntries;
-            var calManager = getCalendarManager();
-
-            var i = 1;
-            while(dirs.hasMoreElements()) {
-                var dataDir = dirs.getNext().QueryInterface(Components.interfaces.nsIFile);
-                var dataStore = dataDir.clone();
-                dataStore.append("corestorage.ics");
-                if (!dataStore.exists()) {
-                    continue;
-                }
-
-                var chars = [];
-                var fileStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
-                                 .createInstance(Components.interfaces.nsIFileInputStream);
-
-                fileStream.init(dataStore, 0x01, parseInt("0444", 8), {});
-                var convStream = Components.classes["@mozilla.org/intl/converter-input-stream;1"]
-                                 .getService(Components.interfaces.nsIConverterInputStream);
-                                 convStream.init(fileStream, 'UTF-8', 0, 0x0000);
-                var tmpStr = {};
-                var str = "";
-                while (convStream.readString(-1, tmpStr)) {
-                    str += tmpStr.value;
-                }
-
-                // Strip out the timezone definitions, since it makes the file
-                // invalid otherwise
-                var index = str.indexOf(";TZID=");
-                while (index != -1) {
-                    var endIndex = str.indexOf(':', index);
-                    var otherEnd = str.indexOf(';', index+2);
-                    if (otherEnd < endIndex) {
-                        endIndex = otherEnd;
-                    }
-                    var sub = str.substring(index, endIndex);
-                    str = str.replace(sub, "", "g");
-                    index = str.indexOf(";TZID=");
-                }
-                var tempFile = gDataMigrator.dirService.get("TmpD", Components.interfaces.nsIFile);
-                tempFile.append("icalTemp.ics");
-                tempFile.createUnique(Components.interfaces.nsIFile.NORMAL_FILE_TYPE,
-                                      parseInt("0600", 8));
-                var tempUri = Services.io.newFileURI(tempFile);
-
-                var stream = Components.classes["@mozilla.org/network/file-output-stream;1"]
-                             .createInstance(Components.interfaces.nsIFileOutputStream);
-                stream.init(tempFile, 0x2A, parseInt("0600", 8), 0);
-                var convStream = Components.classes["@mozilla.org/intl/converter-output-stream;1"]
-                                .createInstance(Components.interfaces.nsIConverterOutputStream);
-                convStream.init(stream, 'UTF-8', 0, 0x0000);
-                convStream.writeString(str);
-
-                var calendar = gDataMigrator.importICSToStorage(tempFile);
-                calendar.name = "iCalendar"+i;
-                i++;
-                calManager.registerCalendar(calendar);
-                getCompositeCalendar().addCalendar(calendar);
-            }
-            migLOG("icalMig making callback");
-            aCallback();
-        }
-        var profileDir = this.dirService.get("ProfD", Components.interfaces.nsILocalFile);
-        var icalSpec = profileDir.path;
-        var icalFile;
-        if (cal.isSunbird()) {
-            var diverge = icalSpec.indexOf("Sunbird");
-            if (diverge == -1) {
-                return [];
-            }
-            icalSpec = icalSpec.substr(0, diverge);
-            icalFile = Components.classes["@mozilla.org/file/local;1"]
-                       .createInstance(Components.interfaces.nsILocalFile);
-            icalFile.initWithPath(icalSpec);
-        } else {
-            var diverge = icalSpec.indexOf("Thunderbird");
-            if (diverge == -1) {
-                return [];
-            }
-            icalSpec = icalSpec.substr(0, diverge);
-            icalFile = Components.classes["@mozilla.org/file/local;1"]
-                       .createInstance(Components.interfaces.nsILocalFile);
-            icalFile.initWithPath(icalSpec);
-            icalFile.append("Application Support");
-        }
-
-        icalFile.append("iCal");
-        if (icalFile.exists()) {
-            return [new dataMigrator("Apple iCal", icalMigrate, [icalFile])];
-        }
-
-        return [];
-    },
-
-    /**
-     * Checks to see if Evolution is installed and offers to migrate any data
-     * stored there.
-     */
-    checkEvolution: function gdm_evolution() {
-        function evoMigrate(aDataDir, aCallback) {
-            var i = 1;
-            function evoDataMigrate(dataStore) {
-                migLOG("Migrating evolution data file in " + dataStore.path);
-                if (dataStore.exists()) {
-                    var calendar = gDataMigrator.importICSToStorage(dataStore);
-                    calendar.name = "Evolution " + (i++);
-                    calManager.registerCalendar(calendar);
-                    getCompositeCalendar().addCalendar(calendar);
-                }
-                return dataStore.exists();
-            }
-
-            var calManager = getCalendarManager();
-            var dirs = aDataDir.directoryEntries;
-            while (dirs.hasMoreElements()) {
-                var dataDir = dirs.getNext().QueryInterface(Components.interfaces.nsIFile);
-                var dataStore = dataDir.clone();
-                dataStore.append("calendar.ics");
-                evoDataMigrate(dataStore);
-            }
-
-            aCallback();
-        }
-
-        var evoDir = this.dirService.get("Home", Components.interfaces.nsILocalFile);
-        evoDir.append(".evolution");
-        evoDir.append("calendar");
-        evoDir.append("local");
-        return (evoDir.exists() ? [new dataMigrator("Evolution", evoMigrate, [evoDir])] : []);
-    },
-
-    checkWindowsMail: function gdm_windowsMail() {
-        let maildir = this.dirService.get("LocalAppData",
-                                          Components.interfaces.nsILocalFile);
-        if (!maildir || !maildir.exists()) {
-            // We are probably not on windows
-            return [];
-        }
-        maildir.append("Microsoft");
-        maildir.append("Windows Calendar");
-        maildir.append("Calendars");
-
-        let settingsxml = maildir.clone();
-        settingsxml.append("Settings.xml");
-        if (!settingsxml || !settingsxml.exists()) {
-            // No Settings.xml, maybe Windows Calendar was never started?
-            return [];
-        }
-        let settingsXmlUri = Services.io.newFileURI(settingsxml);
-
-        let req = new XMLHttpRequest();
-        req.open("GET", settingsXmlUri.spec, false);
-        req.send(null);
-        if (req.status == 0) {
-            // The file was found, it seems we are on windows vista.
-            let doc = req.responseXML;
-            let root = doc.documentElement;
-
-            // Get all calendar property tags and return the migrator.
-            let calendars = doc.getElementsByTagName("VCalendar");
-            function doMigrate(aCallback) {
-                for each (let node in Array.slice(calendars)) {
-                    let name = node.getElementsByTagName("Name")[0].textContent;
-                    let color = node.getElementsByTagName("Color")[0].textContent;
-                    let enabled = node.getElementsByTagName("Enabled")[0].textContent == "True";
-
-                    // The name is quoted, and the color also contains an alpha
-                    // value. Lets just ignore the alpha value and take the
-                    // color part.
-                    name = name.replace(/(^'|'$)/g, "");
-                    color = color.replace(/0x[0-9a-fA-F]{2}([0-9a-fA-F]{4})/, "#$1");
-
-                    let calfile = maildir.clone();
-                    calfile.append(name + ".ics");
-
-                    if (calfile.exists()) {
-                        let storage = gDataMigrator.importICSToStorage(calfile)
-
-                        storage.name = name;
-
-                        if (color) {
-                            storage.setProperty("color", color);
-                        }
-                        let calManager = cal.getCalendarManager();
-                        calManager.registerCalendar(storage);
-
-                        if (enabled) {
-                            getCompositeCalendar().addCalendar(storage);
-                        }
-                    }
-                }
-                aCallback();
-            }
-            if (calendars.length > 0) {
-                return [new dataMigrator("Windows Calendar", doMigrate)];
-            }
-        }
-        return [];
-    },
-
-    /**
-     * Creates and registers a storage calendar and imports the given ics file into it.
-     *
-     * @param icsFile     The nsI(Local)File to import.
-     */
-    importICSToStorage: function migrateIcsStorage(icsFile) {
-        const uri = 'moz-storage-calendar://';
-        let calendar = cal.getCalendarManager().createCalendar("storage", makeURL(uri));
-        let icsImporter = Components.classes["@mozilla.org/calendar/import;1?type=ics"]
-                                    .getService(Components.interfaces.calIImporter);
-
-        let inputStream = Components.classes["@mozilla.org/network/file-input-stream;1"]
-                                    .createInstance(Components.interfaces.nsIFileInputStream);
-        let items = [];
-
-        calendar.id = cal.getUUID();
-
-        try {
-            inputStream.init(icsFile, MODE_RDONLY, parseInt("0444", 8), {});
-            items = icsImporter.importFromStream(inputStream, {});
-        } catch(ex) {
-            switch (ex.result) {
-                case Components.interfaces.calIErrors.INVALID_TIMEZONE:
-                    showError(calGetString("calendar", "timezoneError", [icsFile.path]));
-                    break;
-                default:
-                    showError(calGetString("calendar", "unableToRead") + icsFile.path + "\n"+ ex);
-            }
-        } finally {
-           inputStream.close();
-        }
-
-        // Defined in import-export.js
-        putItemsIntoCal(calendar, items, icsFile.leafName);
-
-        return calendar;
-    },
-
-    /**
-     * Helper functions for getting the profile directory of various MozApps
-     * (Getting the profile dir is way harder than it should be.)
-     *
-     * Sunbird:
-     *     Unix:     ~jdoe/.mozilla/sunbird/
-     *     Windows:  %APPDATA%\Mozilla\Sunbird\Profiles
-     *     Mac OS X: ~jdoe/Library/Application Support/Sunbird/Profiles
-     *
-     * Firefox:
-     *     Unix:     ~jdoe/.mozilla/firefox/
-     *     Windows:  %APPDATA%\Mozilla\Firefox\Profiles
-     *     Mac OS X: ~jdoe/Library/Application Support/Firefox/Profiles
-     *
-     * Thunderbird:
-     *     Unix:     ~jdoe/.thunderbird/
-     *     Windows:  %APPDATA%\Thunderbird\Profiles
-     *     Mac OS X: ~jdoe/Library/Thunderbird/Profiles
-     *
-     * Notice that Firefox and Sunbird follow essentially the same pattern, so
-     * we group them with getNormalProfile
-     */
-    getFirefoxProfile: function gdm_getFF() {
-        return this.getNormalProfile("Firefox");
-    },
-
-    /**
-     * @see getFirefoxProfile
-     */
-    getThunderbirdProfile: function gdm_getTB() {
-        var localFile;
-        var profileRoot = this.dirService.get("DefProfRt", Components.interfaces.nsILocalFile);
-        migLOG("profileRoot = " + profileRoot.path);
-        if (!cal.isSunbird()) {
-            localFile = profileRoot;
-        } else {
-            // Now it gets ugly
-            switch (this.mPlatform) {
-                case "darwin": // Mac OS X
-                case "winnt":
-                    localFile = profileRoot.parent.parent.parent;
-                    localFile.append("Thunderbird");
-                    localFile.append("Profiles");
-                    break;
-                default: // Unix
-                    localFile = profileRoot.parent.parent;
-                    localFile.append(".thunderbird");
-            }
-        }
-        migLOG("searching for Thunderbird in " + localFile.path);
-        return localFile.exists() ? localFile : null;
-    },
-
-    /**
-     * @see getFirefoxProfile
-     */
-    getSunbirdProfile: function gdm_getSB() {
-        return this.getNormalProfile("Sunbird");
-    },
-
-    /**
-     * Common function to retrieve the profile directory for a given app.
-     * @see getFirefoxProfile
-     */
-    getNormalProfile: function gdm_getNorm(aAppName) {
-        var localFile;
-        var profileRoot = this.dirService.get("DefProfRt", Components.interfaces.nsILocalFile);
-        migLOG("profileRoot = " + profileRoot.path);
-
-        if (!cal.isSunbird()) {  // We're in Thunderbird
-            switch (this.mPlatform) {
-                case "darwin": // Mac OS X
-                    localFile = profileRoot.parent.parent;
-                    localFile.append("Application Support");
-                    localFile.append(aAppName);
-                    localFile.append("Profiles");
-                    break;
-                case "winnt":
-                    localFile = profileRoot.parent.parent;
-                    localFile.append("Mozilla");
-                    localFile.append(aAppName);
-                    localFile.append("Profiles");
-                    break;
-                default: // Unix
-                    localFile = profileRoot.parent;
-                    localFile.append(".mozilla");
-                    localFile.append(aAppName.toLowerCase());
-                    break;
-            }
-        } else {
-            switch (this.mPlatform) {
-                // On Mac and Windows, we can just remove the "Sunbird" and
-                // replace it with "Firefox" to get to Firefox
-                case "darwin": // Mac OS X
-                case "winnt":
-                    localFile = profileRoot.parent.parent;
-                    localFile.append(aAppName);
-                    localFile.append("Profiles");
-                    break;
-                default: // Unix
-                    localFile = profileRoot.parent;
-                    localFile.append(aAppName.toLowerCase());
-                    break;
-            }
-        }
-        migLOG("searching for " + aAppName + " in " + localFile.path);
-        return localFile.exists() ? localFile : null;
-    }
-};
-
-/**
- * logs to system and error console, depending on the calendar.migration.log
- * preference.
- *
- * XXX Use log4moz instead.
- *
- * @param aString   The string to log
- */
-function migLOG(aString) {
-    if (!Preferences.get("calendar.migration.log", false)) {
-        return;
-    }
-    Services.console.logStringMessage(aString);
-    dump(aString+"\n");
-}
deleted file mode 100644
--- a/calendar/base/content/dialogs/calendar-migration-dialog.xul
+++ /dev/null
@@ -1,48 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!-- 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/. -->
-
-<!-- Style sheets -->
-<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
-
-<!DOCTYPE dialog
-[
-    <!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
-    %brandDTD;
-    <!ENTITY % migrationDtd SYSTEM "chrome://calendar/locale/migration.dtd">
-    %migrationDtd;
-]>
-
-<wizard id="migration-wizard"
-        title="&migration.title;"
-        windowtype="Calendar:MigrationWizard"
-        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
-        onload="gMigrateWizard.loadMigrators()"
-        branded="true"
-        persist="screenX screenY">
-
-    <script type="application/javascript" src="chrome://calendar/content/calendar-migration-dialog.js"/>
-    <script type="application/javascript" src="chrome://calendar/content/import-export.js"/>
-    <script type="application/javascript" src="chrome://calendar/content/calUtils.js"/>
-
-    <wizardpage id="wizardPage1"
-                pageid="initialPage"
-                next="progressPage"
-                label="&migration.welcome;">
-        <label id="wizard-desc" control="datasource-list">&migration.list.description;</label>
-        <listbox id="datasource-list" flex="1">
-        </listbox>
-    </wizardpage>
-
-    <wizardpage id="wizardPage2"
-                pageid="progressPage"
-                label="&migration.importing;"
-                onpageshow="gMigrateWizard.migrateChecked()">
-        <label control="migrate-progressmeter">&migration.progress.description;</label>
-        <vbox flex="1">
-            <progressmeter id="migrate-progressmeter" mode="determined" value="0" />
-            <label value="" flex="1" id="progress-label"/>
-        </vbox>
-    </wizardpage>
-</wizard>
--- a/calendar/base/content/today-pane.js
+++ b/calendar/base/content/today-pane.js
@@ -109,23 +109,23 @@ var TodayPane = {
     },
 
     /**
      * Go to month/week/day views when double-clicking a label inside miniday
      */
     onDoubleClick: function md_onDoubleClick(aEvent) {
         if (aEvent.button == 0) {
             if (aEvent.target.id == "datevalue-label") {
-                switchCalendarView("day", true);
+                ltnSwitchCalendarView("day", true);
             } else if (aEvent.target.parentNode.id == "weekdayNameContainer") {
-                switchCalendarView("day", true);
+                ltnSwitchCalendarView("day", true);
             } else if (aEvent.target.id == "currentWeek-label") {
-                switchCalendarView("week", true);
+                ltnSwitchCalendarView("week", true);
             } else if (aEvent.target.parentNode.id == "monthNameContainer") {
-                switchCalendarView("month", true);
+                ltnSwitchCalendarView("month", true);
             } else {
                 return;
             }
             let title = document.getElementById('calendar-tab-button')
                             .getAttribute('tooltiptext');
             document.getElementById('tabmail').openTab('calendar', {title: title});
             currentView().goToDay(agendaListbox.today.start);
         }
--- a/calendar/base/jar.mn
+++ b/calendar/base/jar.mn
@@ -63,18 +63,16 @@ calendar.jar:
     content/calendar/calendar-event-dialog-timezone.js     (content/dialogs/calendar-event-dialog-timezone.js)
     content/calendar/calendar-event-dialog-timezone.xul    (content/dialogs/calendar-event-dialog-timezone.xul)
     content/calendar/calendar-event-dialog-attendees.xul   (content/dialogs/calendar-event-dialog-attendees.xul)
     content/calendar/calendar-event-dialog-attendees.js    (content/dialogs/calendar-event-dialog-attendees.js)
     content/calendar/calendar-invitations-dialog.css       (content/dialogs/calendar-invitations-dialog.css)
     content/calendar/calendar-invitations-dialog.js        (content/dialogs/calendar-invitations-dialog.js)
     content/calendar/calendar-invitations-dialog.xul       (content/dialogs/calendar-invitations-dialog.xul)
     content/calendar/calendar-invitations-list.xml         (content/dialogs/calendar-invitations-list.xml)
-*   content/calendar/calendar-migration-dialog.js          (content/dialogs/calendar-migration-dialog.js)
-    content/calendar/calendar-migration-dialog.xul         (content/dialogs/calendar-migration-dialog.xul)
     content/calendar/calendar-occurrence-prompt.xul        (content/dialogs/calendar-occurrence-prompt.xul)
     content/calendar/calendar-print-dialog.js              (content/dialogs/calendar-print-dialog.js)
     content/calendar/calendar-print-dialog.xul             (content/dialogs/calendar-print-dialog.xul)
     content/calendar/calendar-properties-dialog.xul        (content/dialogs/calendar-properties-dialog.xul)
     content/calendar/calendar-properties-dialog.js         (content/dialogs/calendar-properties-dialog.js)
     content/calendar/calendar-providerUninstall-dialog.xul (content/dialogs/calendar-providerUninstall-dialog.xul)
     content/calendar/calendar-providerUninstall-dialog.js  (content/dialogs/calendar-providerUninstall-dialog.js)
     content/calendar/calendar-subscriptions-dialog.css     (content/dialogs/calendar-subscriptions-dialog.css)
@@ -96,17 +94,17 @@ calendar.jar:
     content/calendar/preferences/views.js                  (content/preferences/views.js)
     content/calendar/preferences/views.xul                 (content/preferences/views.xul)
     content/calendar/widgets/minimonth.xml                 (content/widgets/minimonth.xml)
     content/calendar/widgets/calendar-alarm-widget.xml     (content/widgets/calendar-alarm-widget.xml)
     content/calendar/widgets/calendar-widgets.xml          (content/widgets/calendar-widgets.xml)
     content/calendar/widgets/calendar-list-tree.xml        (content/widgets/calendar-list-tree.xml)
     content/calendar/calendar-subscriptions-list.xml       (content/widgets/calendar-subscriptions-list.xml)
     content/calendar/widgets/calendar-widget-bindings.css  (content/widgets/calendar-widget-bindings.css)
-*   content/calendar/calApplicationUtils.js                (src/calApplicationUtils.js)
+    content/calendar/calApplicationUtils.js                (src/calApplicationUtils.js)
     content/calendar/calUtils.js                           (src/calUtils.js)
     content/calendar/calFilter.js                          (src/calFilter.js)
     content/calendar/WindowsNTToZoneInfoTZId.properties    (src/WindowsNTToZoneInfoTZId.properties)
 % skin calendar classic/1.0 chrome/skin/linux/calendar/ os=Linux
 % skin calendar classic/1.0 chrome/skin/osx/calendar/ os=Darwin
 % skin calendar classic/1.0 chrome/skin/windows/calendar/ os=WINNT
 % skin calendar-common classic/1.0 chrome/skin/common/
 % skin calendar-windows classic/1.0 chrome/skin/windows/calendar/win-classic/ os=WINNT osversion<6
--- a/calendar/base/modules/calProviderUtils.jsm
+++ b/calendar/base/modules/calProviderUtils.jsm
@@ -244,19 +244,16 @@ cal.getImipTransport = function calGetIm
  * Gets the configured identity and account of a particular calendar instance, or null.
  *
  * @param aCalendar     Calendar instance
  * @param outAccount    Optional out value for account
  * @return              The configured identity
  */
 cal.getEmailIdentityOfCalendar = function calGetEmailIdentityOfCalendar(aCalendar, outAccount) {
     cal.ASSERT(aCalendar, "no calendar!", Components.results.NS_ERROR_INVALID_ARG);
-    if (cal.isSunbird()) {
-        return null;
-    }
     let key = aCalendar.getProperty("imip.identity.key");
     if (key !== null) {
         if (key.length == 0) { // i.e. "None"
             return null;
         }
         let identity = null;
         cal.calIterateEmailIdentities(
             function(identity_, account) {
--- a/calendar/base/src/calAlarmService.js
+++ b/calendar/base/src/calAlarmService.js
@@ -263,17 +263,17 @@ calAlarmService.prototype = {
         let timerCallback = {
             alarmService: this,
             notify: function timer_notify() {
                 let now = nowUTC();
                 let start;
                 if (!this.alarmService.mRangeEnd) {
                     // This is our first search for alarms.  We're going to look for
                     // alarms +/- 1 month from now.  If someone sets an alarm more than
-                    // a month ahead of an event, or doesn't start Sunbird/Lightning
+                    // a month ahead of an event, or doesn't start Lightning
                     // for a month, they'll miss some, but that's a slim chance
                     start = now.clone();
                     start.month -= 1;
                     this.alarmService.mRangeStart = start.clone();
                 } else {
                     // This is a subsequent search, so we got all the past alarms before
                     start = this.alarmService.mRangeEnd.clone();
                 }
@@ -564,17 +564,17 @@ calAlarmService.prototype = {
         // Purge out all alarm timers belonging to the refreshed/loaded calendar:
         this.disposeCalendarTimers(aCalendars);
 
         // Purge out all alarms from dialog belonging to the refreshed/loaded calendar:
         this.mObservers.notify("onRemoveAlarmsByCalendar", aCalendars);
 
         // Total refresh similar to startup.  We're going to look for
         // alarms +/- 1 month from now.  If someone sets an alarm more than
-        // a month ahead of an event, or doesn't start Sunbird/Lightning
+        // a month ahead of an event, or doesn't start Lightning
         // for a month, they'll miss some, but that's a slim chance
         let start = nowUTC();
         let until = start.clone();
         start.month -= 1;
         until.month += 1;
         this.findAlarms(aCalendars, start, until);
     },
 
--- a/calendar/base/src/calApplicationUtils.js
+++ b/calendar/base/src/calApplicationUtils.js
@@ -1,94 +1,15 @@
 /* -*- Mode: javascript; tab-width: 20; indent-tabs-mode: nil; c-basic-offset: 4 -*-
  * 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/. */
 
 Components.utils.import("resource://gre/modules/Services.jsm");
 
-function openAboutDialog()
-{
-  const SUNBIRD_ID = "{718e30fb-e89b-41dd-9da7-e25a45638b28}";
-  var url = (Services.appinfo.ID == SUNBIRD_ID) ?
-    "chrome://sunbird/content/aboutDialog.xul" :
-    "chrome://messenger/content/aboutDialog.xul" ;
-#ifdef XP_WIN
-  var features = "chrome,centerscreen,dependent";
-#elifdef XP_MACOSX
-  var features = "chrome,resizable=no,minimizable=no";
-#else
-  var features = "chrome,centerscreen,dependent,dialog=no";
-#endif
-  window.openDialog(url, "About", features);
-}
-
-/**
- * Opens the release notes page for this version of the application.
- */
-function openReleaseNotes()
-{
-  const SUNBIRD_ID = "{718e30fb-e89b-41dd-9da7-e25a45638b28}";
-  if (Services.appinfo.ID == SUNBIRD_ID) {
-    var bundle = Services.strings.createBundle("chrome://branding/locale/brand.properties");
-    var relNotesURL = bundle.formatStringFromName("releaseNotesURL",[Services.appinfo.version],1)
-    launchBrowser(relNotesURL);
-  } else {
-    openFormattedRegionURL('app.releaseNotesURL');
-  }
-}
-
-/**
- * Opens region specific web pages for the application like the release notes, the help site, etc. 
- *   aResourceName --> the string resource ID in region.properties to load. 
- */
-function openRegionURL(aResourceName)
-{
-  try {
-    var regionBundle = Services.strings.createBundle("chrome://messenger-region/locale/region.properties");
-    // the release notes are special and need to be formatted with the app version
-    var urlToOpen;
-    if (aResourceName == "releaseNotesURL")
-      urlToOpen = regionBundle.formatStringFromName(aResourceName, [Services.appinfo.version], 1);
-    else
-      urlToOpen = regionBundle.GetStringFromName(aResourceName);
-      
-    var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"]
-                      .getService(Components.interfaces.nsIExternalProtocolService);
-    protocolSvc.loadUrl(Services.io.newURI(urlToOpen, null, null));
-  } catch (ex) {}
-}
-
-/**
- *  Fetches the url for the passed in pref name, formats it and then loads it in the default
- *  browser.
- *
- *  @param aPrefName - name of the pref that holds the url we want to format and open
- */
-function openFormattedRegionURL(aPrefName)
-{
-  var formattedUrl = getFormattedRegionURL(aPrefName);
-  
-  var protocolSvc = Components.classes["@mozilla.org/uriloader/external-protocol-service;1"].
-                               getService(Components.interfaces.nsIExternalProtocolService);
-  protocolSvc.loadUrl(Services.io.newURI(formattedUrl, null, null));
-}
-
-/**
- *  Fetches the url for the passed in pref name and uses the URL formatter service to 
- *    process it.
- *
- *  @param aPrefName - name of the pref that holds the url we want to format and open
- *  @returns the formatted url string
- */
-function getFormattedRegionURL(aPrefName)
-{
-  return Services.urlFormatter.formatURLPref(aPrefName);
-}
-
 /**
  * Launch the given url (string) in the external browser. If an event is passed,
  * then this is only done on left click and the event propagation is stopped.
  *
  * @param url       The URL to open, as a string
  * @param event     (optional) The event that caused the URL to open
  */
 function launchBrowser(url, event)
--- a/calendar/base/src/calCalendarManager.js
+++ b/calendar/base/src/calCalendarManager.js
@@ -41,19 +41,16 @@ calCalendarManager.prototype = {
     // calIStartupService:
     startup: function ccm_startup(aCompleteListener) {
         AddonManager.addAddonListener(gCalendarManagerAddonListener);
         this.checkAndMigrateDB();
         this.mCache = null;
         this.mCalObservers = null;
         this.mRefreshTimer = {};
         this.setupOfflineObservers();
-        if (cal.isSunbird()) {
-            this.loginMasterPassword();
-        }
         this.mNetworkCalendarCount = 0;
         this.mReadonlyCalendarCount = 0;
         this.mCalendarCount = 0;
 
         Services.obs.addObserver(this, "http-on-modify-request", false);
 
         // We only add the observer if the pref is set and only check for the
         // pref on startup to avoid checking for every http request
@@ -89,34 +86,16 @@ calCalendarManager.prototype = {
     setupOfflineObservers: function ccm_setupOfflineObservers() {
         Services.obs.addObserver(this, "network:offline-status-changed", false);
     },
 
     cleanupOfflineObservers: function ccm_cleanupOfflineObservers() {
         Services.obs.removeObserver(this, "network:offline-status-changed");
     },
 
-    loginMasterPassword: function ccm_loginMasterPassword() {
-        // Try to avoid the multiple master password prompts on startup scenario
-        // by prompting for the master password upfront.
-        let token = Components.classes["@mozilla.org/security/pk11tokendb;1"]
-                              .getService(Components.interfaces.nsIPK11TokenDB)
-                              .getInternalKeyToken();
-
-        // Only log in to the internal token if it is already initialized,
-        // otherwise we get a "Change Master Password" dialog.
-        try {
-            if (!token.needsUserInit) {
-                token.login(false);
-            }
-        } catch (ex) {
-            // If user cancels an exception is expected.
-        }
-    },
-
     observe: function ccm_observe(aSubject, aTopic, aData) {
         switch (aTopic) {
             case "timer-callback":
                 // Refresh all the calendars that can be refreshed.
                 var cals = this.getCalendars({});
                 for each (var calendar in cals) {
                     if (!calendar.getProperty("disabled") && calendar.canRefresh) {
                         calendar.refresh();
@@ -411,32 +390,23 @@ calCalendarManager.prototype = {
         throw table + " SELECT returned no results";
     },
 
     //
     // / DB migration code ends here
     //
 
     alertAndQuit: function cmgr_alertAndQuit() {
-        // If we're Lightning, we want to include the extension name
-        // in the error message rather than blaming Thunderbird.
-        var errorBoxTitle;
-        var errorBoxText;
-        var errorBoxButtonLabel;
+        // We want to include the extension name in the error message rather
+        // than blaming Thunderbird.
         var hostAppName = calGetString("brand", "brandShortName", null, "branding");
-        if (isSunbird()) {
-            errorBoxTitle = calGetString("calendar", "tooNewSchemaErrorBoxTitle", [hostAppName]);
-            errorBoxText = calGetString("calendar", "tooNewSchemaErrorBoxTextSunbird", [hostAppName]);
-            errorBoxButtonLabel = calGetString("calendar", "tooNewSchemaButtonQuit", [hostAppName]);
-        } else {
-            var calAppName = calGetString("lightning", "brandShortName", null, "lightning");
-            errorBoxTitle = calGetString("calendar", "tooNewSchemaErrorBoxTitle", [calAppName]);
-            errorBoxText = calGetString("calendar", "tooNewSchemaErrorBoxTextLightning", [calAppName, hostAppName]);
-            errorBoxButtonLabel = calGetString("calendar", "tooNewSchemaButtonRestart", [hostAppName]);
-        }
+        var calAppName = calGetString("lightning", "brandShortName", null, "lightning");
+        var errorBoxTitle = calGetString("calendar", "tooNewSchemaErrorBoxTitle", [calAppName]);
+        var errorBoxText = calGetString("calendar", "tooNewSchemaErrorBoxTextLightning", [calAppName, hostAppName]);
+        var errorBoxButtonLabel = calGetString("calendar", "tooNewSchemaButtonRestart", [hostAppName]);
 
         var promptSvc = Services.prompt;
 
         var errorBoxButtonFlags = (promptSvc.BUTTON_POS_0 *
                                    promptSvc.BUTTON_TITLE_IS_STRING +
                                    promptSvc.BUTTON_POS_0_DEFAULT);
 
         var choice = promptSvc.confirmEx(null,
@@ -444,26 +414,22 @@ calCalendarManager.prototype = {
                                          errorBoxText,
                                          errorBoxButtonFlags,
                                          errorBoxButtonLabel,
                                          null, // No second button text
                                          null, // No third button text
                                          null, // No checkbox
                                          { value: false }); // Unnecessary checkbox state
 
-        if (isSunbird()) {
-            Services.startup.quit(Components.interfaces.nsIAppStartup.eForceQuit);
-        } else {
-            // Disable Lightning
-            AddonManager.getAddonByID("{e2fda1a4-762b-4020-b5ad-a41df1933103}", function getLightningExt(aAddon) {
-                aAddon.userDisabled = true;
-                Services.startup.quit(Components.interfaces.nsIAppStartup.eRestart |
-                    Components.interfaces.nsIAppStartup.eForceQuit);
-            });
-        }
+        // Disable Lightning
+        AddonManager.getAddonByID("{e2fda1a4-762b-4020-b5ad-a41df1933103}", function getLightningExt(aAddon) {
+            aAddon.userDisabled = true;
+            Services.startup.quit(Components.interfaces.nsIAppStartup.eRestart |
+                Components.interfaces.nsIAppStartup.eForceQuit);
+        });
     },
 
     /**
      * calICalendarManager interface
      */
     createCalendar: function cmgr_createCalendar(type, uri) {
         try {
             if (!Components.classes["@mozilla.org/calendar/calendar;1?type=" + type]) {
--- a/calendar/base/src/calUtils.js
+++ b/calendar/base/src/calUtils.js
@@ -1144,31 +1144,16 @@ function getProgressAtom(aTask) {
     if (aTask.entryDate && aTask.entryDate.isValid &&
         aTask.entryDate.jsDate.getTime() < now.getTime()) {
         return "inprogress";
     }
 
     return "future";
 }
 
-/**
- * Returns true if we are Sunbird (according to our UUID), false otherwise.
- */
-function isSunbird() {
-    if (isSunbird.mIsSunbird === undefined) {
-        try {
-            isSunbird.mIsSunbird = (Services.appinfo.ID == "{718e30fb-e89b-41dd-9da7-e25a45638b28}");
-        } catch (e) {
-            dump("### Warning: Could not access appinfo, using unreliable check for Lightning\n");
-            isSunbird.mIsSunbird = !("@mozilla.org/lightning/mime-converter;1" in Components.classes);
-        }
-    }
-    return isSunbird.mIsSunbird;
-}
-
 function calInterfaceBag(iid) {
     this.init(iid);
 }
 calInterfaceBag.prototype = {
     mIid: null,
     mInterfaces: null,
 
     /// internal:
--- a/calendar/lightning/jar.mn
+++ b/calendar/lightning/jar.mn
@@ -34,17 +34,16 @@ lightning.jar:
     content/lightning/imip-bar.js                          (content/imip-bar.js)
     content/lightning/imip-bar-overlay.xul                 (content/imip-bar-overlay.xul)
     content/lightning/lightning-calendar-creation.xul      (content/lightning-calendar-creation.xul)
     content/lightning/lightning-calendar-creation.js       (content/lightning-calendar-creation.js)
     content/lightning/lightning-calendar-properties.xul    (content/lightning-calendar-properties.xul)
     content/lightning/lightning-calendar-properties.js     (content/lightning-calendar-properties.js)
     content/lightning/lightning-invitation.xhtml           (content/lightning-invitation.xhtml)
     content/lightning/lightning-menus.xul                  (content/lightning-menus.xul)
-    content/lightning/lightning-migration.xul              (content/lightning-migration.xul)
     content/lightning/lightning-standalone.xul             (content/lightning-standalone.xul)
 *   content/lightning/lightning-toolbar.xul                (content/lightning-toolbar.xul)
     content/lightning/lightning-utils.js                   (content/lightning-utils.js)
     content/lightning/lightning-widgets.css                (content/lightning-widgets.css)
     content/lightning/lightning-widgets.xml                (content/lightning-widgets.xml)
     content/lightning/messenger-overlay-accountCentral.xul (content/messenger-overlay-accountCentral.xul)
     content/lightning/messenger-overlay-messageWindow.xul  (content/messenger-overlay-messageWindow.xul)
     content/lightning/messenger-overlay-sidebar.js         (content/messenger-overlay-sidebar.js)
--- a/calendar/locales/en-US/README.txt
+++ b/calendar/locales/en-US/README.txt
@@ -1,3 +1,3 @@
-For information about installing, running and configuring Sunbird 
+For information about installing, running and configuring Lightning 
 including a list of known issues and troubleshooting information, 
 refer to: http://www.mozilla.org/projects/calendar/
--- a/calendar/locales/en-US/chrome/calendar/calendar.properties
+++ b/calendar/locales/en-US/chrome/calendar/calendar.properties
@@ -102,21 +102,16 @@ None=None
 ## @loc none
 tooNewSchemaErrorBoxTitle=Your calendar data isn't compatible with this version of %1$S
 
 # LOCALIZATION NOTE (tooNewSchemaErrorBoxTextLightning):
 #    %1$S will be replaced with the name of the calendar application e.g. 'Lightning'
 #    %2$S will be replaced with the name of the host application 'calendar'
 tooNewSchemaErrorBoxTextLightning=The calendar data in your profile was updated by a newer version of %1$S, and continuing will probably cause the information to be lost or corrupted. %1$S will now be disabled and %2$S restarted.
 
-# LOCALIZATION NOTE (tooNewSchemaErrorBoxTextSunbird):
-#    %1$S will be replaced with the name of the calendar application e.g. 'Sunbird'
-#    %2$S will be replaced with the name of the host application 'calendar'
-tooNewSchemaErrorBoxTextSunbird=The calendar data in your profile was updated by a newer version of %1$S, and continuing will probably cause the information to be lost or corrupted. %1$S will now quit.
-
 # LOCALIZATION NOTE (tooNewSchemaButtonRestart):
 #    %1$S will be replaced with the name of the host application 'Calendar'
 tooNewSchemaButtonRestart=Restart %1$S
 
 # LOCALIZATION NOTE (tooNewSchemaButtonQuit):
 #    %1$S will be replaced with the name of the host application 'Calendar'
 tooNewSchemaButtonQuit=Quit %1$S
 
@@ -339,26 +334,16 @@ next2=next
 last1=last
 last2=last
 
 # Master Password
 changeMasterPassword=Change Master Password…
 pw_change2empty_in_fips_mode=You are currently in FIPS mode. FIPS requires a non-empty Master Password.
 pw_change_failed_title=Password Change Failed
 
-# Check for Updates     (SUNBIRD_ONLY)
-updatesItem_default=Check for Updates…
-updatesItem_defaultFallback=Check for Updates…
-updatesItem_downloading=Downloading %S…
-updatesItem_downloadingFallback=Downloading Update…
-updatesItem_resume=Resume Downloading %S…
-updatesItem_resumeFallback=Resume Downloading Update…
-updatesItem_pending=Apply Downloaded Update Now…
-updatesItem_pendingFallback=Apply Downloaded Update Now…
-
 # Alarm Dialog
 # LOCALIZATION NOTE (alarmWindowTitle.label): Semi-colon list of plural
 # forms. See: http://developer.mozilla.org/en/Localization_and_Plurals
 alarmWindowTitle.label=#1 Reminder;#1 Reminders
 
 # LOCALIZATION NOTE (alarmStarts):
 # used for a display the start of an alarm like 'Starts:  Thu 2 Oct 2008 13:21'
 #    %1$S will be replaced with a date-time
@@ -381,20 +366,16 @@ alarmYesterdayAt=Yesterday at %1$S
 
 # Alarm interface strings
 # LOCALIZATION NOTE: These strings do not get displayed. They are only visible
 # when exporting an item with i.e a DISPLAY alarm, that doesn't have a
 # description set, or an EMAIL alarm that doesn't have a summary set.
 alarmDefaultDescription=Default Mozilla Description
 alarmDefaultSummary=Default Mozilla Summary
 
-# offline support strings (SUNBIRD ONLY)
-offlineTooltip=You are currently offline.
-onlineTooltip=You are currently online.
-
 taskDetailsStatusNeedsAction=Needs Action
 
 # LOCALIZATION NOTE (taskDetailsStatusInProgress):
 # used for a display of how much of a task is completed '25% Complete'
 #    %1$S will be replaced with the number of percentage completed
 taskDetailsStatusInProgress=%1$S%% Complete
 taskDetailsStatusCompleted=Completed
 
--- a/calendar/locales/filter.py
+++ b/calendar/locales/filter.py
@@ -1,28 +1,24 @@
 
 def test(mod, path, entity = None):
   import re
 
   # ignore anyhting but calendar stuff
   if mod not in ("netwerk", "dom", "toolkit", "security/manager",
-                 "calendar", "other-licenses/branding/sunbird"):
+                 "calendar"):
     return False
 
   # Timezone properties don't have to be translated
   if path == "chrome/calendar/timezones.properties":
     return "report"
 
   # Noun class entries do not have to be translated
   if path == "chrome/calendar/calendar-event-dialog.properties":
     return not re.match(r".*Nounclass[1-9]", entity)
 
   # most extraction related strings are not required
   if path == "chrome/calendar/calendar-extract.properties":
     if not re.match(r"from.today", entity):
       return "report"
 
-  # Sunbird specific strings don't need translation
-  if path.startswith("chrome/sunbird/"):
-    return False
-
   # Everything else should be taken into account
   return True
deleted file mode 100755
--- a/calendar/locales/l10n-1.9.2.ini
+++ /dev/null
@@ -1,20 +0,0 @@
-[general]
-depth = ../..
-all = calendar/locales/all-locales
-
-[compare]
-dirs = calendar
-       other-licenses/branding/sunbird
-
-[includes]
-# non-central apps might want to use %(topsrcdir)s here, or other vars
-# RFE: that needs to be supported by compare-locales, too, though
-toolkit = mozilla/toolkit/locales/l10n.ini
-
-[extras]
-
-[include_toolkit]
-type = hg
-mozilla = releases/mozilla-1.9.2
-repo = http://hg.mozilla.org/
-l10n.ini = toolkit/locales/l10n.ini
--- a/calendar/locales/l10n.ini
+++ b/calendar/locales/l10n.ini
@@ -1,26 +1,17 @@
 [general]
 depth = ../..
 all = calendar/locales/all-locales
 
 [compare]
 dirs = calendar
-# If you are comparing for Sunbird, you must also add:
-#       other-licenses/branding/sunbird
-
-
-# To avoid having localizers translate extra strings, the inclusion for toolkit
-# has been commented out. If you would like to compare for Sunbird, you need to
-# add these in again
-#
 # [includes]
 # # non-central apps might want to use %(topsrcdir)s here, or other vars
 # # RFE: that needs to be supported by compare-locales, too, though
-# toolkit = mozilla/toolkit/locales/l10n.ini
 #
 # [extras]
 #
 # [include_toolkit]
 # type = hg
 # mozilla = mozilla-central
 # repo = http://hg.mozilla.org/
 # l10n.ini = toolkit/locales/l10n.ini
--- a/calendar/providers/gdata/content/gdata-migration.js
+++ b/calendar/providers/gdata/content/gdata-migration.js
@@ -57,17 +57,17 @@ function getMigratableCalendars() {
                             "attendees-only|free-busy|basic)(\\.ics)?$");
         return c.type == "ics" && c.uri.spec.match(re);
     }
 
     return getCalendarManager().getCalendars({}).filter(isMigratable);
 }
 
 /**
- * Load Handler for both the wizard and the Sunbird/Thunderbird main windows.
+ * Load Handler for both the wizard and the Thunderbird main window.
  */
 function gdata_migration_loader() {
     // Only load once
     window.removeEventListener("load", gdata_migration_loader, false);
 
     if (document.documentElement.id == "gdata-migration-wizard") {
         // This is the migration wizard, load the calendars neeeded.
         let listbox = document.getElementById("calendars-listbox");
--- a/calendar/providers/gdata/install.rdf
+++ b/calendar/providers/gdata/install.rdf
@@ -11,24 +11,16 @@
     <em:id>{a62ef8ec-5fdc-40c2-873c-223b8a6925cc}</em:id>
     <em:version>@GDATA_VERSION@</em:version>
     <em:type>2</em:type>
 
     <!-- Target Application this extension can install into,
          with minimum and maximum supported versions. -->
     <em:targetApplication>
       <Description>
-        <!-- Sunbird -->
-        <em:id>{718e30fb-e89b-41dd-9da7-e25a45638b28}</em:id>
-        <em:minVersion>@CALENDAR_VERSION@</em:minVersion>
-        <em:maxVersion>@CALENDAR_VERSION@</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:targetApplication>
-      <Description>
         <!-- Thunderbird -->
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
         <em:minVersion>17.0a1</em:minVersion>
         <em:maxVersion>@THUNDERBIRD_VERSION@</em:maxVersion>
       </Description>
     </em:targetApplication>
     <em:targetApplication>
       <Description>
@@ -36,17 +28,17 @@
         <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
         <em:minVersion>2.14a1</em:minVersion>
         <em:maxVersion>@SEAMONKEY_VERSION@</em:maxVersion>
       </Description>
     </em:targetApplication>
 
     <em:requires>
       <Description>
-        <!-- Lightning (also Sunbird via extension stub) -->
+        <!-- Lightning -->
         <em:id>{e2fda1a4-762b-4020-b5ad-a41df1933103}</em:id>
         <em:minVersion>1.9a1</em:minVersion>
         <em:maxVersion>@CALENDAR_VERSION@</em:maxVersion>
       </Description>
     </em:requires>
 
     <em:name>Provider for Google Calendar</em:name>
     <em:description>Allows bidirectional access to Google Calendar</em:description>
--- a/calendar/providers/gdata/jar.mn
+++ b/calendar/providers/gdata/jar.mn
@@ -2,22 +2,20 @@
 # 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/.
 
 
 gdata-provider.jar:
 % content gdata-provider %content/
 % overlay chrome://calendar/content/calendarCreation.xul chrome://gdata-provider/content/calendarCreation.xul
-% overlay chrome://sunbird/content/calendar.xul chrome://gdata-provider/content/gdata-migration-overlay.xul    application={718e30fb-e89b-41dd-9da7-e25a45638b28}
 % overlay chrome://messenger/content/messenger.xul chrome://gdata-provider/content/gdata-migration-overlay.xul  application={3550f703-e582-4d05-9a08-453d09bdfdc6}
 % overlay chrome://calendar/content/calendar-event-dialog.xul chrome://gdata-provider/content/gdata-calendar-event-dialog.xul
 % overlay chrome://calendar/content/calendar-event-dialog-reminder.xul chrome://gdata-provider/content/gdata-event-dialog-reminder.xul
 % style chrome://calendar/content/calendar-event-dialog.xul chrome://gdata-provider/skin/gdata-event-dialog-reminder.css
-% style chrome://calendar/content/calendar.xul chrome://gdata-provider/skin/gdata-event-dialog-reminder.css     application={718e30fb-e89b-41dd-9da7-e25a45638b28}
 % style chrome://messenger/content/messenger.xul chrome://gdata-provider/skin/gdata-event-dialog-reminder.css   application={3550f703-e582-4d05-9a08-453d09bdfdc6}
     content/calendarCreation.xul                 (content/calendarCreation.xul)
     content/gdata-calendar-event-dialog.xul      (content/gdata-calendar-event-dialog.xul)
     content/gdata-event-dialog-reminder.xul      (content/gdata-event-dialog-reminder.xul)
     content/gdata-migration.js                   (content/gdata-migration.js)
     content/gdata-migration-overlay.xul          (content/gdata-migration-overlay.xul)
     content/gdata-migration-wizard.xul           (content/gdata-migration-wizard.xul)
     content/gcal.png                             (content/gcal.png)
deleted file mode 100644
--- a/calendar/resources/content/calendar.js
+++ /dev/null
@@ -1,207 +0,0 @@
-/* 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/. */
-
-/**
- * Called from calendar.xul window onload.
- */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/Preferences.jsm");
-
-function calendarInit() {
-    // Take care of common initialization
-    commonInitCalendar();
-
-    var toolbox = document.getElementById("calendar-toolbox");
-    toolbox.customizeDone = CalendarToolboxCustomizeDone;
-
-    // Setup the offline manager
-    calendarOfflineManager.init();
-
-    // Handle commandline args
-    for (var i = 0; i < window.arguments.length; i++) {
-        try {
-            var cl = window.arguments[i].QueryInterface(Components.interfaces.nsICommandLine);
-        } catch (ex) {
-            dump("unknown argument passed to main window\n");
-            continue;
-        }
-        handleCommandLine(cl);
-    }
-}
-
-function handleCommandLine(aComLine) {
-    var comLine = aComLine;
-    var calurl = [];
-
-    var validFlags = ["showdate", "subscribe", "url"];
-    var flagsToProcess = [];
-
-    for each (var flag in validFlags) {
-        if (comLine.findFlag(flag, false) >= 0) {
-            flagsToProcess.push(flag);
-        }
-    }
-
-    for each (var flag in flagsToProcess) {
-        var param = comLine.handleFlagWithParam(flag, false);
-
-        switch (flag) {
-            case "showdate":
-                currentView().goToDay(cal.jsDateToDateTime(new Date(param)));
-                break;
-            case "subscribe":
-            case "url":
-                // Double-clicking an .ics file on the Mac causes
-                // LaunchServices to launch Sunbird with the -url command line
-                // switch like so:
-                // sunbird-bin -url file://localhost/Users/foo/mycal.ics -foreground
-                calurl.push(param);
-                break;
-           default:
-                // no-op
-                break;
-        }
-    }
-
-    // Look for arguments without a flag.
-    // This is needed to handle double-click on Windows and Linux.
-    if (comLine.length >= 1) {
-        for (var i = 0; i < comLine.length; i++) {
-            if (!comLine.getArgument(i).match(/^-/) &&
-                !comLine.getArgument(i).match(/^\s/)) {
-                calurl.push( comLine.getArgument(i) );
-            } else {
-                comLine.removeArguments(i, i);
-            }
-        }
-    }
-
-    //subscribe to all files in the calurl array
-    for (var i = 0; i < calurl.length; i++) {
-        var uri = comLine.resolveURI(calurl[i]);
-        var calendar = getCalendarManager().createCalendar("ics", uri);
-
-        // Strip ".ics" from filename for use as calendar name
-        var fullPathRegEx = new RegExp("([^/:]+)[.]ics$");
-        var path = uri.path;
-        var prettyName = path.match(fullPathRegEx);
-
-        var name;
-        if (prettyName && prettyName.length >= 1) {
-            name = decodeURIComponent(prettyName[1]);
-        } else {
-            name = calGetString("calendar", "untitledCalendarName");
-        }
-        calendar.name = name;
-
-        getCalendarManager().registerCalendar(calendar);
-    }
-}
-
-/* Called at midnight to tell us to update the views and other ui bits */
-function refreshUIBits() {
-    try {
-        currentView().goToDay(now());
-        refreshEventTree();
-    } catch (exc) {
-        ASSERT(false, exc);
-    }
-
-    // and schedule again...
-    scheduleMidnightUpdate(refreshUIBits);
-}
-
-/**
- * Steps to be taken when the sunbird calendar window is unloaded.
- */
-function calendarFinish() {
-    // Workaround to make the selected tab persist. See bug 249552.
-    var tabbox = document.getElementById("tablist");
-    tabbox.setAttribute("selectedIndex", tabbox.selectedIndex);
-
-    // Finish the offline manager
-    calendarOfflineManager.uninit();
-
-    // Common finish steps
-    commonFinishCalendar();
-}
-
-function closeCalendar() {
-    self.close();
-}
-
-function openPreferences() {
-    // Check to see if the prefwindow is already open
-    var win = Services.wm.getMostRecentWindow("Calendar:Preferences");
-
-    if (win) {
-        win.focus();
-    } else {
-        // The prefwindow should only be modal on non-instant-apply platforms
-        var instApply = Preferences.get("browser.preferences.instantApply", false);
-
-        var features = "chrome,titlebar,toolbar,centerscreen," +
-                       (instApply ? "dialog=no" : "modal");
-
-        var url = "chrome://calendar/content/preferences/preferences.xul";
-
-        openDialog(url, "Preferences", features);
-    }
-}
-
-function CalendarCustomizeToolbar() {
-  // Disable the toolbar context menu items
-  var menubar = document.getElementById("main-menubar");
-  for (var i = 0; i < menubar.childNodes.length; ++i) {
-    menubar.childNodes[i].setAttribute("disabled", true);
-  }
-
-  var cmd = document.getElementById("cmd_CustomizeToolbars");
-  cmd.setAttribute("disabled", "true");
-
-  window.openDialog("chrome://global/content/customizeToolbar.xul", "CustomizeToolbar",
-                    "chrome,all,dependent", document.getElementById("calendar-toolbox"));
-}
-
-function CalendarToolboxCustomizeDone(aToolboxChanged) {
-  // Re-enable parts of the UI we disabled during the dialog
-  var menubar = document.getElementById("main-menubar");
-  for (var i = 0; i < menubar.childNodes.length; ++i) {
-    menubar.childNodes[i].setAttribute("disabled", false);
-  }
-  var cmd = document.getElementById("cmd_CustomizeToolbars");
-  cmd.removeAttribute("disabled");
-
-  // XXX Shouldn't have to do this, but I do
-  window.focus();
-}
-
-function changeNumberOfWeeks(menuitem) {
-  currentView().weeksInView = menuitem.value;
-}
-
-function pickAndGoToDate() {
-  var initialDate = currentView().selectedDay.getInTimezone(floating()).jsDate;
-  var callback = function receiveAndGoToDate(pickedDate) {
-    currentView().goToDay(cal.jsDateToDateTime(pickedDate));
-    getMinimonth().value = pickedDate;
-  };
-  openDialog("chrome://sunbird/content/calendar-gotodate-dialog.xul",
-             "CalendarGoToDateDialog",
-             "chrome,modal",
-             {callback: callback, date: initialDate});
-}
-
-function sbSwitchToView(newView) {
-  var mwWeeksCommand = document.getElementById("menu-numberofweeks-inview");
-  if (newView == "multiweek") {
-      mwWeeksCommand.removeAttribute("disabled");
-  } else {
-      mwWeeksCommand.setAttribute("disabled", true);
-  }
-
-  // Call the common view switching code in calendar-views.js
-  switchToView(newView);
-}
deleted file mode 100644
--- a/calendar/resources/content/calendarService.js
+++ /dev/null
@@ -1,166 +0,0 @@
-/* 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/. */
-
-/*
- * This file contains the following calendar related components:
- * 1. Command line handler service, for responding to the -webcal command line
- *    option. (CLineHandler)
- * 2. Content handler for responding to content of type text/calendar
- *    (ICALContentHandler)
- * 3. Protocol handler for supplying a channel to the browser when an webcal://
- *    link is clicked. (ICALProtocolHandler)
- * 4. A (nearly empty) imeplementation of nsIChannel for telling the browser
- *    that webcal:// links have the content type text/calendar (BogusChannel)
- */
-
-Components.utils.import("resource://gre/modules/Services.jsm");
-Components.utils.import("resource://gre/modules/XPCOMUtils.jsm");
-Components.utils.import("resource://calendar/modules/calUtils.jsm");
-
-/* Command Line handler service */
-function CLineService() {
-    this.wrappedJSObject = this;
-}
-const CLineServiceClassID = Components.ID("{65ef4b0b-d116-4b93-bf8a-84525992bf27}");
-const CLineServiceInterfaces = [Components.interfaces.nsICommandLineHandler];
-CLineService.prototype = {
-    classID: CLineServiceClassID,
-    QueryInterface: XPCOMUtils.generateQI(CLineServiceInterfaces),
-    classInfo: XPCOMUtils.generateCI({
-        classID: CLineServiceClassID,
-        contractID: "@mozilla.org/commandlinehandler/general-startup;1?type=calendar",
-        classDescription: "Calendar Commandline Handler",
-        interfaces: CLineServiceInterfaces,
-        flags: Components.interfaces.nsIClassInfo.SINGLETON
-    }),
-
-    /* nsICommandLineHandler */
-    handle : function service_handle(cmdLine) {
-        if (!cmdLine.preventDefault) {
-            // just pass all arguments on to the Sunbird window
-            Services.ww.openWindow(null, "chrome://sunbird/content/calendar.xul",
-                                   "_blank", "chrome,dialog=no,all", cmdLine);
-            cmdLine.preventDefault = true;
-        }
-    },
-
-    helpInfo : "  -subscribe or -url   Pass in a path pointing to a calendar\n" +
-               "                       to subscribe to.\n" +
-               "  -showdate            Pass in a value for a javascript date\n" +
-               "                       to show this date on startup.\n"
-};
-
-/* text/calendar content handler */
-function ICALContentHandler() {
-    this.wrappedJSObject = this;
-}
-const ICALContentHandlerClassID = Components.ID("{9ebf4c8a-7770-40a6-aeed-e1738129535a}");
-const ICALContentHandlerInterfaces = [Components.interfaces.nsIContentHandler];
-ICALContentHandler.prototype = {
-    classID: ICALContentHandlerClassID,
-    QueryInterface: XPCOMUtils.generateQI(ICALContentHandlerInterfaces),
-    classInfo: XPCOMUtils.generateCI({
-        classID: ICALContentHandlerClassID,
-        contractID: "@mozilla.org/uriloader/content-handler;1?type=text/calendar",
-        classDescription: "text/calendar Content Handler",
-        interfaces: ICALContentHandlerInterfaces
-    }),
-
-    handleContent: function handleContent(aContentType, aWindowTarget, aRequest) {
-        let channel = aRequest.QueryInterface(Components.interfaces.nsIChannel);
-
-        // Cancel the request ...
-        let uri = channel.URI;
-        const NS_BINDING_ABORTED = 0x804b0002 // from nsError.h
-        aRequest.cancel(NS_BINDING_ABORTED);
-
-        // ... Subscribe to the uri ...
-        let calendarManager = cal.getCalendarManager();
-        let newCalendar = calendarManager.createCalendar('ics', uri);
-
-        // XXX Come up with a better name, like the filename or X-WR-CALNAME
-        // XXX Also, make up a color
-        newCalendar.name = "temp";
-
-        calendarManager.registerCalendar(newCalendar);
-
-        // ... and open or focus a calendar window.
-        let w = cal.getCalendarWindow();
-
-        if (w) {
-            w.focus();
-        } else {
-            w = Services.appShell.hiddenDOMWindow;
-
-            let args = {};
-            args.channel = channel;
-            w.openDialog("chrome://sunbird/content/calendar.xul",
-                         "calendar",
-                         "chrome,menubar,resizable,scrollbars,status,toolbar,dialog=no",
-                         args);
-        }
-    }
-};
-
-function NYI() {
-    throw Components.results.NS_ERROR_NOT_IMPLEMENTED;
-}
-
-/* bogus webcal channel used by the ICALProtocolHandler */
-function BogusChannel(aURI) {
-    this.URI = aURI;
-    this.originalURI = aURI;
-}
-const BogusChannelClassID = Components.ID("{1e36ef5d-92d9-488f-ada6-9f15a1b57acf}");
-const BogusChannelInterfaces = [
-    Components.interfaces.nsIRequest,
-    Components.interfaces.nsIChannel
-];
-BogusChannel.prototype = {
-    classID: BogusChannelClassID,
-    QueryInterface: XPCOMUtils.generateQI(BogusChannelInterfaces),
-    classInfo: XPCOMUtils.generateCI({
-        classID: BogusChannelClassID,
-        contractID: "@mozilla.org/calendar/webcal-channel;1",
-        classDescription: "webcal bogus channel",
-        interfaces: BogusChannelInterfaces
-    }),
-
-    URI: null,
-    originalURI: null,
-
-    /* nsIChannel */
-    loadAttributes: null,
-    contentType: "text/calendar",
-    contentLength: 0,
-    owner: null,
-    loadGroup: null,
-    notificationCallbacks: null,
-    securityInfo: null,
-
-    open: NYI,
-    asyncOpen: NYI,
-
-    asyncOpen: function asyncOpen(observer, ctxt) {
-        observer.onStartRequest(this, ctxt);
-    },
-
-    asyncRead: function asyncRead(listener, ctxt) {
-        return listener.onStartRequest(this, ctxt);
-    },
-
-    /* nsIRequest */
-    isPending: function() true,
-    status: Components.results.NS_OK,
-
-    cancel: function cancel(aStatus) {
-        this.status = aStatus;
-    },
-
-    suspend: NYI,
-    resume: NYI
-};
-
-var components = [CLineService, ICALContentHandler, BogusChannel];
-var NSGetFactory = XPCOMUtils.generateNSGetFactory(components);
deleted file mode 100644
--- a/calendar/resources/content/calendarService.manifest
+++ /dev/null
@@ -1,9 +0,0 @@
-component {65ef4b0b-d116-4b93-bf8a-84525992bf27} calendarService.js
-contract @mozilla.org/commandlinehandler/general-startup;1?type=calendar {65ef4b0b-d116-4b93-bf8a-84525992bf27}
-category command-line-handler x-default @mozilla.org/commandlinehandler/general-startup;1?type=calendar
-
-component {9ebf4c8a-7770-40a6-aeed-e1738129535a} calendarService.js
-contract @mozilla.org/uriloader/content-handler;1?type=text/calendar {9ebf4c8a-7770-40a6-aeed-e1738129535a}
-
-component {1e36ef5d-92d9-488f-ada6-9f15a1b57acf} calendarService.js
-contract @mozilla.org/calendar/webcal-channel;1 {1e36ef5d-92d9-488f-ada6-9f15a1b57acf}
--- a/calendar/resources/jar.mn
+++ b/calendar/resources/jar.mn
@@ -1,16 +1,15 @@
 #filter substitution
 # 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/.
 
 calendar.jar:
 % content calendar %content/calendar/
-    content/calendar/calendar.js                           (content/calendar.js)
     content/calendar/calendarCreation.xul                  (content/calendarCreation.xul)
     content/calendar/calendarCreation.js                   (content/calendarCreation.js)
     content/calendar/publish.js                            (content/publish.js)
     content/calendar/publishDialog.js                      (content/publishDialog.js)    
     content/calendar/publishDialog.xul                     (content/publishDialog.xul)
     content/calendar/mouseoverPreviews.js                  (content/mouseoverPreviews.js)
     content/calendar/sound.wav                             (content/sound.wav)
     content/calendar/datetimepickers/datetimepickers.css   (content/datetimepickers/datetimepickers.css)
--- a/calendar/resources/moz.build
+++ b/calendar/resources/moz.build
@@ -1,11 +1,6 @@
 # vim: set filetype=python:
 # 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/.
 
-EXTRA_COMPONENTS += [
-    'content/calendarService.js',
-    'content/calendarService.manifest',
-]
-
 JAR_MANIFESTS += ['jar.mn']
--- a/calendar/timezones/install.rdf
+++ b/calendar/timezones/install.rdf
@@ -10,25 +10,16 @@
   <Description about="urn:mozilla:install-manifest">
     <em:id>calendar-timezones@mozilla.org</em:id>
     <em:version>@TIMEZONES_VERSION@</em:version>
 
     <!-- Target Application this extension can install into,
          with minimum and maximum supported versions. -->
     <em:targetApplication>
       <Description>
-        <!-- Sunbird; we define an upper limit, because we come
-             with a top-notch calendar-timezones.xpi on every release -->
-        <em:id>{718e30fb-e89b-41dd-9da7-e25a45638b28}</em:id>
-        <em:minVersion>0.9</em:minVersion>
-        <em:maxVersion>@CALENDAR_VERSION@</em:maxVersion>
-      </Description>
-    </em:targetApplication>
-    <em:targetApplication>
-      <Description>
         <!-- Thunderbird -->
         <em:id>{3550f703-e582-4d05-9a08-453d09bdfdc6}</em:id>
         <em:minVersion>2.0</em:minVersion>
         <em:maxVersion>@THUNDERBIRD_VERSION@</em:maxVersion>
       </Description>
     </em:targetApplication>
     <em:targetApplication>
       <Description>
@@ -36,16 +27,16 @@
         <em:id>{92650c4d-4b8e-4d2a-b7eb-24ecf4f6b63a}</em:id>
         <em:minVersion>2.0</em:minVersion>
         <em:maxVersion>@SEAMONKEY_VERSION@</em:maxVersion>
        </Description>
      </em:targetApplication>
 
     <em:name>Timezone Definitions for Mozilla Calendar</em:name>
     <em:unpack>true</em:unpack>
-    <em:description>Timezone definitions required by Sunbird and Lightning</em:description>
+    <em:description>Timezone definitions required by Lightning</em:description>
     <em:creator>Mozilla Calendar Project</em:creator>
     <em:iconURL>chrome://calendar-timezones/skin/addon-icon32.png</em:iconURL>
 #if 0
     <em:homepageURL>https://addons.mozilla.org/en-US/thunderbird/addon/xxx todo</em:homepageURL>
 #endif
   </Description>
 </RDF>