<?xml version="1.0"?>
<!--
 * 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 https://mozilla.org/MPL/2.0/.
-->

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

<!DOCTYPE window SYSTEM "chrome://enigmail/locale/enigmail.dtd" >

<overlay id="enigmail_IdentityEditOvl"
    xmlns:html="http://www.w3.org/1999/xhtml"
    xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul">

  <script type="application/x-javascript" src="chrome://enigmail/content/enigmailEditIdentity.js"/>

  <vbox id="enigmail_IdentityEdit">
    <checkbox id="enigmail_enablePgp"
              prefstring="mail.identity.%identitykey%.enablePgp"
              preftype="bool" prefattribute="value"
              label="&enigmail.amPrefEnablePgp.label;"
              oncommand="Enigmail.edit.toggleEnable();"/>
    <vbox>
      <groupbox id="enigmail_encryption.titleBox">
        <radiogroup id="enigmail_pgpKeyMode" aria-labelledby="enablePgp">
          <radio id="enigmail_keymode_useFromAddress"
                 label="&enigmail.amPrefUseFromAddr.label;"
                 value="0"
                 observes="enigmail_bcEnablePgp"
                 oncommand="Enigmail.edit.enableKeySel(false);"/>
          <vbox>
            <radio id="enigmail_keymode_usePgpkeyId"
                   label="&enigmail.amPrefUseKeyId.label;"
                   observes="enigmail_bcEnablePgp"
                   value="1"
                   oncommand="Enigmail.edit.enableKeySel(true);"/>
            <hbox>
              <textbox id="enigmail_identity.pgpkeyId" aria-labelledby="keymode_usePgpkeyId"
                       prefstring="mail.identity.%identitykey%.pgpkeyId"
                       observes="enigmail_bcUseKeyId"
                       readonly="true"
                       preftype="wstring" prefattribute="value"/>
              <button id="enigmail_selectPgpKey" label="&enigmail.amPrefSelectKey.label;"
                      observes="enigmail_bcUseKeyId"
                      oncommand="Enigmail.edit.selectKeyId()"/>
            </hbox>
          </vbox>
        </radiogroup>

        <tabbox flex="1" id="enigmail_tabs">
          <tabs id="enigmail_tabBox">
            <tab id="enigmail_msgCompTab"   label="&enigmail.amPrefMsgComp.label;"/>
            <tab id="enigmail_autocryptTab" label="&enigmail.autocrypt.label;"/>
          </tabs>

          <tabpanels flex="1" id="enigmail_tabPanels">
            <!-- Message Composition -->
            <vbox flex="1">
              <caption label="&enigmail.amPrefDefaultEncrypt.label;"/>

              <checkbox id="enigmail_encrypt_ifPossible"
                        checked="false"
                        observes="enigmail_bcEnablePgp"
                        label="&enigmail.defaultEncryption.label;"/>
              <checkbox id="enigmail_sign_ifPossible"
                        checked="false"
                        observes="enigmail_bcEnablePgp"
                        label="&enigmail.defaultSigning.label;"/>
              <checkbox id="enigmail_pgpMimeMode"
                        checked="false"
                        observes="enigmail_bcEnablePgp"
                        label="&enigmail.usePGPMimeAlways.label;"/>

              <separator/>

              <label value="&enigmail.afterDefaultsAndRules.label;"/>
              <hbox flex="1">
                <checkbox id="enigmail_sign_notEncrypted"
                          checked="false"
                          observes="enigmail_bcEnablePgp"
                          label="&enigmail.finallySignNotEncrypted.label;"/>
                <checkbox id="enigmail_sign_encrypted"
                          checked="false"
                          observes="enigmail_bcEnablePgp"
                          label="&enigmail.finallySignEncrypted.label;"/>
              </hbox>

              <separator/>

              <checkbox id="enigmail_autoEncryptDrafts" checked="false"
                        label="&enigmail.autoEncryptDrafts.label;"/>

              <separator/>

              <label id="mimePreferOpenPGP" value="&enigmail.amPrefMimePreferProto.label;"/>
              <radiogroup id="enigmail_mimePreferOpenPGP" aria-labelledby="mimePreferOpenPGP">
                <hbox flex="1">
                  <radio id="enigmail_mime_preferSMime"
                         label="&enigmail.amPrefMimePreferSMime.label;"
                         value="0"
                         observes="enigmail_bcEnablePgp"/>
                  <radio id="enigmail_mime_preferEnigmail"
                         label="&enigmail.amPrefMimePreferEnigmail.label;"
                         value="1"
                         observes="enigmail_bcEnablePgp"/>
                </hbox>
              </radiogroup>
            </vbox>

            <!-- Autocrypt tab -->
            <vbox flex="1" align="start">
              <description onclick="Enigmail.edit.handleClick(event)">
                &enigmail.amPrefAutocrypt.description;
              </description>

              <checkbox id="enigmail_enableAutocrypt"
                  prefstring="mail.server.%serverkey%.enableAutocrypt"
                  preftype="bool" prefattribute="value"
                  observes="enigmail_bcEnablePgp"
                  oncommand="Enigmail.edit.enableAcSettings()"
                  label="&enigmail.enableAutocrypt.label;"/>

              <checkbox id="enigmail_acPreferEncrypt"
                  prefstring="mail.server.%serverkey%.acPreferEncrypt"
                  preftype="bool" prefattribute="value"
                  label="&enigmail.acPreferEncrypt.label;"/>
            </vbox>
          </tabpanels>
        </tabbox>

        <hbox autostretch="never" id="enigmail_PrefsBox">
          <spacer flex="1"/>
          <button class="dialog"
                  id="enigmail_advancedAccountPrefsButton"
                  observes="enigmail_bcEnablePgp"
                  advanced="true"
                  label="&enigmail.advancedPrefsButton.label;"
                  oncommand="Enigmail.edit.advancedIdentitySettings()"/>
          <button class="dialog"
                  id="enigmail_openpgpPrefsButton"
                  observes="enigmail_bcEnablePgp"
                  label="&enigmail.openpgpPrefsButton.label;"
                  oncommand="EnigmailWindows.openPrefWindow(window, true, 'sendingTab');"/>
        </hbox>
      </groupbox>
    </vbox>
  </vbox>
</overlay>
