<?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="enigmailCardDetailsDlg"
        title="&enigmail.cardDetails.title;"
        xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
        buttons="accept"
        windowtype="enigmail:cardDetails"
        onload="onLoad();">


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

  <broadcasterset>
    <broadcaster id="bcEditMode" readonly="true"/>
    <broadcaster id="bcEnableMode" disabled="true"/>
  </broadcasterset>

  <menubar id="mainmenu" grippyhidden="true">
    <menu label="&enigmail.keyMan.fileMenu.label;"
          accesskey="&enigmail.keyMan.fileMenu.accesskey;">
      <menupopup>
        <menuitem label="&enigmail.keyMan.close.label;"
                  accesskey="&enigmail.keyMan.close.accesskey;"
                  key="key_closeWin"
                  oncommand="window.close()"/>
      </menupopup>
    </menu>

    <menu id="cardMenu"
          label="&enigmail.cardDetails.cardMenu.label;"
          accesskey="&enigmail.cardDetails.cardMenu.accesskey;">
      <menupopup>
       <menuitem id="editData"
              label="&enigmail.cardDetails.editData.label;"
              accesskey="&enigmail.cardDetails.editData.accesskey;"
              oncommand="doEditData()"/>
        <menuitem label="&enigmail.cardDetails.genCardKey.label;"
                  id="genCardKey"
                  accesskey="&enigmail.cardDetails.genCardKey.accesskey;"
                  oncommand="engmailGenerateCardKey()"/>
        <menuitem label="&enigmail.cardDetails.adminPin.label;"
                  id="adminPin"
                  accesskey="&enigmail.cardDetails.adminPin.accesskey;"
                  oncommand="enigmailAdminPin()"/>
      </menupopup>
    </menu>
  </menubar>

  <vbox orient="vertical">
    <grid>
      <columns>
        <column/>
        <column flex="1"/>
      </columns>
      <rows>
        <row align="center">
          <label value="&enigmail.cardDetails.vendor.label;" control="card_vendor"/>
          <textbox readonly="true" id="card_vendor" value=""/>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.serial.label;" control="card_serial"/>
          <textbox readonly="true" id="card_serial" value=""/>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.name.label;" id="card_namelabel"/>
          <hbox>
            <textbox observes="bcEditMode" id="card_firstname" value="" aria-labelledby="card_namelabel"/>
            <textbox observes="bcEditMode" id="card_name" value="" aria-labelledby="card_namelabel"/>
          </hbox>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.lang.label;" control="card_lang"/>
          <textbox observes="bcEditMode" id="card_lang" value=""/>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.sex.label;" control="card_sex"/>
          <radiogroup id="card_sex">
            <hbox>
              <radio id="card_sex_m"
                    value="m"
                    observes="bcEnableMode"
                    label="&enigmail.cardDetails.male.label;"/>
              <radio id="card_sex_f"
                    value="f"
                    observes="bcEnableMode"
                    label="&enigmail.cardDetails.female.label;"/>
            </hbox>
          </radiogroup>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.url.label;" control="card_url"/>
          <textbox observes="bcEditMode" id="card_url" value=""/>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.login.label;" control="card_login"/>
          <textbox observes="bcEditMode" id="card_login" value=""/>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.forcepin.label;" control="card_forcepin"/>
          <radiogroup id="card_forcepin">
            <hbox>
              <radio id="card_forcepin_0"
                    value="0"
                    observes="bcEnableMode"
                    label="&enigmail.cardDetails.no.label;"/>
              <radio id="card_forcepin_1"
                    value="1"
                    observes="bcEnableMode"
                    label="&enigmail.cardDetails.yes.label;"/>
            </hbox>
          </radiogroup>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.maxpinlen.label;" control="card_maxpinlen"/>
          <textbox readonly="true" id="card_maxpinlen" value=""/>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.pinretry.label;" control="card_pinretry"/>
          <textbox readonly="true" id="card_pinretry" value=""/>
        </row>
        <row align="center">
          <label value="&enigmail.cardDetails.sigcount.label;" control="card_sigcount"/>
          <textbox readonly="true" id="card_sigcount" value=""/>
        </row>
        <row>
          <label value="&enigmail.cardDetails.sigKey.label;" control="card_key_fpr_1"/>
          <vbox>
            <textbox readonly="true" size="55" id="card_key_fpr_1" value=""/>
            <hbox align="center">
              <label value="&enigmail.cardDetails.keyCreated.label;" control="card_key_created_1"/>
              <textbox readonly="true" id="card_key_created_1" value=""/>
            </hbox>
          </vbox>
        </row>
        <row>
          <label value="&enigmail.cardDetails.encKey.label;" control="card_key_fpr_2"/>
          <vbox>
            <textbox readonly="true" id="card_key_fpr_2" value=""/>
            <hbox align="center">
              <label value="&enigmail.cardDetails.keyCreated.label;" control="card_key_created_2"/>
              <textbox readonly="true" id="card_key_created_2" value=""/>
            </hbox>
          </vbox>
        </row>
        <row>
          <label value="&enigmail.cardDetails.authKey.label;" control="card_key_fpr_3"/>
          <vbox>
            <textbox readonly="true" id="card_key_fpr_3" value=""/>
            <hbox align="center">
              <label value="&enigmail.cardDetails.keyCreated.label;" control="card_key_created_3"/>
              <textbox readonly="true" id="card_key_created_3" value=""/>
            </hbox>
          </vbox>
        </row>
      </rows>
    </grid>

  </vbox>

  <vbox align="end">
    <hbox>
      <button id="saveChanges"
              label="&enigmail.cardDetails.save.label;"
              oncommand="doSaveChanges()"
              observes="bcEnableMode"/>
      <button id="reset"
              label="&enigmail.cardDetails.reset.label;"
              oncommand="doReset()"
              observes="bcEnableMode"/>
    </hbox>
  </vbox>

</window>
