<?xml version="1.0"?>

<!--

Copyright 2005-2010 Xmarks Inc.

foxmarks-dialog.xul: implements the main Foxmarks options dialog.

-->

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


<!DOCTYPE dialog SYSTEM "chrome://foxmarks/locale/foxmarks.dtd">

<prefwindow id="foxmarks-settings"
  title="&dialog.title;"
  windowtype="foxmarks:settings"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  xmlns:html="http://www.w3.org/1999/xhtml"
  buttons="help,accept,cancel"
  ondialogaccept="return dialogMgr.onOK();"
  ondialogcancel="return dialogMgr.onCancel();"
  ondialoghelp="return dialogMgr.onHelp();"
  onload="dialogMgr.onSetup();"
  onunload="dialogMgr.onUnload();"
  onclick="dialogMgr.onClick();"
  persist="screenX screenY"
  class="xmarks" >



  <prefpane id="foxmarks-mainpane" label="&label.status;" flex="1" 
    image="chrome://foxmarks/skin/images/pane-selector-general.png">

    <preferences>
      <preference id="foxmarks-autosync" 
        name="extensions.xmarks.synchOnTimer" type="bool" />
      <preference id="foxmarks-rememberpassword"
        name="extensions.xmarks.rememberPassword" type="bool" 
        instantApply="true" />
    </preferences>

    <deck selectedIndex="0" id="foxmarks-statusdeck" >
      <vbox>
        <image id="ping" height="1" width="1" />
        <groupbox>
          <caption label="&label.current.status;" />
          <vbox flex="1" id="statusbox">
            <hbox>
              <image id="status-image" width="36" height="28" />
              <label id="status-text"  
                style="font-size: 22px;font-family:arial,sans-serif;"/>
            </hbox>
          </vbox>
          <hbox align="center">
            <label value="&dialog.label.lastsync;" />
            <label id="lastSynchDate" />
            <spacer flex="1" />
            <button id="sync-cancel"
              label="&dialog.label.cancel;"
              class="mainpane-button"
              oncommand="dialogMgr.cancel();" />
            <button id="sync-now"
              label="&dialog.label.syncNow;" 
              class="mainpane-button"
              oncommand="dialogMgr.synchronizeNow();" />
          </hbox>

        </groupbox>
        <deck selectedIndex="0" id="accountdeck">
          <groupbox>
            <caption label="&label.account;" />
            <hbox align="center">
              <label id="login-status" />
              <spacer flex="1" />
              <button id="logout-button"
                label="&dialog.label.logout;"
                class="mainpane-button"
                oncommand="dialogMgr.logout();" />
              <button id="login-button"
                label="&dialog.label.login;"
                class="mainpane-button"
                oncommand="dialogMgr.login();" />
            </hbox>
            <hbox >
              <spacer flex="1" />
              <button label="&dialog.label.runWizard;" 
                class="mainpane-button"
                oncommand="dialogMgr.runSetupWizard();" />
            </hbox>
          </groupbox>
          <groupbox>
            <caption label="&label.account;" />
              <label>&usingown.desc;</label>
              <hbox pack="end">
                  <label class="text-link" value="&label.change;" 
                      onclick="dialogMgr.showPane('advpane');"/>
              </hbox>
          </groupbox>
        </deck>
      </vbox>
      <vbox>
        <description style="width: 20em; margin-bottom: 1.5em; padding: 4px;font-size: 14px;">
          &label.syncdisabled;
        </description>
        <hbox>
          <spacer flex="1"/>
          <button flex="0" 
            label="&dialog.label.runWizard;" class="mainpane-button"
            oncommand="dialogMgr.runSetupWizard();" />
        </hbox>
      </vbox>
    </deck>
    <hbox pack="end" flex="1">
      <label id="version" />
    </hbox>
  </prefpane>

  <prefpane id="foxmarks-syncpane" label="&label.sync;" flex="1"
    image="chrome://foxmarks/skin/images/pane-selector-types.png">
    <preferences>
      <preference id="foxmarks-synconshutdown"
        name="extensions.xmarks.syncOnShutdown" type="int" />
      <preference id="foxmarks-askfirst" type="bool"
        name="extensions.xmarks.syncOnShutdownAsk" />
      <preference id="xmarks-clientname" name="extensions.xmarks.clientName" 
        type="string" instantApply="true" />
    </preferences>
    <vbox>
      <groupbox flex="1">
        <caption label="&label.sync.caption;" />
        <checkbox id="sync-bookmarks" label="&label.sync.bookmarks;"
          oncommand="dialogMgr.panes.sync.handleBookmarkSync();" />
        <checkbox id="sync-history" label="&label.sync.history;"
          oncommand="dialogMgr.panes.sync.handleHistorySync();" />
        <hbox>
          <checkbox id="sync-passwords" label="&label.sync.passwords;"
            oncommand="dialogMgr.panes.sync.handlePasswordSync();" />
          <button id="sync-resetpin"  
            label="&label.sync.resetpin;" 
            oncommand="dialogMgr.panes.sync.doResetPIN();" />
          <button id="sync-deletepasswords"  
            label="&label.sync.deletepasswords;" 
            oncommand="dialogMgr.panes.sync.doDeletePasswords();" />
        </hbox>
        <checkbox id="sync-tabs" label="&label.sync.tabs;"
          oncommand="dialogMgr.panes.sync.handleTabSync()" />
        <hbox id="sync-tabs-div" align="center">
          <spacer style="width: 1.3em;" />
          <label value="&label.sync.clientname;" />
          <textbox id="client-name" flex="1" preference="xmarks-clientname" />
        </hbox>
        <label id="onlyFF3" value="&label.sync.onlyff3;" />
      </groupbox>
      <groupbox flex="1">
        <caption label="&label.synchronization;" />
        <hbox align="center">
          <checkbox id="autosync" label="&dialog.label.ontimer;"
            preference="foxmarks-autosync" />
          <spacer flex="1" />
        </hbox>
        <checkbox id="synconshutdown" 
          label="&dialog.label.synconshutdown;"
          onsynctopreference="return dialogMgr.panes.general.syncOnShutdownToPreference();"
          oncommand="dialogMgr.panes.general.syncOnShutdownChanged()"
          preference="foxmarks-synconshutdown" />
        <hbox align="center">
          <spacer style="width: 1.4em" />
          <checkbox id="askfirst" label="&dialog.label.askfirst;" 
            preference="foxmarks-askfirst" />
        </hbox>
      </groupbox>
    </vbox>
  </prefpane>

  <prefpane id="foxmarks-restorepane" label="&label.restore;" flex="1"
    image="chrome://foxmarks/skin/images/pane-selector-restore.png" >
    <description id="foxmarks-restoreprofile"  hidden="true" 
      style="width: 20em; margin-bottom: 1.5em; padding: 4px;">
      &restore.norestoreprofile;
    </description>
    <description id="foxmarks-restorenewuser"  hidden="true" 
      style="width: 20em; margin-bottom: 1.5em; padding: 4px;">
      &restore.norestorenewuser;
    </description>
    <description id="foxmarks-restoreownuser" hidden="true" 
      style="width: 20em; margin-bottom: 1.5em; padding: 4px;">
      &restore.norestoreownuser;
    </description>
    <description id="foxmarks-restoredesc" 
      style="width: 20em; margin-bottom: 1.5em; padding: 4px;">
      &desc.restore;
    </description>
    <groupbox id="foxmarks-restorebox">
      <caption label="&restore.boxlabel;" />
      <listbox id="foxmarks-restorelist" height="190"
        seltype="single" disabled="true" >
        <listitem>
          <listitem 
            class="listcell-iconic" label="&label.restore.loading;"
            image="chrome://foxmarks/skin/images/Throbber-small.gif"
            />
        </listitem>
      </listbox>
      <hbox>
        <spacer flex="1"/>
        <button  id="foxmarks-viewrestore" disable="true"
          label="&label.restore.view;" 
          oncommand="dialogMgr.panes.restore.viewRestore();" />
        <button  id="foxmarks-dorestore" disable="true"
          label="&label.restore.restore;" 
          oncommand="dialogMgr.panes.restore.restore();" />
      </hbox>
    </groupbox>
    <label value="" />
    <label value="" />
  </prefpane>
  <prefpane id="foxmarks-profilepane" label="&label.profiles;" flex="1"
    image="chrome://foxmarks/skin/images/pane-selector-profiles_TEMP.png">
    <preferences>
      <preference id="useview" name="extensions.xmarks.useView" type="bool" />
    </preferences>
    <description style="width: 20em; margin-bottom: 1.5em; padding: 4px;">
      &desc.profile;
    </description>
    <hbox style="padding-bottom: 8em;">
      <groupbox flex="1">
        <hbox align="center">
          <label value="&label.manageprofiles;" />
          <spacer flex="1" />
          <button id="launchMyProfiles" class="manage-profile-button"
            label="&label.profile.my;" 
            oncommand="dialogMgr.panes.profile.myFoxmarks();" />
        </hbox>
        <hbox align="center">
          <label value="&label.profilechoice;" />
          <label id="profileName" /> 
          <spacer flex="1" />
          <button id="profileChangeButton" 
            class="manage-profile-button"
            label="&label.profile.change;" 
            oncommand="dialogMgr.panes.profile.changeProfile();" />
        </hbox>
        <checkbox label="&label.profile.useview;" preference="useview" 
            id="useview-control" />
      </groupbox>
    </hbox>
  </prefpane>

  <prefpane id="foxmarks-advpane" label="&label.advanced;" flex="1" 
    image="chrome://foxmarks/skin/images/pane-selector-advanced.png">
    <preferences>
      <preference id="foxmarks-encrypt" 
        name="extensions.xmarks.securityLevel" type="int" instantApply="true" />
      <preference id="foxmarks-enablelogging"
        name="extensions.xmarks.enableLogging" type="bool" />
      <preference id="foxmarks-useownserver"
        name="extensions.xmarks.useOwnServer" type="bool"
        onchange="dialogMgr.panes.advanced.useOwnServerChanged()" />
      <preference id="foxmarks-url" 
        name="extensions.xmarks.url-bookmarks" 
        instantApply="true" type="string" />
      <preference id="foxmarks-passwordurl" 
        name="extensions.xmarks.url-passwords" 
        instantApply="true" type="string" />
    </preferences>
    <groupbox>
      <caption label="&label.security;" />
      <hbox align="center">
        <label control="encrypt" value="&label.encrypt;" />
        <menulist id="encrypt" preference="foxmarks-encrypt" >
          <menupopup>
            <menuitem label="&label.noencrypt;" value="-1" />
            <menuitem label="&label.passwordonly;" value="0" />
            <menuitem label="&label.encryptall;" value="1" />
          </menupopup>
        </menulist>
      </hbox>
    </groupbox>
    <groupbox>
      <caption label="&label.manualoverwrite;" />
      <hbox align="center">
        <label value="&label.forceoverwriteserver;" />
        <spacer flex="1" />
        <button label="&label.upload;" class="manual-overwrite-button" 
          oncommand="dialogMgr.uploadNow();" flex="0" id="upload" />
      </hbox>
      <hbox align="center">
        <label value="&label.forceoverwritelocal;" />
        <spacer flex="1" />
        <button label="&label.download;" 
          class="manual-overwrite-button"
          oncommand="dialogMgr.downloadNow();" flex="0" />
      </hbox>
    </groupbox>
    <groupbox flex="1">
      <caption label="&label.logging;" />
      <hbox align="center">
        <checkbox label="&label.enablelogging;"
          preference="foxmarks-enablelogging" />
        <spacer flex="1" />
        <button label="&label.showlogfile;" 
          oncommand="dialogMgr.panes.advanced.displayLogFile()" />
      </hbox>
    </groupbox>
    <groupbox>
      <caption label="&label.server;" />
      <hbox align="center">
        <checkbox id="useown" label="&label.useownserver;"
          oncommand="return dialogMgr.panes.advanced.useOwnServer();"
          preference="foxmarks-useownserver" />
        <spacer flex="1" />
        <button id="ownserver-edit" label="&label.edit;" 
            oncommand="return dialogMgr.panes.advanced.useOwnServer();" />
      </hbox>
      <grid id="useown-grid">
        <columns>
          <column /><column flex="1" />
        </columns>
        <rows>
          <row align="center">
            <label id="useown-url-label" value="&label.url;" />
            <textbox id="url" flex="1" preference="foxmarks-url" 
                disabled="true"/>
          </row>
          <row align="center">
            <label id="useown-passwordurl-label" 
              value="&label.passwordurl;" />
            <textbox id="passwordurl" flex="1" 
              preference="foxmarks-passwordurl" disabled="true" />
          </row>
        </rows>
      </grid>
      <hbox align="center" pack="end">
        <label class="text-link"
          onclick='dialogMgr.panes.advanced.moreOwnServer();'
          value="&label.ownserver.moreinfo;" />
      </hbox>
    </groupbox>
    <label value="" />
  </prefpane>

  <script src="foxmarks-dialog.js" />
  <script src="foxmarks-settings.js" />
  <script src="foxmarks-uitools.js" />

</prefwindow>
