<?xml version="1.0" encoding="UTF-8"?>
<!-- This Source Code Form is subject to the terms of the Mozilla Public
   - License, v. 2.0. If a copy of the MPL was not distributed with this
   - file, You can obtain one at http://mozilla.org/MPL/2.0/. -->

<!DOCTYPE overlay [
    <!ENTITY % generalDTD SYSTEM "chrome://calendar/locale/preferences/general.dtd">
    <!ENTITY % globalDTD SYSTEM "chrome://calendar/locale/global.dtd">
    <!ENTITY % eventDTD SYSTEM "chrome://calendar/locale/calendar-event-dialog.dtd">
    %generalDTD;
    %globalDTD;
    %eventDTD;
]>

<overlay id="CalendarGeneralPaneOverlay"
         xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

    <vbox id="calPreferencesBoxGeneral">
        <script type="application/javascript"
                src="chrome://calendar/content/preferences/general.js"/>
        <script type="application/javascript"
                src="chrome://calendar/content/calendar-ui-utils.js"/>

        <!-- Get the localized text for use in the .js -->
        <script type="application/javascript">
            var labelLong  = "&pref.dateformat.long;";
            var labelShort = "&pref.dateformat.short;";
        </script>

        <preferences>
            <preference id="calendar.date.format"
                        name="calendar.date.format"
                        type="int"/>
            <preference id="calendar.event.defaultlength"
                        name="calendar.event.defaultlength"
                        type="int"/>
            <preference id="calendar.task.defaultstart"
                        name="calendar.task.defaultstart"
                        type="string"/>
            <preference id="calendar.task.defaultstartoffset"
                        name="calendar.task.defaultstartoffset"
                        type="int"/>
            <preference id="calendar.task.defaultstartoffsetunits"
                        name="calendar.task.defaultstartoffsetunits"
                        type="string"/>
            <preference id="calendar.task.defaultdue"
                        name="calendar.task.defaultdue"
                        type="string"/>
            <preference id="calendar.task.defaultdueoffset"
                        name="calendar.task.defaultdueoffset"
                        type="int"/>
            <preference id="calendar.task.defaultdueoffsetunits"
                        name="calendar.task.defaultdueoffsetunits"
                        type="string"/>
            <preference id="calendar.view.useSystemColors"
                        name="calendar.view.useSystemColors"
                        type="bool"/>
        </preferences>

        <groupbox>
            <caption label="&pref.mainbox.label;"/>
            <hbox align="center">
                <label value="&pref.dateformat.label;"
                       accesskey="&pref.dateformat.accesskey;"
                       control="dateformat"/>
                <menulist id="dateformat" crop="none"
                          preference="calendar.date.format">
                    <menupopup id="dateformatpopup">
                        <menuitem id="dateformat-long-menuitem"
                                  label="&pref.dateformat.long;"
                                  value="0"/>
                        <menuitem id="dateformat-short-menuitem"
                                  label="&pref.dateformat.short;"
                                  value="1"/>
                    </menupopup>
                </menulist>
            </hbox>
        </groupbox>


        <groupbox id="defaults-itemtype-groupbox">
            <caption id="defaults-itemtype-caption" label="&pref.defaults.label;"/>
            <menulist id="defaults-itemtype-menulist" oncommand="gCalendarGeneralPane.updateItemtypeDeck()">
                <menupopup id="defaults-itemtype-menupopup">
                    <menuitem id="defaults-itemtype-event"
                              label="&pref.events.label;"
                              value="defaults-event-grid"/>
                    <menuitem id="defaults-itemtype-task"
                              label="&pref.tasks.label;"
                              value="defaults-task-grid"/>
                </menupopup>
            </menulist>
            <deck id="defaults-itemtype-deck">
                <grid id="defaults-event-grid">
                    <columns id="defaults-event-grid-columns">
                        <column id="defaults-event-grid-label-column" flex="1"/>
                        <column id="defaults-event-grid-value-column"/>
                    </columns>
                    <rows id="defaults-event-grid-rows">
                        <row align="center">
                            <label value="&pref.default_event_length.label;"
                                   accesskey="&pref.default_event_length.accesskey;"
                                   control="defaultlength"/>
                            <textbox id="defaultlength"
                                     preference="calendar.event.defaultlength"
                                     type="number"
                                     min="0"
                                     maxlength="3"
                                     size="3"
                                     onselect="updateUnitLabelPlural('defaultlength','defaultlengthunit','minutes')"
                                     oninput="updateUnitLabelPlural('defaultlength','defaultlengthunit','minutes')"/>
                            <label id="defaultlengthunit"/>
                        </row>
                    </rows>
                </grid>
                <grid id="defaults-task-grid">
                    <columns id="defaults-task-grid-columns">
                        <column id="defaults-task-grid-label-column" flex="1"/>
                        <column id="defaults-task-grid-value-column"/>
                        <column id="defaults-task-grid-offset-column"/>
                    </columns>
                    <rows id="defaults-task-grid-rows">
                        <row align="center">
                            <label value="&read.only.task.start.label;"
                                   control="default_task_start"/>
                            <menulist id="default_task_start"
                                        crop="none"
                                        oncommand="gCalendarGeneralPane.updateDefaultTodoDates()"
                                        preference="calendar.task.defaultstart">
                                <menupopup id="default_task_start_popup">
                                    <menuitem id="default_task_start_none"
                                                label="&pref.default_task_none.label;"
                                                value="none"
                                                selected="true"/>
                                    <menuitem id="default_task_start_start_of_day"
                                                label="&pref.default_task_start_of_day.label;"
                                                value="startofday"/>
                                    <menuitem id="default_task_start_tomorrow"
                                                label="&pref.default_task_tomorrow.label;"
                                                value="tomorrow"/>
                                    <menuitem id="default_task_start_next_week"
                                                label="&pref.default_task_next_week.label;"
                                                value="nextweek"/>
                                    <menuitem id="default_task_start_offset_current"
                                                label="&pref.default_task_offset_current.label;"
                                                value="offsetcurrent"/>
                                    <menuitem id="default_task_start_offset_next_hour"
                                                label="&pref.default_task_offset_next_hour.label;"
                                                value="offsetnexthour"/>
                                </menupopup>
                            </menulist>
                            <hbox align="center" id="default_task_start_offset">
                                <textbox id="default_task_start_offset_text"
                                         preference="calendar.task.defaultstartoffset"
                                         type="number"
                                         min="0"
                                         maxlength="3"
                                         size="3"
                                         onselect="updateMenuLabelsPlural('default_task_start_offset_text', 'default_task_start_offset_units')"
                                         oninput="updateMenuLabelsPlural('default_task_start_offset_text', 'default_task_start_offset_units')"/>
                                <menulist id="default_task_start_offset_units"
                                          crop="none"
                                          preference="calendar.task.defaultstartoffsetunits">
                                    <menupopup id="default_task_start_offset_units_popup">
                                        <menuitem id="default_task_start_offset_units_minutes"
                                                  value="minutes"
                                                  selected="true"/>
                                        <menuitem id="default_task_start_offset_units_hours"
                                                  value="hours"/>
                                        <menuitem id="default_task_start_offset_units_days"
                                                  value="days"/>
                                    </menupopup>
                                </menulist>
                            </hbox>
                        </row>
                        <row align="center">
                            <label value="&read.only.task.due.label;"
                                   control="default_task_due"/>
                            <menulist id="default_task_due"
                                      crop="none"
                                      oncommand="gCalendarGeneralPane.updateDefaultTodoDates()"
                                      preference="calendar.task.defaultdue">
                                <menupopup id="default_task_due_popup">
                                    <menuitem id="default_task_due_none"
                                              label="&pref.default_task_none.label;"
                                              value="none"
                                              selected="true"/>
                                    <menuitem id="default_task_due_end_of_day"
                                              label="&pref.default_task_end_of_day.label;"
                                              value="endofday"/>
                                    <menuitem id="default_task_due_tomorrow"
                                              label="&pref.default_task_tomorrow.label;"
                                              value="tomorrow"/>
                                    <menuitem id="default_task_due_next_week"
                                              label="&pref.default_task_next_week.label;"
                                              value="nextweek"/>
                                    <menuitem id="default_task_due_offset_current"
                                              label="&pref.default_task_offset_start.label;"
                                              value="offsetcurrent"/>
                                    <menuitem id="default_task_due_offset_next_hour"
                                              label="&pref.default_task_offset_next_hour.label;"
                                              value="offsetnexthour"/>
                                </menupopup>
                            </menulist>
                            <hbox align="center" id="default_task_due_offset">
                                <textbox id="default_task_due_offset_text"
                                         preference="calendar.task.defaultdueoffset"
                                         type="number"
                                         min="0"
                                         maxlength="3"
                                         size="3"
                                         onselect="updateMenuLabelsPlural('default_task_due_offset_text', 'default_task_due_offset_units')"
                                         oninput="updateMenuLabelsPlural('default_task_due_offset_text', 'default_task_due_offset_units')"/>
                                <menulist id="default_task_due_offset_units"
                                          crop="none"
                                          preference="calendar.task.defaultdueoffsetunits">
                                    <menupopup id="default_task_due_offset_units_popup">
                                        <menuitem id="default_task_due_offset_units_minutes"
                                                  value="minutes"
                                                  selected="true"/>
                                        <menuitem id="default_task_due_offset_units_hours"
                                                  value="hours"/>
                                        <menuitem id="default_task_due_offset_units_days"
                                                  value="days"/>
                                    </menupopup>
                                </menulist>
                            </hbox>
                        </row>
                    </rows>
                </grid>
            </deck>
        </groupbox>
    </vbox>
</overlay>
