<?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://messenger/skin/" type="text/css"?>
<!-- ?xml-stylesheet href="chrome://enigmail/skin/enigmail.css" type="text/css"? -->

<!DOCTYPE window [
<!ENTITY % brandDTD SYSTEM "chrome://branding/locale/brand.dtd" >
%brandDTD;
<!ENTITY % enigMailDTD SYSTEM "chrome://enigmail/locale/enigmail.dtd" >
%enigMailDTD;
]>

<window id="enigmailGenCardKeyDlg"
        title="&enigmail.genCardKey.title;"
        windowtype="enigmail:genCardKey"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        onload="onLoad()"
        buttons="accept,cancel"
        minwidth="450px"
        width="600px">

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

  <broadcasterset>
    <broadcaster id="bcBackupKey"/>
    <broadcaster id="bcNoExpiry"/>
  </broadcasterset>

  <popupset id="aTooltipSet"/>

  <groupbox id="userIdBox" orient="vertical">

    <hbox orient="horizontal" align="center">
      <label value="&enigmail.keyUserId.label;" control="userIdentity"/>
      <menulist id="userIdentity" label="..." flex="1">
        <menupopup id="userIdentityPopup"/>
      </menulist>
    </hbox>

    <checkbox id="useForSigning"
              label="&enigmail.useForSigning.label;"
              checked="true" />

  </groupbox>

  <checkbox id="createBackup"
            label="&enigmail.genCardKey.backupKey.label;"
            checked="true"
            oncommand="enableDisable('createBackup','bcBackupKey', false)"/>
  <grid>
    <columns>
      <column />
      <column flex="1"/>
    </columns>

    <rows>
      <row>
        <hbox id="passphraseBox" align="center">
          <label control="passphrase" value="&enigmail.keyPassphrase.label;" />
        </hbox>
        <hbox align="center">
          <textbox id="passphrase" type="password" observes="bcBackupKey"/>
          <label control="passphraseRepeat" value="&enigmail.keyPassphraseRepeat.label;" />
          <textbox id="passphraseRepeat" type="password" observes="bcBackupKey"/>
        </hbox>
      </row>

      <row>
        <hbox align="center">
          <label value="&enigmail.keyGen.expire.label;" control="expireInput"/>
        </hbox>
        <hbox align="center">
          <textbox id="expireInput" size="5" maxlength="5" value="5" observes="bcNoExpiry"/>
          <menulist id="timeScale" label="&enigmail.keyGen.years.label;" value="365"  observes="bcNoExpiry">
            <menupopup id="timeScalePopup" value="5">
              <menuitem id="years" value="y" label="&enigmail.keyGen.years.label;" selected="true"/>
              <menuitem id="months" value="m" label="&enigmail.keyGen.months.label;"/>
              <menuitem id="days" value="d" label="&enigmail.keyGen.days.label;"/>
            </menupopup>
          </menulist>
          <checkbox label="&enigmail.keyGen.noExpiry.label;"
                    id="noExpiry"
                    oncommand="enableDisable('noExpiry','bcNoExpiry', true)"/>
        </hbox>
      </row>

    </rows>
  </grid>

  <separator/>

<hbox autostretch="never">
  <button label="&enigmail.generateKey.label;"
          class="dialog"
          tooltip="aTooltip"
          tooltiptext="&enigmail.generateKey.tooltip;"
          oncommand="startKeyGen();" />

  <button label="&enigmail.cancelKey.label;"
          class="dialog"
          tooltip="aTooltip"
          tooltiptext="&enigmail.cancelKey.tooltip;"
          oncommand="onClose();" />
</hbox>

<groupbox id="keygenConsoleBox" orient="vertical">

  <caption label="&enigmail.keyGen.console.label;"/>

  <description>&enigmail.genCardKey.desc;</description>

  <iframe id="keygenConsole" type="content" name="keygenConsole"
          src="chrome://enigmail/content/enigmailKeygenConsole.htm"
          height="200" flex="1"/>

</groupbox>

</window>
