calendar/lightning/content/messenger-overlay-sidebar.xul
author Chris Coulson <chris.coulson@canonical.com>
Thu, 01 Mar 2012 12:27:21 +0100
changeset 10972 d3f4108df62e0083a39780d4d24eb8c3729032b8
parent 10543 fbbc916ed9876b1b85daca347d4f64c5824a17d6
child 12286 84ac3c71109811da751f0ef2d72108075938f094
permissions -rw-r--r--
Fix bug 730078 - Don't hardcode defaultset in an overlay, as it can break migrations and conflict with other addons. r=philipp

<?xml version="1.0"?>

<!-- ***** BEGIN LICENSE BLOCK *****
   - Version: MPL 1.1/GPL 2.0/LGPL 2.1
   -
   - The contents of this file are subject to the Mozilla Public License Version
   - 1.1 (the "License"); you may not use this file except in compliance with
   - the License. You may obtain a copy of the License at
   - http://www.mozilla.org/MPL/
   -
   - Software distributed under the License is distributed on an "AS IS" basis,
   - WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License
   - for the specific language governing rights and limitations under the
   - License.
   -
   - The Original Code is calendar views.
   -
   - The Initial Developer of the Original Code is Oracle Corporation
   - Portions created by the Initial Developer are Copyright (C) 2005
   - the Initial Developer. All Rights Reserved.
   -
   - Contributor(s):
   -   Mike Shaver <shaver@mozilla.org>
   -   Stuart Parmenter <stuart.parmenter@oracle.com>
   -   Vladimir Vukicevic <vladimir@pobox.com>
   -   Joey Minta <jminta@gmail.com>
   -   Simon Paquet <bugzilla@babylonsounds.com>
   -   Stefan Sitter <ssitter@googlemail.com>
   -   Philipp Kewisch <mozilla@kewis.ch>
   -   Michael Buettner <michael.buettner@sun.com>
   -   Berend Cornelius <berend.cornelius@sun.com>
   -   Martin Schroeder <mschroeder@mozilla.x-home.org>
   -   Matthew Mecca <matthew.mecca@gmail.com>
   -
   - Alternatively, the contents of this file may be used under the terms of
   - either the GNU General Public License Version 2 or later (the "GPL"), or
   - the GNU Lesser General Public License Version 2.1 or later (the "LGPL"),
   - in which case the provisions of the GPL or the LGPL are applicable instead
   - of those above. If you wish to allow use of your version of this file only
   - under the terms of either the GPL or the LGPL, and not to allow others to
   - use your version of this file under the terms of the MPL, indicate your
   - decision by deleting the provisions above and replace them with the notice
   - and other provisions required by the GPL or the LGPL. If you do not delete
   - the provisions above, a recipient may use your version of this file under
   - the terms of any one of the MPL, the GPL or the LGPL.
   -
   - ***** END LICENSE BLOCK ***** -->

<!DOCTYPE overlay
[
  <!ENTITY % dtd1 SYSTEM "chrome://lightning/locale/lightning.dtd" > %dtd1;
  <!ENTITY % dtd2 SYSTEM "chrome://calendar/locale/menuOverlay.dtd" > %dtd2;
  <!ENTITY % dtd3 SYSTEM "chrome://calendar/locale/calendar.dtd" > %dtd3;
  <!ENTITY % dtd4 SYSTEM "chrome://lightning/locale/lightning-toolbar.dtd" > %dtd4;
  <!ENTITY % messengerDTD SYSTEM "chrome://messenger/locale/messenger.dtd"> %messengerDTD;
]>

<?xml-stylesheet href="chrome://lightning/skin/lightning.css" type="text/css"?>

<?xml-stylesheet href="chrome://calendar/content/calendar-view-bindings.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/calendar-views.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/content/calendar-bindings.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/widgets/minimonth.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/content/widgets/calendar-widget-bindings.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/content/datetimepickers/datetimepickers.css" type="text/css"?>
<?xml-stylesheet href="chrome://calendar/skin/today-pane.css" type="text/css"?>

<?xul-overlay href="chrome://calendar/content/calendar-calendars-list.xul"?>
<?xul-overlay href="chrome://calendar/content/calendar-common-sets.xul"?>
<?xul-overlay href="chrome://calendar/content/calendar-views.xul"?>

<?xul-overlay href="chrome://lightning/content/lightning-toolbar.xul"?>
<?xul-overlay href="chrome://lightning/content/lightning-menus.xul"?>

<overlay id="ltnSidebarOverlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">
<!-- All JS files that messenger-overlay-sidebar.xul wishes to include *must* go into the
     calendar-scripts.inc file (all scripts shared with Sunbird) or lightning-scripts.inc
     file (scripts relevant for Lightning-only). -->
#include ../../base/content/calendar-scripts.inc
#include lightning-scripts.inc

  <window id="messengerWindow">
    <!-- Be sure to keep these sets, since they will be overlayed by
         calendar/base/content/calendar-common-sets.xul -->
    <commandset id="calendar_commands">
      <command id="agenda_delete_event_command" oncommand="agendaListbox.deleteSelectedItem(false);"/>
      <command id="agenda_edit_event_command" oncommand="agendaListbox.editSelectedItem(event);"/>
      <command id="switch2calendar"
               oncommand="document.getElementById('tabmail').openTab('calendar', { title: document.getElementById('calendar-tab-button').getAttribute('title') })"/>
      <command id="switch2task"
               oncommand="document.getElementById('tabmail').openTab('tasks', { title: document.getElementById('task-tab-button').getAttribute('title') })"/>
      <command id="new_calendar_tab"
               oncommand="document.getElementById('tabmail').openTab('calendar', { title: document.getElementById('calendar-tab-button').getAttribute('title') })"/>
      <command id="new_task_tab"
               oncommand="document.getElementById('tabmail').openTab('tasks', { title: document.getElementById('task-tab-button').getAttribute('title') })"/>
      <command id="calendar_go_to_today_command"
               observes="calendar_mode_calendar"
               oncommand="document.getElementById('tabmail').openTab('calendar', { title: document.getElementById('calendar-tab-button').getAttribute('title') }); goToDate(now())"/>
    </commandset>

    <keyset id="calendar-keys">
      <key id="openLightningKey"
           key="&lightning.keys.event.showCalendar.key;"
           modifiers="accel, shift"
           observes="new_calendar_tab"/>
      <key id="openTasksKey"
           key="&lightning.keys.event.showTasks.key;"
           modifiers="accel, shift"
           command="new_task_tab"/>
      <key id="todaypanekey" command="calendar_toggle_todaypane_command" keycode="VK_F11"/>
      <key id="calendar-new-event-key" key="&lightning.keys.event.new;" modifiers="accel" command="calendar_new_event_command"/>
      <key id="calendar-new-todo-key" key="&lightning.keys.todo.new;" modifiers="accel" command="calendar_new_todo_command"/>
    </keyset>

    <broadcasterset id="calendar_broadcasters">
      <broadcaster id="filterBroadcaster" value="all"/>
    </broadcasterset>

    <popupset id="calendar-popupset"/>
  </window>

  <toolbar id="tabbar-toolbar">
    <toolbarbutton id="calendar-tab-button"
                   class="toolbarbutton-1"
                   title="&lightning.toolbar.calendar.label;"
                   tooltiptext="&lightning.toolbar.calendar.tooltip;"
                   command="new_calendar_tab"/>
    <toolbarbutton id="task-tab-button"
                   class="toolbarbutton-1"
                   title="&lightning.toolbar.task.label;"
                   tooltiptext="&lightning.toolbar.task.tooltip;"
                   command="new_task_tab"/>
  </toolbar>

  <tabpanels id="tabpanelcontainer">
    <vbox id="calendarTabPanel">
      <!-- Unfortunately we use the same panel for task and calendar tabs, so
           we need to differ which toolbar is being shown. The actual toolbar
           content will be added via a further overlay -->
      <deck id="calendar-toolbar-deck">
        <toolbox id="calendar-toolbox"/>
        <toolbox id="task-toolbox"/>
        <observes element="modeBroadcaster"
                  attribute="mode"
                  onbroadcast="this.parentNode.selectedPanel = document.getElementById(document.getElementById('modeBroadcaster').getAttribute('mode') + '-toolbox');"/>
      </deck>
      <hbox id="calendarContent" flex="1">
        <vbox id="ltnSidebar"
              width="200"
              persist="collapsed width">
          <modevbox id="minimonth-pane" mode="calendar,task" broadcaster="modeBroadcaster" refcontrol="calendar_toggle_minimonthpane_command">
            <vbox align="center">
              <hbox id="calMinimonthBox" pack="center">
                <minimonth id="calMinimonth" onchange="minimonthPick(this.value);" freebusy="true"/>
              </hbox>
            </vbox>
          </modevbox>
          <separator id="minimonth-splitter" minwidth="100"/>
          <vbox id="calendar-panel" flex="1">
            <modevbox id="task-filter-pane" mode="task" broadcaster="modeBroadcaster" refcontrol="calendar_toggle_filter_command">
              <treenode-checkbox id="task-tree-filter-header"
                               checked="true"
                               class="treenode-checkbox"
                               label="&calendar.task.filter.title.label;"/>
              <modevbox id="task-filtertree-pane" flex="1" mode="task" broadcaster="modeBroadcaster" refcontrol="task-tree-filter-header">
                 <radiogroup id="task-tree-filtergroup" class="task-tree-subpane"
                             persist="value">
                   <observes element="filterBroadcaster"
                             attribute="value"
                             onbroadcast="checkRadioControl(this.parentNode, document.getElementById('filterBroadcaster').getAttribute('value'));"/>
                   <radio id="opt_throughcurrent_filter" label="&calendar.task.filter.current.label;" value="throughcurrent" command="calendar_task_filter_command"/>
                   <radio id="opt_today_filter" label="&calendar.task.filter.today.label;" value="throughtoday" command="calendar_task_filter_command"/>
                   <radio id="opt_next7days_filter" label="&calendar.task.filter.next7days.label;" value="throughsevendays" command="calendar_task_filter_command"/>
                   <radio id="opt_notstarted_filter" label="&calendar.task.filter.notstarted.label;" value="notstarted" command="calendar_task_filter_command"/>
                   <radio id="opt_overdue_filter" label="&calendar.task.filter.overdue.label;" value="overdue" command="calendar_task_filter_command"/>
                   <radio id="opt_completed_filter" label="&calendar.task.filter.completed.label;" value="completed" command="calendar_task_filter_command"/>
                   <radio id="opt_open_filter" label="&calendar.task.filter.open.label;" value="open" command="calendar_task_filter_command"/>
                   <radio id="opt_all_filter" label="&calendar.task.filter.all.label;" value="all" command="calendar_task_filter_command"/>
                 </radiogroup>
              </modevbox>
            </modevbox>
            <modevbox id="calendar-list-pane" flex="1" mode="calendar,task" broadcaster="modeBroadcaster"
                      refcontrol="calendar_toggle_calendarlist_command">
              <treenode-checkbox id="calendar-list-header"
                               checked="true"
                               class="treenode-checkbox"
                               ondrop="return document.getElementById('calendar-list-tree-widget').foreignDrop(event)"
                               ondragenter="return document.getElementById('calendar-list-tree-widget').foreignCanDrop(event)"
                               ondragover="return document.getElementById('calendar-list-tree-widget').foreignCanDrop(event)"
                               label="&calendar.list.header.label;"/>
              <modevbox id="calendar-listtree-pane" flex="1" mode="calendar,task" broadcaster="modeBroadcaster"
                        refcontrol="calendar-list-header">

                <calendar-list-tree id="calendar-list-tree-widget"
                                    class="task-tree-subpane"
                                    flex="1"/>
              </modevbox>
          </modevbox>
          </vbox>
        </vbox>

        <splitter id="calsidebar_splitter"
                  collapse="before"
                  persist="state"
                  class="calendar-sidebar-splitter"/>

        <deck id="calendarDisplayDeck" flex="1">
          <!-- vbox "calendar-view-box will be overlayed..." -->
          <vbox id="calendar-view-box"/>
        </deck>
      </hbox>
    </vbox>
  </tabpanels>

  <hbox id="tabmail-container">
    <splitter id="today-splitter"
              collapse="after"
              resizebefore="closest"
              state="collapsed"
              class="calendar-sidebar-splitter"
              oncommand="TodayPane.onCommandTodaySplitter();">
      <grippy/>
    </splitter>
    <modevbox id="today-pane-panel" />
  </hbox>

  <statusbar id="status-bar">
    <statusbarpanel id="calendar-show-todaypane-panel"
                    pack="center">
      <toolbarbutton id="calendar-status-todaypane-button"
                     todaypane="true"
                     type="checkbox"
                     label="&todaypane.statusButton.label;"
                     tooltiptext="&calendar.todaypane.button.tooltip;"
                     observes="calendar_toggle_todaypane_command"
                     command="calendar_toggle_todaypane_command"/>
    </statusbarpanel>
    <statusbarpanel id="calendar-invitations-panel"
                    insertbefore="unreadMessageCount,totalMessageCount"
                    oncommand="openInvitationsDialog()">
      <label id="calendar-invitations-label"
             class="text-link"
             onclick="openInvitationsDialog()"
             onkeypress="if (event.keyCode == event.VK_ENTER ||
                             event.keyCode == event.VK_RETURN) {
                             openInvitationsDialog(); }"/>
    </statusbarpanel>
  </statusbar>
</overlay>