зеркало из https://github.com/mozilla/gecko-dev.git
Moves sunbird to using the new commands. Also fixes the calendar listbox popup
to disable certain options if it isn't clicked on an actual calendar. bug 300254, r=mvl, patch by jminta
This commit is contained in:
Родитель
6c5c2aff09
Коммит
4ee5743a9b
|
@ -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
|
||||
|
|
|
@ -141,7 +141,7 @@
|
|||
<key id="new_event_key" key="&event.new.event.key;" observes="new_command" modifiers="accel"/>
|
||||
<key id="new_todo_key" key="&event.new.todo.key;" observes="new_todo_command" modifiers="accel"/>
|
||||
<key id="modify_event_key" key="&event.edit.event.key;" observes="modify_command" modifiers="accel"/>
|
||||
<key id="new_calendar_key" key="&calendar.new.server.key;" observes="new_local_calendar_command" modifiers="accel"/>
|
||||
<key id="new_calendar_key" key="&calendar.new.server.key;" observes="new_calendar_command" modifiers="accel"/>
|
||||
<key id="open_calendar_key" key="&calendar.open.file.key;" observes="open_local_calendar_command" modifiers="accel"/>
|
||||
<key id="key_close" key="&calendar.menu.options.close.key;" observes="close_calendar_command" modifiers="accel"/>
|
||||
#ifdef XP_MACOSX
|
||||
|
@ -401,20 +401,25 @@
|
|||
</popup>
|
||||
|
||||
<!-- CALENDAR LIST CONTEXT MENU -->
|
||||
<popup id="calendarlist-context-menu">
|
||||
<popup id="calendarlist-context-menu" onpopupshowing="checkCalListTarget()">
|
||||
<menuitem label="&calendar.context.newserver.label;"
|
||||
id="calpopup-new"
|
||||
accesskey="&calendar.context.newserver.accesskey;"
|
||||
observes="new_calendar_command"/>
|
||||
<menuitem label="&calendar.context.editserver.label;"
|
||||
id="calpopup-edit"
|
||||
accesskey="&calendar.context.editserver.accesskey;"
|
||||
observes="edit_calendar_command"/>
|
||||
<menuitem label="&calendar.context.deleteserver.label;"
|
||||
id="calpopup-delete"
|
||||
accesskey="&calendar.context.deleteserver.accesskey;"
|
||||
observes="delete_calendar_command"/>
|
||||
<menuitem label="&calendar.context.reloadserver.label;"
|
||||
id="calpopup-reload"
|
||||
accesskey="&calendar.context.reloadserver.accesskey;"
|
||||
observes="reload_remote_calendars"/>
|
||||
<menuitem label="&calendar.context.publish.label;"
|
||||
id="calpopup-publish"
|
||||
accesskey="&calendar.context.publish.accesskey;"
|
||||
observes="publish_calendar"/>
|
||||
</popup>
|
||||
|
@ -525,7 +530,8 @@
|
|||
<tabpanel>
|
||||
<!--<vbox id="left-hand-above-splitter" flex="1">-->
|
||||
<listbox id="list-calendars-listbox" class="unifinder-tree-class" flex="1"
|
||||
contextmenu="calendarlist-context-menu">
|
||||
contextmenu="calendarlist-context-menu"
|
||||
ondblclick="calendarListboxDoubleClick(event)">
|
||||
<listcols>
|
||||
<listcol/>
|
||||
<listcol/>
|
||||
|
|
|
@ -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"/>
|
||||
<menuitem id="calendar-open-calendar-menu"
|
||||
key="open_calendar_key"
|
||||
label="&calendar.open.file.label;"
|
||||
|
@ -89,7 +89,7 @@
|
|||
<menuitem id="calendar-addserver-menu"
|
||||
label="&calendar.subscribe.label;"
|
||||
accesskey="&calendar.subscribe.accesskey;"
|
||||
observes="new_server_command"/>
|
||||
observes="new_calendar_command"/>
|
||||
<menuitem id="calendar-reloadserver-menu"
|
||||
key="reload_server_key"
|
||||
label="&calendar.reloadserver.label;"
|
||||
|
|
|
@ -72,12 +72,9 @@
|
|||
<command id="modify_todo_command" oncommand="modifyToDoCommand( event )"/>
|
||||
<command id="delete_todo_command" oncommand="deleteToDoCommand()" disabled="true"/>
|
||||
|
||||
<command id="new_local_calendar_command" oncommand="newCalendarDialog()"/>
|
||||
<command id="open_local_calendar_command" oncommand="gCalendarWindow.calendarManager.launchOpenCalendarFileDialog()"/>
|
||||
<command id="edit_local_calendar_command" oncommand="gCalendarWindow.calendarManager.launchEditCalendarDialog()"/>
|
||||
<command id="new_server_command" oncommand="gCalendarWindow.calendarManager.launchAddRemoteCalendarDialog()"/>
|
||||
<command id="edit_server_command" oncommand="gCalendarWindow.calendarManager.launchEditRemoteCalendarDialog()"/>
|
||||
<command id="delete_server_command" oncommand="deleteCalendar(event)"/>
|
||||
<command id="new_calendar_command" oncommand="newCalendarDialog()"/>
|
||||
<command id="edit_calendar_command" oncommand="editCalendarDialog(event)"/>
|
||||
<command id="delete_calendar_command" oncommand="deleteCalendar(event)"/>
|
||||
<command id="find_new_calendar_command" oncommand="goFindNewCalendars()"/>
|
||||
|
||||
<command id="next_command" oncommand="gCalendarWindow.currentView.goToNext()"/>
|
||||
|
@ -125,7 +122,7 @@
|
|||
<key id="new_journal_key" key="J" modifiers="accel"/>
|
||||
|
||||
<key id="modify_event_key" key="&event.edit.event.key;" observes="modify_command" modifiers="accel"/>
|
||||
<key id="new_calendar_key" key="&calendar.new.server.key;" observes="new_local_calendar_command" modifiers="accel"/>
|
||||
<key id="new_calendar_key" key="&calendar.new.server.key;" observes="new_calendar_command" modifiers="accel"/>
|
||||
<key id="open_calendar_key" key="&calendar.open.file.key;" observes="open_local_calendar_command" modifiers="accel"/>
|
||||
<key id="key_close" key="&calendar.menu.options.close.key;" observes="close_calendar_command" modifiers="accel"/>
|
||||
#ifdef XP_MACOSX
|
||||
|
|
|
@ -237,20 +237,25 @@
|
|||
</popup>
|
||||
|
||||
<!-- CALENDAR LIST CONTEXT MENU -->
|
||||
<popup id="calendarlist-context-menu">
|
||||
<popup id="calendarlist-context-menu" onpopupshowing="checkCalListTarget()">
|
||||
<menuitem label="&calendar.context.newserver.label;"
|
||||
id="calpopup-new"
|
||||
accesskey="&calendar.context.newserver.accesskey;"
|
||||
observes="new_local_calendar_command"/>
|
||||
observes="new_calendar_command"/>
|
||||
<menuitem label="&calendar.context.editserver.label;"
|
||||
id="calpopup-edit"
|
||||
accesskey="&calendar.context.editserver.accesskey;"
|
||||
observes="edit_local_calendar_command"/>
|
||||
observes="edit_calendar_command"/>
|
||||
<menuitem label="&calendar.context.deleteserver.label;"
|
||||
id="calpopup-delete"
|
||||
accesskey="&calendar.context.deleteserver.accesskey;"
|
||||
observes="delete_server_command"/>
|
||||
observes="delete_calendar_command"/>
|
||||
<menuitem label="&calendar.context.reloadserver.label;"
|
||||
id="calpopup-reload"
|
||||
accesskey="&calendar.context.reloadserver.accesskey;"
|
||||
observes="reload_remote_calendars"/>
|
||||
<menuitem label="&calendar.context.publish.label;"
|
||||
id="calpopup-publish"
|
||||
accesskey="&calendar.context.publish.accesskey;"
|
||||
observes="publish_calendar"/>
|
||||
</popup>
|
||||
|
@ -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"/>
|
||||
|
||||
<toolbarbutton class="toolbarbutton-1"
|
||||
id="calendar-publish-button"
|
||||
|
@ -451,7 +456,8 @@
|
|||
<tabpanel>
|
||||
<!--<vbox id="left-hand-above-splitter" flex="1">-->
|
||||
<listbox id="list-calendars-listbox" class="unifinder-tree-class" flex="1"
|
||||
contextmenu="calendarlist-context-menu">
|
||||
contextmenu="calendarlist-context-menu"
|
||||
ondblclick="calendarListboxDoubleClick(event)">
|
||||
<listcols>
|
||||
<listcol/>
|
||||
<listcol/>
|
||||
|
|
|
@ -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)
|
||||
{
|
||||
|
|
Загрузка…
Ссылка в новой задаче