1 function getAppFile(aPrefName)
5 var prefs = Components.classes["@mozilla.org/preferences-service;1"];
6 prefs = prefs.getService(Components.interfaces.nsIPrefBranch);
7 var appFile = prefs.getComplexValue(aPrefName, Components.interfaces.nsILocalFile);
16 function openApp(aPrefName)
18 var appFile = getAppFile(aPrefName);
22 // this should cause the operating system to simulate double clicking
23 // on the location which should launch your calendar application.
32 function haveInternalCalendar()
34 return ("@mozilla.org/ical-container;1" in Components.classes);
37 function openOtherCal()
39 if (!haveInternalCalendar())
40 openApp("task.calendar.location");
43 function OtherTasksOnLoad()
45 var otherCalTaskBarIcon = document.getElementById("mini-other-cal");
46 var otherCalMenuItem = document.getElementById("tasksMenuOtherCal");
48 var appFile = getAppFile("task.calendar.location");
49 if (appFile && !haveInternalCalendar())
51 if (otherCalTaskBarIcon)
52 otherCalTaskBarIcon.hidden = false;
54 otherCalMenuItem.hidden = false;
58 addEventListener("load", OtherTasksOnLoad, false);