<?xml version="1.0"?>

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

<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>

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

<window
     id="enigmailKeygen"
     title="&enigmail.keygenTitle.label;"
     windowtype="enigmail:keygen"
     width="600" height="480"
     orient="vertical"
     onload="enigmailKeygenLoad()"
     onclose="enigmailOnClose()"
     onunload="enigmailKeygenUnload()"
     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://global/content/dialogOverlay.js" />

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

<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="noPassphrase"
          label="&enigmail.keyNoPassphrase.label;"
          oncommand="enigmailKeygenUpdate(false, 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" />
        <label control="passphraseRepeat" value="&enigmail.keyPassphraseRepeat.label;" />
        <textbox id="passphraseRepeat" type="password" />
      </hbox>
    </row>

    <row>
      <hbox align="center">
        <label control="keyComment" value="&enigmail.keyComment.label;" />
      </hbox>
      <textbox id="keyComment" />
    </row>
  </rows>
</grid>
  
<tabbox flex="1">
  <tabs id="settingsTabBox">
    <tab id="basicTab"    label="&enigmail.keyGen.expiry.title;"/>
    <tab id="advancedTab" label="&enigmail.advancedPrefsButton.label;"/>
  </tabs>

  <tabpanels flex="1">

    <hbox> <!-- Basic Tab -->
      <hbox align="center">
        <label value="&enigmail.keyGen.expire.label;" control="expireInput"/>
      </hbox>
      <hbox align="center">
        <textbox id="expireInput" size="5" maxlength="5" value="5"/>
        <menulist id="timeScale" label="&enigmail.keyGen.years.label;" value="365">
          <menupopup id="timeScalePopup">
            <menuitem id="years" value="365" label="&enigmail.keyGen.years.label;" selected="true"/>
            <menuitem id="months" value="30" label="&enigmail.keyGen.months.label;"/>
            <menuitem id="days" value="1" label="&enigmail.keyGen.days.label;"/>
          </menupopup>
        </menulist>
        <checkbox label="&enigmail.keyGen.noExpiry.label;"
                  id="noExpiry" oncommand="onNoExpiry()"/>
      </hbox>
    </hbox>

    <vbox> <!-- Advanced Tab -->
      <grid>
        <columns>
          <column/>
          <column flex="1"/>
        </columns>

        <rows>
          <row>
            <hbox align="center">
              <label value="&enigmail.keyGen.keySize.label;" control="keySize"/>
            </hbox>
            <hbox flex="0">
              <menulist id="keySize" label="2048" value="2048" >
                <menupopup id="keySizePopup">
                  <menuitem id="keySize_1024" value="1024" label="1024"/>
                  <menuitem id="keySize_2048" value="2048" label="2048" selected="true"/>
                  <menuitem id="keySize_4096" value="4096" label="4096"/>
                </menupopup>
              </menulist>
            </hbox>
          </row>
          <row>
            <hbox align="center">
              <label value="&enigmail.keyGen.keyType.label;" control="keyType"/>
            </hbox>
            <hbox flex="0">
              <menulist id="keyType" label="&enigmail.keyGen.keyType.dsa;" value="1" >
                <menupopup id="keyTypePopup">
                  <menuitem id="keySize_rsa" value="2" label="&enigmail.keyGen.keyType.rsa;" selected="true"/>
                  <menuitem id="keyType_dsa" value="1" label="&enigmail.keyGen.keyType.dsa;"/>
                </menupopup>
              </menulist>
            </hbox>
          </row>
        </rows>
      </grid>
  </vbox>
  </tabpanels>
</tabbox>

<separator/>

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

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

<separator/>

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

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

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

  <groupbox>
    <progressmeter id="keygenProgress" mode="determined" value="0"/>
  </groupbox>

</groupbox>

</window>
