<?xml version="1.0"?>

<!--
   The contents of this file are subject to the Mozilla Public
   License Version 1.1 (the "MPL"); you may not use this file
   except in compliance with the MPL. You may obtain a copy of
   the MPL at http://www.mozilla.org/MPL/

   Software distributed under the MPL is distributed on an "AS
   IS" basis, WITHOUT WARRANTY OF ANY KIND, either express or
   implied. See the MPL for the specific language governing
   rights and limitations under the MPL.

   The Original Code is Enigmail.

   The Initial Developer of the Original Code is Ramalingam Saravanan.
   Portions created by Ramalingam Saravanan <svn@xmlterm.org> are
   Copyright (C) 2001 Ramalingam Saravanan. All Rights Reserved.

   Contributor(s):
   Patrick Brunschwig <patrick.brunschwig@gmx.net>

   Alternatively, the contents of this file may be used under the
   terms of the GNU General Public License (the "GPL"), in which case
   the provisions of the GPL are applicable instead of
   those above. If you wish to allow use of your version of this
   file only under the terms of the GPL and not to allow
   others to use your version of this file under the MPL, indicate
   your decision by deleting the provisions above and replace them
   with the notice and other provisions required by the GPL.
   If you do not delete the provisions above, a recipient
   may use your version of this file under either the MPL or the
   GPL.
-->

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

<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://global/locale/brand.dtd" >
%brandDTD;
<!ENTITY % enigMailDTD SYSTEM "chrome://enigmail/locale/enigmail.dtd" >
%enigMailDTD;
]>
<dialog id="enigmailPrefsAdv"
        title="&enigmail.preferences.label;"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="prefOnLoad();"
        ondialogaccept="prefOnAccept();">

  <script type="application/x-javascript" src="chrome://enigmail/content/enigmailCommon.js"/>
  <script type="application/x-javascript" src="chrome://enigmail/content/pref-enigmail.js"/>
  <!-- script type="application/x-javascript" src="chrome://jslib/content/jslib.js"/ -->

  <tabbox flex="1" style="margin:5px">
    <tabs id="prefTabBox">
      <tab id="basicTab"    label="&enigmail.basic.label;"/>
      <tab id="sendTab"     label="&enigmail.sending.label;"/>
      <tab id="keySelTab"   label="&enigmail.keySel.label;"/>
      <tab id="pgpMimeTab"  label="&enigmail.pgpMime.label;"/>
      <tab id="advancedTab" label="&enigmail.advancedPrefsButton.label;"/>
      <tab id="debugTab"    label="&enigmail.debug.label;"/>
    </tabs>

    <tabpanels flex="1">
      <vbox id="basic" flex="1">
          <description class="enigmailPrefsTitle">&enigmail.basicPrefs.label;</description>
          <hbox align="center">
            <label control="enigmail_agentPath"
                  value="&enigmail.agentPath.label;" />
            <textbox id="enigmail_agentPath"/>
            <button id="browse" label="&enigmail.browse.label;"
                    oncommand="enigLocateGpg();"/>
          </hbox>

          <hbox>
            <groupbox orient="vertical" flex="1">
              <caption label="&enigmail.passwordSettings.label;"/>
                <hbox autostretch="never" align="center">
                  <label control="enigmail_maxIdleMinutes"
                        value="&enigmail.maxIdleMinutesHead.label;" />

                  <textbox id="enigmail_maxIdleMinutes"
                          size="4"
                          pref="true"
                          preftype="int"
                          prefstring="extensions.enigmail.maxIdleMinutes"/>

                  <description>&enigmail.maxIdleMinutesTail.label;</description>
                </hbox>

                <checkbox id="enigmail_noPassphrase"
                        label="&enigmail.userNoPassphrase.label;"
                        pref="true"
                        preftype="bool"
                        prefstring="extensions.enigmail.noPassphrase"
                        prefattribute="checked"/>

            </groupbox>
          </hbox>
          <vbox>
            <label control="enigmail_keyserver"
                  value="&enigmail.keyservers.label;:" />
            <textbox id="enigmail_keyserver"/>
            <label value="&enigmail.keyservers.sample;" style="font-style: italic;"/>
          </vbox>
          <separator/>
          <vbox autostretch="never" align="end">
            <hbox>
              <!--
              <button id="uninstall"
                      class="dialog"
                      label="&enigmail.uninstallButton.label;"
                      oncommand="EnigUninstall()"/> -->
              <button id="resetPrefs"
                      label="&enigmail.resetPrefsButton.label;"
                      oncommand="resetPrefs();"/>
            </hbox>
          </vbox>

      </vbox>

      <vbox id="sending" flex="1">
          <description class="enigmailPrefsTitle">&enigmail.whenSending.label;</description>

          <checkbox id="enigmail_encryptToSelf"
                    label="&enigmail.encryptToSelf.label;" />

          <checkbox id="enigmail_alwaysTrustSend"
                    label="&enigmail.alwaysTrustSend.label;" />

          <checkbox id="enigmail_confirmBeforeSend"
                    label="&enigmail.confirmBeforeSend.label;" />

          <checkbox id="enigmail_wrapHtmlBeforeSend"
                    label="&enigmail.wrapHtmlBeforeSend.label;" />

          <checkbox id="send_plaintext_flowed"
                    label="&enigmail.send_plaintext_flowed.label;" />
      </vbox>

      <vbox id="keySel" flex="1">
          <description class="enigmailPrefsTitle">&enigmail.recipientsSelectionOption.label;</description>
          <groupbox>
            <caption label="&enigmail.normalKeySelection.label;"/>
            <radiogroup id="enigmail_recipientsSelectionOption">
              <radio id="askRecipientsNever"
                    value="0"
                    label="&enigmail.askRecipientsNever.label;"/>
  
              <radio id="askRecipientsClever"
                    value="1"
                    label="&enigmail.askRecipientsClever.label;"/>
  
              <radio id="askRecipientsAlways"
                    value="2"
                    label="&enigmail.askRecipientsAlways.label;"/>
            </radiogroup>
          </groupbox>
          
          <separator/>
          
          <groupbox>
            <caption label="&enigmail.perRecipientRules.label;"/>
            <grid>
              <columns>
              <column flex="1"/>
              <column/>
            </columns>

            <rows autostretch="never">
              <row>
                <radiogroup id="enigmail_perRecipientRules">
                    <radio id="perRecipientRulesNo"
                        value="0"
                        label="&enigmail.disabled.label;"/>
      
                  <radio id="perRecipientRulesManual"
                        value="1"
                        label="&enigmail.perRecipientRulesManual.label;"/>
      
                  <radio id="perRecipientRulesAlways"
                        value="2"
                        label="&enigmail.perRecipientRulesAlways.label;"/>
                </radiogroup>
                <hbox autostretch="never" align="end">
                  <button label="&enigmail.defineRules.label;"
                          oncommand="EnigRulesEditor();"/>
                </hbox>                            
              </row>
            </rows>
          </grid>
          </groupbox>
      </vbox>

      <vbox id="pgpMime" flex="1">
          <description class="enigmailPrefsTitle">&enigmail.usePGPMimeOption.label;</description>
          <radiogroup id="enigmail_usePGPMimeOption">

            <radio id="usePGPMimeNever"
                  value="0"
                  label="&enigmail.usePGPMimeNever.label;" />

            <radio id="usePGPMimePossible"
                  value="1"
                  label="&enigmail.usePGPMimePossible.label;" />

            <radio id="usePGPMimeAlways"
                  value="2"
                  label="&enigmail.usePGPMimeAlways.label;" />

          </radiogroup>

          <hbox align="center">
            <label control="mimeHashList"
                value="&enigmail.mimeHashAlgorithm.label;:" />
            <menulist id="mimeHashList" label="SHA1" flex="1">

              <menupopup id="mimeHashPopup">
                <menuitem id="mimeHashMD5"       label="MD5"/>
                <menuitem id="mimeHashSHA1"      label="SHA1" selected="true"/>
                <menuitem id="mimeHashRIPEMD160" label="RIPEMD160"/>
              </menupopup>
            </menulist>
          </hbox>
      </vbox>

      <vbox id="advanced" flex="1">
          <description class="enigmailPrefsTitle">&enigmail.moreOptions.label;</description>
          <spacer flex="0"/>

          <checkbox id="enigmail_keepSettingsForReply"
                    label="&enigmail.keepSettingsForReply.label;" />

          <checkbox id="enigmail_useDefaultComment"
                    label="&enigmail.useDefaultComment.label;" />

          <checkbox id="enigmail_doubleDashSeparator"
                    label="&enigmail.doubleDashSeparator.label;" />

          <checkbox id="enigmail_useGpgAgent"
                    label="&enigmail.useGpgAgent.label;" />

          <checkbox id="enigmail_hushMailSupport"
                    label="&enigmail.hushMailSupport.label;" />

          <checkbox id="enigmail_disableSMIMEui"
                    label="&enigmail.disableSMIMEui.label;" />

          <checkbox id="mime_parts_on_demand"
                    label="&enigmail.mime_parts_on_demand.label;"
                    tooltiptext="&enigmail.mime_parts_on_demand.tooltip;" />
      </vbox>

      <vbox id="debug" flex="1">
        <description class="enigmailPrefsTitle">&enigmail.debugging.label;</description>
        <spacer flex="0"/>

        <grid>
          <columns>
            <column/>
            <column flex="1"/>
          </columns>

          <rows autostretch="never">
            <row>
              <hbox align="center">
                <label control="enigmail_logDirectory"
                    value="&enigmail.logdirectory.label;" />
              </hbox>
              <textbox id="enigmail_logDirectory" />
            </row>
            <row>
              <hbox align="center">
                <label control="enigmail_test_email"
                    value="&enigmail.testemail.label;" />
              </hbox>
              <hbox autostretch="never">
                <textbox id="enigmail_test_email"/>

                <button class="dialog"
                        id="enigmail_test"
                        label="&enigmail.test.label;"
                        oncommand="EnigTest();"/>
              </hbox>
            </row>
          </rows>
        </grid>
      </vbox>
    </tabpanels>
  </tabbox>


</dialog>
