<?xml version="1.0" encoding="utf-8" standalone="no"?>
<!--
/*
 * Copyright (c) OutWit Technologies 2007-2017.
 * All rights reserved.
 */
-->

<?xml-stylesheet href="chrome://mozapps/content/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://outwit-kernel/skin/preferences/preferences.css"?>

<?xml-stylesheet href="chrome://outwit-modules-docs/skin/preferences/preferences.css"?>
<?xml-stylesheet href="chrome://outwit-kernel/content/preferences/handlers.css"?>
<?xml-stylesheet href="chrome://outwit-kernel/skin/preferences/applications.css"?>


<!DOCTYPE window SYSTEM "chrome://outwit-modules-docs/locale/preferences/preferences.dtd">

<!--
paneMain,paneTabs,paneContent,paneApplications,panePrivacy,paneSecurity,paneAdvanced
-->
<prefwindow
  id       = "outwitPreferences"
  title    = "Preferences"
  type="prefwindow"
  width    = ""
  height   = ""
  xmlns    = "http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  xmlns:xbl="http://www.mozilla.org/xbl"
>

  <script type="application/javascript">
    <![CDATA[
    /*
      var extensions = ["csv", "ods", "odt", "xls", "xlsx", "doc", "docx", "pdf", "rtf", "pps", "ppsx",
                        "ppt", "pptx", "swf", "txt", "sxw", "key"];
      function checkExtensionsField(aString) {
        var extensionList = extensionList.split(/[\.,;:\/|\s]+/);
        var notSupported = "";
        for (var i = 0; i < extensionList.length; ++i) {
          if (!extensions.indexOf(extensionList[i])) notSupported += extensionList[i] + ', ';
        }
      }
      */

      function autoSaveSwitch() {
        document.getElementById("autosaveCheckbox").checked = window.opener.optionsCtrl.autoSaveSwitch();
        document.getElementById("autosaveFolderTextbox").value = (window.opener.optionsCtrl.autoSaveFolder ? window.opener.optionsCtrl.autoSaveFolder : "");
      }

      function chooseSaveFolder() {
        document.getElementById("autosaveFolderTextbox").value = window.opener.optionsCtrl.chooseSaveFolder(true);
        document.getElementById("autosaveCheckbox").checked = window.opener.optionsCtrl.autoSave;
      }
    ]]>
  </script>

  <prefpane id="paneMain" label="General">
    <preferences>
      <preference id="query-typeList-option" name="extensions.outwit.oWDocs.queryTypesInQuery" type="string" instantApply="true" />
      <!--preference id="query-typeList" name="extensions.outwit.oWDocs.queryTypeList" type="string"/-->
      <preference id="next-step" name="extensions.outwit.oWDocs.nextStep" type="int" instantApply="true" />
      <preference id="allowEngineTest" name="extensions.outwit.oWDocs.allowEngineTest" type="bool" instantApply="true" />
      <preference id="autosaveRemember" name="extensions.outwit.oWDocs.autosave.remember" type="bool" instantApply="true" />
      <preference id="autosaveFolder" name="extensions.outwit.oWDocs.autosave.folder" type="string" instantApply="true" />

    </preferences>
    
    <hbox>
      <vbox flex="1">
      <label control="query-label" value="&pref.query-label;" flex="1"/>
      <spacer height="10"/>
      
        <radiogroup id="queryBuilding" preference="query-typeList-option" orient="vertical">
          <radio id="query-typeList-radio-all" group="queryBuilding" label="&pref.query-radio-all;" value="all" tooltiptext="&pref.query-radio-all.tooltip;" />
          <radio id="query-typeList-radio-selection" group="queryBuilding" label="&pref.query-radio-selection;" value="selectionPanel" tooltiptext="&pref.query-radio-selection.tooltip;" />
          <!--
          <radio id="query-typeList-radio-list" group="queryBuilding" label="&pref.query-radio-list;" oncommand="chooseType(this);"/>
          -->
        </radiogroup>
      </vbox>
     </hbox>
     <!--
     <textbox id="query-typeList-textbox" type="string" preference="query-typeList" width="100" tooltiptext=" &pref.query-typeList.tooltip;" flex="1" />
     -->
    <spacer flex="1"/>
    <spacer height="30" />
    
    <hbox>
      <vbox flex="1">
        <label control="next-step-label1" value="&pref.next-step-label1;" flex="1"/>
        <label control="next-step-label2" value="&pref.next-step-label2;" flex="1"/>
      </vbox>
      <spacer flex="1"/>
      <textbox id="next-step-textbox" type="number" preference="next-step" min="1"  max="10" increment="1"
               decimalplaces="0" width="80"
               tooltiptext="&pref.next-step-textbox.tooltip;" flex="1"/>
    </hbox>

    <spacer flex="1"/>
    <spacer height="30" />
    
    <hbox>
      <checkbox
        label="&pref.allowEngineTest.label;"
        preference="allowEngineTest"
        tooltiptext="&pref.allowEngineTest.tooltip;"
      />
      <spacer flex="1" />
      <button
        label="&pref.resetEngineConfig.label;"
        tooltiptext="&pref.resetEngineConfig.tooltip;"
        oncommand="window.opener.resetEngineConfig()"
      />
    </hbox>

    <spacer flex="1"/>
    <spacer height="30" />
    
    <hbox>
      <label value="&pref.autosave.label;" />
      <!--spacer flex="1" /-->
      <textbox
        id="autosaveFolderTextbox"
        preference="autosaveFolder"
      />
      <spacer flex="1" />
      <button
        label="&pref.button.browse;"
        oncommand="chooseSaveFolder()"
      />
    </hbox>
    <hbox>
      <checkbox
        id="rememberAutoSaveCheckbox"
        preference="autosaveRemember"
        label="&pref.rememberAutosave.label;"
      />
    </hbox>


  </prefpane>

  <!--prefpane id="paneAdvanced" label="Advanced">
    <preferences>
      <preference id="" name="" type="string" instantApply="true" />
    </preferences>
    
    <hbox>
     <textbox id="engine-param-label1-textbox" type="string" preference="engine-param-label1" tooltiptext="&pref.query-typeList.tooltip;" disabled ="true" value ="Engine" width="100" />
     <textbox id="engine-param-label2-textbox" type="string" preference="engine-param-label2" tooltiptext="&pref.query-typeList.tooltip;" disabled ="true" value ="Parameters" width="100" />
     <textbox id="engine-param-label3-textbox" type="string" preference="engine-param-label3" tooltiptext="&pref.query-typeList.tooltip;" disabled ="true" value ="Query Order" width="150"  />
     <textbox id="engine-param-label4-textbox" type="string" preference="engine-param-label4" tooltiptext="&pref.query-typeList.tooltip;" disabled ="true" value ="Operators" width="100" />
	<button label="Check All" oncommand="" />
    </hbox>
    <hbox>
     <textbox id="engine-name-textbox" type="string" preference="engine-name" tooltiptext="&pref.query-typeList.tooltip;" width="100" />
     <textbox id="engine-params-textbox" type="string" preference="engine-params" tooltiptext="&pref.query-typeList.tooltip;" width="100" />
	 <menulist type="menu-button" oncommand="" id="" crop="end" width="150" sizetopopup="none">
       <menupopup id="modeListMenu" >
         <menuitem label="Params, Search Terms" command='cmd_viewAsIcons' />
         <menuitem label="Search Terms, Params" command='cmd_viewAsIcons' />
         <menuitem label="Either Order" command='cmd_viewAsIcons' />
       </menupopup>
     </menulist>
     <textbox id="engine-operators-textbox" type="string" preference="engine-operators" tooltiptext="&pref.query-typeList.tooltip;" width="100" />
	<button label="Analyze" oncommand="" />
    </hbox>
    <hbox>
	<spacer flex="4"/>
	<button label="Reset" oncommand="" />
    </hbox>


    <spacer flex="1"/>
  </prefpane-->
</prefwindow>
