<?xml version="1.0"?>

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

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

<!DOCTYPE window SYSTEM "chrome://messenger/locale/am-copies.dtd" >
<window xmlns:html="http://www.w3.org/1999/xhtml"
      xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
      class="color-dialog"
      onload="parent.onPanelLoaded('am-copies.xul');"
      orient="vertical">

  <stringbundleset id="stringbundleset">
  <stringbundle id="bundle_messenger" src="chrome://messenger/locale/messenger.properties"/>
  </stringbundleset>
  <script type="application/x-javascript" src="chrome://messenger/content/widgetglue.js"/>
  <script type="application/x-javascript" src="chrome://messenger/content/AccountManager.js"/>
  <script type="application/x-javascript" src="chrome://messenger/content/am-copies.js"/>
  
  <broadcaster id="broadcaster_doFcc"/>

  <text hidden="true" wsm_persist="true" id="identity.fccFolder"
                pref="true" preftype="string" prefattribute="value"
                prefstring="mail.identity.%identitykey%.fcc_folder"/>
  <text hidden="true" wsm_persist="true" id="identity.draftFolder"
                pref="true" preftype="string" prefattribute="value"
                prefstring="mail.identity.%identitykey%.draft_folder"/>
  <text hidden="true" wsm_persist="true" id="identity.stationeryFolder"
                pref="true" preftype="string" prefattribute="value"
                prefstring="mail.identity.%identitykey%.stationary_folder"/>
  <text hidden="true" wsm_persist="true" id="identity.email"/>
  
  <text hidden="true" wsm_persist="true" id="identity.fccFolderPickerMode"/>
  <text hidden="true" wsm_persist="true" id="identity.draftsFolderPickerMode"/>
  <text hidden="true" wsm_persist="true" id="identity.tmplFolderPickerMode"/>

  <hbox class="box-smallheader" title="&copyAndFolderTitle.label;"/>
  
  <groupbox orient="vertical" class="small-margin">
    <label value="&sendingPrefix.label;"/>

    <hbox autostretch="never">
      <checkbox wsm_persist="true" id="identity.doFcc" label="&fccMailFolder.label;" 
                pref="true" preftype="bool" prefattribute="value"
                prefstring="mail.identity.%identitykey%.fcc"
                oncommand="setupFccItems();"/>
    </hbox>
      <radiogroup id="doFcc" orient="vertical">
      <grid class="specialFolderPickerGrid">
        <columns>
          <column flex="1"/>
          <column flex="2"/>
        </columns>
        <rows>
          <row autostretch="never">
            <radio group="doFcc" id="fcc_selectAccount" 
                   value="0" label="&sentFolderOn.label;"
                   oncommand="setPickersState('msgFccAccountPicker', 'msgFccFolderPicker', event)" 
                   observes="broadcaster_doFcc"/>
  	    <menulist id="msgFccAccountPicker"
                      class="small-margin"
	              oncommand="noteSelectionChange('fcc_selectAccount')" 
	              flex="1" observes="broadcaster_doFcc"/>
          </row> 
          <row autostretch="never">
            <radio group="doFcc" id="fcc_selectFolder" 
	           value="1" label="&otherFolder.label;"
                   oncommand="setPickersState('msgFccFolderPicker', 'msgFccAccountPicker', event)" 
                   observes="broadcaster_doFcc"/>
  	    <menulist id="msgFccFolderPicker" 
                      class="small-margin"
	              oncommand="noteSelectionChange('fcc_selectFolder')" 
		      flex="1" observes="broadcaster_doFcc"/>
          </row>
        </rows>
      </grid>
    </radiogroup>

    <hbox autostretch="never">
      <checkbox wsm_persist="true" id="identity.bccSelf" before="&bccAccount.label; &lt;" after="&gt;"
                pref="true" preftype="bool" prefattribute="value"
                prefstring="mail.identity.%identitykey%.bcc_self"/>
    </hbox>
    
    <hbox autostretch="never">
      <checkbox wsm_persist="true" id="identity.bccOthers" label="&bccAddress.label;"
                pref="true" preftype="bool" prefattribute="value"
                prefstring="mail.identity.%identitykey%.bcc_other"/>
      <textbox wsm_persist="true" id="identity.bccList" flex="1"
               pref="true" preftype="string" prefattribute="value"
               prefstring="mail.identity.%identitykey%.bcc_other_list"/>
    </hbox>

  </groupbox>
  
  <groupbox orient="vertical" class="small-margin">
    <label value="&specialFoldersTitle.label;"/>

    <hbox autostretch="never">
      <text class="label" value="&keepDrafts.label;"/>
    </hbox>
    
    <radiogroup id="messageDrafts" orient="vertical">
      <grid class="specialFolderPickerGrid">
        <columns>
          <column flex="1"/>
          <column flex="2"/>
        </columns>
        <rows>
          <row autostretch="never">
            <radio group="messageDrafts" id="draft_selectAccount" 
                   oncommand="setPickersState('msgDraftsAccountPicker', 'msgDraftsFolderPicker', event)"
                   value="0" label="&draftsFolderOn.label;"/>
 	    <menulist id="msgDraftsAccountPicker" 
                      class="small-margin"
	              oncommand="noteSelectionChange('draft_selectAccount')"
                      flex="1"/>
          </row> 
          <row autostretch="never">
            <radio group="messageDrafts" id="draft_selectFolder" 
                   oncommand="setPickersState('msgDraftsFolderPicker', 'msgDraftsAccountPicker', event)"
                   value="1" label="&otherFolder.label;"/>
  	    <menulist id="msgDraftsFolderPicker"
                      class="small-margin"
                      oncommand="noteSelectionChange('draft_selectFolder')" 
                      flex="1"/>
          </row>
        </rows>
      </grid>
    </radiogroup>
    <hbox autostretch="never">
      <text class="label" value="&keepTempltes.label;"/>
    </hbox>
	
    <radiogroup id="messageTemplates" orient="vertical">
      <grid class="specialFolderPickerGrid">
        <columns>
          <column flex="1"/>
          <column flex="2"/>
        </columns>
        <rows>
          <row autostretch="never">
            <radio group="messageTemplates" id="tmpl_selectAccount" 
                   oncommand="setPickersState('msgStationeryAccountPicker', 'msgStationeryFolderPicker', event)"
                   value="0" label="&templatesFolderOn.label;"/>
  	    <menulist id="msgStationeryAccountPicker"
                      class="small-margin"
                      oncommand="noteSelectionChange('tmpl_selectAccount')" 
                      flex="1"/>
          </row> 
          <row autostretch="never">
            <radio group="messageTemplates" id="tmpl_selectFolder" 
                   oncommand="setPickersState('msgStationeryFolderPicker', 'msgStationeryAccountPicker', event)"
                  value="1" label="&otherFolder.label;"/>
            <menulist id="msgStationeryFolderPicker"
                      class="small-margin"
                      oncommand="noteSelectionChange('tmpl_selectFolder')" 
                      flex="1"/>
          </row>
        </rows>
      </grid>
    </radiogroup>
    <hbox autostretch="never">
      <checkbox wsm_persist="true" id="identity.showSaveMsgDlg" label="&saveMessageDlg.label;"
                pref="true" preftype="bool" prefattribute="value"
                prefstring="mail.identity.%identitykey%.showSaveMsgDlg"/>
    </hbox>
  </groupbox>

</window>
