<?xml version="1.0"?>
<?xml-stylesheet href="chrome://messenger/skin/messenger.css" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>

<!DOCTYPE window SYSTEM "chrome://messenger/locale/am-server-top.dtd" >

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

  <script src="chrome://messenger/content/am-server.js"/>
  <script src="chrome://global/content/strres.js"/>

  <text hidden="true" wsm_persist="true" id="server.type"/>

  <box class="box-smallheader" title="&serverSettings.label;"/>

  <grid>
    <columns>
      <column/>
      <column/>
    </columns>
    <rows>      
      <row autostretch="never">
        <text class="label" value="&serverType.label;"/>
        <text class="label" id="servertype.verbose"/>
      </row>
      <row autostretch="never">
            <text class="label" value="&serverName.label;"/>
            <!-- when #14295 is fixed, remove disabled="true" -->
            <textfield wsm_persist="true" disabled="true" size="25" id="server.hostName"/>
      </row>
      <row autostretch="never">
        <box iscontrolcontainer="true" autostretch="never">
            <text hidable="true" hidefor="nntp" class="label" id="userNameLabel" value="&userName.label;"/>
        </box>
        <box iscontrolcontainer="true" autostretch="never">
            <!-- when #14295 is fixed, remove disabled="true" -->
            <textfield hidable="true" hidefor="nntp" wsm_persist="true" disabled="true" size="25" id="server.username"/>
        </box>
      </row>
      <row>
        <box autostretch="never">
            <text class="label" value="&port.label;"/>
        </box>
        <box autostretch="never">
            <textfield autostretch="never" wsm_persist="true" size="5" id="server.port"/>
        </box>
      </row>
    </rows>
  </grid>

  <spring class="spacer"/>

  <titledbox>
  <title value="&serverSettings.label;"/>
  <box orient="vertical" flex="1">
  <checkbox iscontrolcontainer="true" hidable="true" wsm_persist="true" id="server.isSecure" value="&isSecure.label;" hidefor="pop3" oncommand="secureSelect();"/>
  <checkbox iscontrolcontainer="true" hidable="true" wsm_persist="true" id="server.loginAtStartUp" hidefor="nntp" value="&loginAtStartup.label;"/>
<!--
  <checkbox iscontrolcontainer="true" hidable="true" wsm_persist="true" id="server.rememberPassword" hidefor="nntp"
            value="&savePassword.label;"/>
-->
  <box orient="horizontal" autostretch="never">
    <checkbox wsm_persist="true" id="server.doBiff" value="&biffStart.label;"/>
    <textfield wsm_persist="true" id="server.biffMinutes" size="3"/>
    <text class="label" for="server.biffMinutes" value="&biffEnd.label;"/>
  </box>
  <!-- POP3 -->
  <box orient="vertical" iscontrolcontainer="true" autostretch="never">
    <checkbox hidable="true" style="margin-left: 2em" hidefor="imap,nntp"
            wsm_persist="true" id="server.downloadOnBiff"
            value="&downloadOnBiff.label;"/>

    <checkbox wsm_persist="true" id="pop3.leaveMessagesOnServer"
            value="&leaveOnServer.label;"/>

    <checkbox wsm_persist="true" id="pop3.deleteMailLeftOnServer"
            value="&deleteOnServer.label;"/>
  </box>
  <box iscontrolcontainer="true" autostretch="never">
    <checkbox hidable="true" hidefor="imap,nntp" wsm_persist="true" value="&maxMessageSizePrefix.label;" id="pop3.limitMessageSize"/>
    <textfield wsm_persist="true" id="pop3.maxMessageSize" size="3"/>
    <text value="&maxMessageSizePostfix.label;" for="pop3.limitMessageSize" class="label"/>
  </box>
  <separator class="thin"/>
  <!-- IMAP -->
  <box iscontrolcontainer="true" autostretch="never">
    <text class="label" value="&deleteMessagePrefix.label;"/>
    <menulist hidable="true" hidefor="pop3,nntp" wsm_persist="true" id="imap.deleteModel">
      <menupopup>
        <menuitem data="1" value="&modelMoveToTrash.label;"/>
        <menuitem data="0" value="&modelMarkDeleted.label;"/>
        <menuitem data="2" value="&modelDeleteImmediately.label;"/>
      </menupopup>
    </menulist>
    <spring flex="1"/>
  </box>
  <separator class="thin"/>

  <checkbox hidable="true" hidefor="pop3,nntp" wsm_persist="true" id="imap.cleanupInboxOnExit"
            value="&expungeOnExit.label;" iscontrolcontainer="true"/>
  <checkbox hidable="true" hidefor="nntp" wsm_persist="true" id="server.emptyTrashOnExit" 
            value="&emptyTrashOnExit.label;" iscontrolcontainer="true"/>

  <box iscontrolcontainer="true" flex="1">
    <box flex="1">
      <spring flex="1"/>
      <button value="&advancedButton.label;"
              oncommand="openImapAdvanced(event);"/>
    </box>

    <checkbox hidable="true" hidefor="pop3,nntp" hidden="true" wsm_persist="true" id="imap.dualUseFolders"/>
    <checkbox hidden="true" wsm_persist="true" id="imap.usingSubscription"/>
    <text hidden="true" wsm_persist="true" id="imap.personalNamespace"/>
    <text hidden="true" wsm_persist="true" id="imap.publicNamespace"/>
    <text hidden="true" wsm_persist="true" id="imap.otherUsersNamespace"/>
    <text hidden="true" wsm_persist="true" id="imap.serverDirectory"/>
    <checkbox hidden="true" wsm_persist="true" id="imap.overrideNamespaces"/>
  </box>

  <!-- NNTP -->
  <box iscontrolcontainer="true" orient="horizontal">
    <checkbox hidable="true" hidefor="pop3,imap" wsm_persist="true" id="nntp.notifyOn"
                value="&maxMessagesStart.label;"/>
    <box iscontrolcontainer="true" autostretch="never">
      <textfield wsm_persist="true" id="nntp.maxArticles" size="6"/>
      <text class="label" for="nntp.maxArticles" value="&maxMessagesEnd.label;"/>
    </box>
  </box>
<!-- take out for now - bug 45079
    <box iscontrolcontainer="true" flex="100%">
      <titledbox orient="vertical">
         <title><text class="header label" value="&abbreviate.label;"/></title>

         <radiogroup hidable="true" hidefor="pop3,imap" orient="vertical" wsm_persist="true" id="nntp.abbreviate">
           <radio group="nntp.abbreviate" wsm_persist="true" data="true" value="&abbreviateOn.label;"/>
           <radio group="nntp.abbreviate" wsm_persist="true" data="false" value="&abbreviateOff.label;"/>
         </radiogroup>
      </titledbox>
  </box>
-->

  <box orient="vertical" iscontrolcontainer="true">
    <text class="label" value="&newsrcFilePath.label;" for="nntp.newsrcFilePath"/>
    <textfield hidable="true" hidefor="imap,pop3" wsm_persist="true" id="nntp.newsrcFilePath"
               datatype="nsIFileSpec"/>
  </box>
  </box>
  </titledbox>
  <spring flex="100%"/>
  <box orient="vertical">
    <text class="label" value="&localPath.label;" for="server.localPath"/>
    <textfield wsm_persist="true" id="server.localPath"
            datatype="nsIFileSpec"/>
  </box>
</window>
