add:  if (aCalendar.canRefresh) {   var calendars = getCalendarManager().getCalendars({}); function calCanRefresh(cal) { return (cal.canRefresh && !cal.uri.equals(aCalendar.uri)); } if (!calendars.some(calCanRefresh)) { var remoteCommand = document.getElementById("reload_remote_calendars"); remoteCommand.setAttribute("disabled", true); } } 
context:     onCalendarUnregistering: function(aCalendar) {        var item = getListItem(aCalendar);        if (item) {            var listbox = document.getElementById("list-calendars-listbox");            listbox.removeChild(item);            // This is called before the calendar is actually deleted, so ==1 is correct            if (getCalendarManager().getCalendars({}).length <= 1) {                // If there are no calendars, you can't create events/tasks                document.getElementById("new_command").setAttribute("disabled", true);                document.getElementById("new_todo_command").setAttribute("disabled", true);            }        }    },
meta: 9421	/local1/tlutelli/issta_data/temp/all_js/javascript/2006_temp/2006/9421/2b17818e02f0b9e45da9ae8b53baad3eb4059173/calendarManagement.js/buggy/calendar/resources/content/calendarManagement.js