diff --git a/calendar/resources/content/calendar.js b/calendar/resources/content/calendar.js index 7929b004efb0..80a8b4c978d5 100644 --- a/calendar/resources/content/calendar.js +++ b/calendar/resources/content/calendar.js @@ -668,6 +668,26 @@ function editCalendarDialog(event) openCalendarProperties(document.popupNode.calendar, null); } +function calendarListboxDoubleClick(event) { + if(event.target.calendar) + openCalendarProperties(event.target.calendar, null); + else + openCalendarWizard(); +} + +function checkCalListTarget() { + if(!document.popupNode.calendar) { + document.getElementById("calpopup-edit").setAttribute("disabled", "true"); + document.getElementById("calpopup-delete").setAttribute("disabled", "true"); + document.getElementById("calpopup-publish").setAttribute("disabled", "true"); + } + else { + document.getElementById("calpopup-edit").removeAttribute("disabled"); + document.getElementById("calpopup-delete").removeAttribute("disabled"); + document.getElementById("calpopup-publish").removeAttribute("disabled"); + } +} + function deleteCalendar(event) { var cal = document.popupNode.calendar diff --git a/calendar/resources/content/calendar.xul b/calendar/resources/content/calendar.xul index 1e0d08c24834..12612db725c3 100644 --- a/calendar/resources/content/calendar.xul +++ b/calendar/resources/content/calendar.xul @@ -141,7 +141,7 @@ - + #ifdef XP_MACOSX @@ -401,20 +401,25 @@ - + @@ -525,7 +530,8 @@ + contextmenu="calendarlist-context-menu" + ondblclick="calendarListboxDoubleClick(event)"> diff --git a/calendar/sunbird/base/content/calendar-menubar.inc b/calendar/sunbird/base/content/calendar-menubar.inc index a4eced27de29..ed7c336b7e34 100644 --- a/calendar/sunbird/base/content/calendar-menubar.inc +++ b/calendar/sunbird/base/content/calendar-menubar.inc @@ -67,7 +67,7 @@ key="new_calendar_key" label="&calendar.new.server.label;" accesskey="&calendar.new.server.accesskey;" - observes="new_local_calendar_command"/> + observes="new_calendar_command"/> + observes="new_calendar_command"/> - - - - - - + + + @@ -125,7 +122,7 @@ - + #ifdef XP_MACOSX diff --git a/calendar/sunbird/base/content/calendar.xul b/calendar/sunbird/base/content/calendar.xul index 31c51b1c24b5..9abc14145bed 100644 --- a/calendar/sunbird/base/content/calendar.xul +++ b/calendar/sunbird/base/content/calendar.xul @@ -237,20 +237,25 @@ - + + observes="new_calendar_command"/> + observes="edit_calendar_command"/> + observes="delete_calendar_command"/> @@ -346,7 +351,7 @@ id="calendar-subscribe-button" label="&calendar.subscribe.button.label;" tooltiptext="&calendar.subscribe.button.tooltip;" - observes="new_server_command"/> + observes="new_calendar_command"/> + contextmenu="calendarlist-context-menu" + ondblclick="calendarListboxDoubleClick(event)"> diff --git a/calendar/sunbird/base/content/hiddenWindow.js b/calendar/sunbird/base/content/hiddenWindow.js index 2f30e620087f..db13747973fc 100644 --- a/calendar/sunbird/base/content/hiddenWindow.js +++ b/calendar/sunbird/base/content/hiddenWindow.js @@ -46,7 +46,7 @@ function hiddenWindowStartup() window.focus(); // Disable menus which are not appropriate - var disabledItems = ['new_command', 'new_local_calendar_command', + var disabledItems = ['new_command', 'new_calendar_command', 'modify_command', 'close_calendar_command', 'send_event_command', 'print_command', 'cut_command', 'copy_command', 'paste_command', 'delete_command', 'delete_todo_command', 'select_all_command', @@ -54,9 +54,9 @@ function hiddenWindowStartup() 'month_view_command', 'cmd_CustomizeToolbars', 'go_today_command', 'go_date_command', 'previous_command', 'next_command', 'wizard_command', 'import_command', 'export_command', - 'new_server_command', 'publish_events_command', 'modify_todo_command', - 'edit_local_calendar_command', 'edit_server_command', - 'delete_server_command', 'find_new_calendar_command', + 'publish_events_command', 'modify_todo_command', + 'edit_calendar_command', + 'delete_calendar_command', 'find_new_calendar_command', 'reload_remote_calendars', 'publish_calendar']; for (var id in disabledItems) {