<?xml version="1.0"?>

# -*- Mode: Java; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*-
# 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 % brandDTD SYSTEM "chrome://branding/locale/brand.dtd">
%brandDTD;
<!ENTITY % advancedDTD SYSTEM "chrome://instantbird/locale/preferences/advanced.dtd">
%advancedDTD;
<!ENTITY % privacyDTD SYSTEM "chrome://instantbird/locale/preferences/privacy.dtd">
%privacyDTD;
]>

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

  <prefpane id="paneAdvanced" onpaneload="gAdvancedPane.init();">

    <preferences id="advancedPreferences">
      <preference id="browser.preferences.advanced.selectedTabIndex"
                  name="browser.preferences.advanced.selectedTabIndex"
                  type="int"/>

      <!--XXX button prefs -->

      <!-- General tab -->
      <preference id="accessibility.browsewithcaret"   name="accessibility.browsewithcaret"   type="bool"/>
      <preference id="accessibility.typeaheadfind"     name="accessibility.typeaheadfind"     type="bool"/>
      <preference id="accessibility.blockautorefresh"  name="accessibility.blockautorefresh"  type="bool"/>

      <preference id="general.autoScroll"              name="general.autoScroll"              type="bool"/>
      <preference id="general.smoothScroll"            name="general.smoothScroll"            type="bool"/>
      <preference id="layers.acceleration.disabled"    name="layers.acceleration.disabled"    type="bool"   inverted="true"
                  onchange="gAdvancedPane.updateHardwareAcceleration()"/>
#ifdef XP_WIN
      <preference id="gfx.direct2d.disabled"           name="gfx.direct2d.disabled"           type="bool"   inverted="true"/>
#endif
      <preference id="layout.spellcheckDefault"        name="layout.spellcheckDefault"        type="int"/>

      <!-- Network tab -->
      <preference id="browser.cache.disk.capacity"     name="browser.cache.disk.capacity"     type="int"/>
      <preference id="browser.offline-apps.notify"     name="browser.offline-apps.notify"     type="bool"/>

      <preference id="browser.cache.disk.smart_size.enabled"
                  name="browser.cache.disk.smart_size.enabled"
                  inverted="true"
                  type="bool"/>

     <!-- Update tab -->
#ifdef MOZ_UPDATER
      <preference id="app.update.enabled"              name="app.update.enabled"              type="bool"/>
      <preference id="app.update.auto"                 name="app.update.auto"                 type="bool"/>
      <preference id="app.update.mode"                 name="app.update.mode"                 type="int"/>

      <preference id="app.update.disable_button.showUpdateHistory"
                  name="app.update.disable_button.showUpdateHistory"
                  type="bool"/>

#ifdef MOZ_MAINTENANCE_SERVICE
      <preference id="app.update.service.enabled"
                  name="app.update.service.enabled"
                  type="bool"/>
#endif
#endif

      <preference id="browser.search.update"           name="browser.search.update"           type="bool"/>

      <!-- Certificates tab -->
      <preference id="security.default_personal_cert"  name="security.default_personal_cert"  type="string"/>

      <preference id="security.disable_button.openCertManager"
                  name="security.disable_button.openCertManager"
                  type="bool"/>
      <preference id="security.disable_button.openDeviceManager"
                  name="security.disable_button.openDeviceManager"
                  type="bool"/>
      <preference id="security.OCSP.enabled"
                  name="security.OCSP.enabled"
                  type="int"/>
    </preferences>

#ifdef HAVE_SHELL_SERVICE
    <stringbundle id="bundleShell" src="chrome://browser/locale/shellservice.properties"/>
    <stringbundle id="bundleBrand" src="chrome://branding/locale/brand.properties"/>
#endif
    <stringbundle id="bundlePreferences" src="chrome://instantbird/locale/preferences/preferences.properties"/>

    <script type="application/javascript" src="chrome://instantbird/content/preferences/advanced.js"/>

    <tabbox id="advancedPrefs" flex="1"
            onselect="gAdvancedPane.tabSelectionChanged();">

      <tabs id="tabsElement">
        <tab id="generalTab" label="&generalTab.label;"/>
        <tab id="networkTab" label="&networkTab.label;"/>
        <tab id="updateTab" label="&updateTab.label;"/>
        <tab id="encryptionTab" label="&certificateTab.label;"/>
      </tabs>

      <tabpanels flex="1">

        <!-- General -->
        <tabpanel id="generalPanel" orient="vertical">

          <!-- Accessibility -->
          <groupbox id="accessibilityGroup" align="start">
            <caption label="&accessibility.label;"/>

            <checkbox id="useCursorNavigation"
                      label="&useCursorNavigation.label;"
                      accesskey="&useCursorNavigation.accesskey;"
                      preference="accessibility.browsewithcaret"/>
            <checkbox id="searchStartTyping"
                      label="&searchStartTyping.label;"
                      accesskey="&searchStartTyping.accesskey;"
                      preference="accessibility.typeaheadfind"/>
          </groupbox>

          <!-- Conversations -->
          <groupbox id="conversationsGroup" align="start">
            <caption label="&conversations.label;"/>

            <checkbox id="useAutoScroll"
                      label="&useAutoScroll.label;"
                      accesskey="&useAutoScroll.accesskey;"
                      preference="general.autoScroll"/>
            <checkbox id="useSmoothScrolling"
                      label="&useSmoothScrolling.label;"
                      accesskey="&useSmoothScrolling.accesskey;"
                      preference="general.smoothScroll"/>
            <checkbox id="allowHWAccel"
                      label="&allowHWAccel.label;"
                      accesskey="&allowHWAccel.accesskey;"
                      preference="layers.acceleration.disabled"/>
            <checkbox id="checkSpelling"
                      label="&checkSpelling.label;"
                      accesskey="&checkSpelling.accesskey;"
                      onsyncfrompreference="return gAdvancedPane.readCheckSpelling();"
                      onsynctopreference="return gAdvancedPane.writeCheckSpelling();"
                      preference="layout.spellcheckDefault"/>
          </groupbox>

          <!-- Search engines -->
          <groupbox id="searchEnginesGroup" orient="horizontal" align="center">
            <caption label="&searchEnginesGroup.label;"/>

            <description control="manageSearchEnginesButton"
                         flex="1">&searchEnginesDesc.label;</description>
            <button id="manageSearchEnginesButton" label="&searchEngines.label;"
                    accesskey="&searchEngines.accesskey;"
                    oncommand="gAdvancedPane.showSearchEngineManager();"/>
          </groupbox>

          <!-- Advanced Configuration -->
          <groupbox>
            <caption label="&configEditDesc.label;"/>
            <hbox pack="end">
              <button id="configEditor" label="&configEdit.label;"
                      accesskey="&configEdit.accesskey;"
                      oncommand="gAdvancedPane.showConfigEdit();"/>
            </hbox>
          </groupbox>
        </tabpanel>

        <!-- Network -->
        <tabpanel id="networkPanel" orient="vertical">

           <!-- Connection -->
           <groupbox id="connectionGroup">
             <caption label="&connection.label;"/>

             <hbox id="connectionGroupHeader" align="center">
               <image style="padding-right: 1em;" src="chrome://global/skin/icons/information-32.png"/>
               <vbox>
                 <description flex="1">&connectionInfoDesc.label;</description>
                 <description flex="1">&connectionDesc.label;</description>
               </vbox>
             </hbox>

             <separator id="connectionGroupSeparator" class="thin"/>

             <hbox align="center" id="purpleConnectionBox">
               <description flex="1" control="connectionSettingsPurple">&connectionLibpurpleDesc.label;</description>
               <button id="connectionSettingsPurple" icon="network" label="&connectionSettings.label;"
                       accesskey="&connectionSettings.accesskey;"
                       oncommand="gAdvancedPane.showProxies();"/>
             </hbox>

             <hbox align="center" id="mozillaConnectionBox">
               <description id="mozConnLabelWithoutLibpurple" flex="1" control="connectionSettings">&connectionDesc.label;</description>
               <description id="mozConnLabelWithLibpurple" flex="1" control="connectionSettings">&connectionOtherDesc.label;</description>
               <button id="connectionSettings" icon="network" label="&connectionSettings.label;"
                       accesskey="&connectionSettings2.accesskey;"
                       oncommand="gAdvancedPane.showConnections();"/>
             </hbox>
           </groupbox>

           <!-- Porting Note:
              - The Cache and Offline apps section (+ related strings and
              - JavaScript methods) have been removed. -->
        </tabpanel>

        <!-- Update -->
        <tabpanel id="updatePanel" orient="vertical">
#ifdef MOZ_UPDATER
          <groupbox id="updateApp">
            <caption label="&updateApp.label;"/>
            <radiogroup id="updateRadioGroup"
                        oncommand="gAdvancedPane.updateWritePrefs();">
              <radio id="autoDesktop"
                     value="auto"
                     label="&updateAuto1.label;"
                     accesskey="&updateAuto1.accesskey;"/>
              <hbox class="indent">
                <checkbox id="warnIncompatible"
                          label="&updateAutoAddonWarn.label;"
                          accesskey="&updateAutoAddonWarn.accesskey;"
                          preference="app.update.mode"
                          onsyncfrompreference="return gAdvancedPane.readAddonWarn();"
                          onsynctopreference="return gAdvancedPane.writeAddonWarn();"/>
              </hbox>
              <radio value="checkOnly"
                     label="&updateCheck.label;"
                     accesskey="&updateCheck.accesskey;"/>
              <radio value="manual"
                     label="&updateManual.label;"
                     accesskey="&updateManual.accesskey;"/>
            </radiogroup>

            <hbox>
              <button id="showUpdateHistory"
                      label="&updateHistory.label;"
                      accesskey="&updateHistory.accesskey;"
                      preference="app.update.disable_button.showUpdateHistory"
                      oncommand="gAdvancedPane.showUpdates();"/>
            </hbox>

#ifdef MOZ_MAINTENANCE_SERVICE
            <checkbox id="useService"
                      label="&useService.label;"
                      accesskey="&useService.accesskey;"
                      preference="app.update.service.enabled"/>
#endif
          </groupbox>
#endif
          <groupbox id="updateOthers">
            <caption label="&updateOthers.label;"/>
            <checkbox id="enableSearchUpdate"
                      label="&enableSearchUpdate.label;"
                      accesskey="&enableSearchUpdate.accesskey;"
                      preference="browser.search.update"/>
          </groupbox>
        </tabpanel>

        <!-- Certificates -->
        <tabpanel id="encryptionPanel" orient="vertical">

            <description id="CertSelectionDesc" control="certSelection">&certSelection.description;</description>

            <!--
              The values on these radio buttons may look like l12y issues, but
              they're not - this preference uses *those strings* as its values.
              I KID YOU NOT.
            -->
            <radiogroup id="certSelection" orient="horizontal" preftype="string"
                        preference="security.default_personal_cert"
                        aria-labelledby="CertSelectionDesc">
              <radio label="&certs.auto;" accesskey="&certs.auto.accesskey;"
                     value="Select Automatically"/>
              <radio label="&certs.ask;" accesskey="&certs.ask.accesskey;"
                     value="Ask Every Time"/>
            </radiogroup>

            <separator/>

            <checkbox id="enableOCSP"
                      label="&enableOCSP.label;"
                      accesskey="&enableOCSP.accesskey;"
                      onsyncfrompreference="return gAdvancedPane.readEnableOCSP();"
                      onsynctopreference="return gAdvancedPane.writeEnableOCSP();"
                      preference="security.OCSP.enabled"/>

            <separator/>

            <hbox>
              <button id="viewCertificatesButton"
                      label="&viewCerts.label;" accesskey="&viewCerts.accesskey;"
                      oncommand="gAdvancedPane.showCertificates();"
                      preference="security.disable_button.openCertManager"/>
              <button id="viewSecurityDevicesButton"
                      label="&viewSecurityDevices.label;" accesskey="&viewSecurityDevices.accesskey;"
                      oncommand="gAdvancedPane.showSecurityDevices();"
                      preference="security.disable_button.openDeviceManager"/>
            </hbox>
        </tabpanel>

      </tabpanels>
    </tabbox>
  </prefpane>

</overlay>
