<?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 http://mozilla.org/MPL/2.0/. -->

<?xml-stylesheet href="chrome://global/skin/global.css" type="text/css"?>
<?xml-stylesheet href="chrome://global/skin/preferences.css" type="text/css"?>
<?xml-stylesheet href="chrome://mozapps/content/extensions/extensions.css"
  type="text/css"?>
<?xml-stylesheet href="chrome://testpilot/content/browser.css" type="text/css"?>


<!DOCTYPE prefwindow [
  <!ENTITY % testpilotDTD SYSTEM "chrome://testpilot/locale/main.dtd">
    %testpilotDTD;
]>

<prefwindow id="test-pilot-all-studies-window"
  title="&testpilot.studiesWindow.title;"
  windowtype="extensions:testpilot:all_studies_window"
  xmlns="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
  onload="TestPilotXulWindow.onLoad();"
  onunload="TestPilotXulWindow.onUnload();">

  <script src="chrome://testpilot/content/window-utils.js"
    type="application/javascript;version=1.8"/>
  <script src="chrome://testpilot/content/all-studies-window.js"
    type="application/javascript;version=1.8"/>

  <stringbundleset id="stringbundleset">
    <stringbundle id="testpilot-stringbundle"
      src="chrome://testpilot/locale/main.properties" />
  </stringbundleset>

  <vbox flex="1">
    <windowdragbox orient="vertical">
      <radiogroup id="tp-radiogroup" orient="horizontal" role="listbox"
        class="paneSelector"
        onselect="TestPilotXulWindow.focusPane(this.selectedIndex);">
        <radio pane="current-studies-pane-button" orient="vertical">
          <image class="paneButtonIcon" />
          <label class="paneButtonLabel"
            value="&testpilot.studiesWindow.currentStudies.label;"/>
        </radio>
        <radio pane="finished-studies-pane-button" orient="vertical">
          <stack align="center" pack="center">
            <hbox align="center" pack="center">
             <image class="paneButtonIcon" />
            </hbox>
            <label id="num-finished-badge" class="pane-button-badge"/>
          </stack>
          <label class="paneButtonLabel"
            value="&testpilot.studiesWindow.finishedStudies.label;"/>
        </radio>
        <radio pane="study-results-pane-button" orient="vertical">
          <image class="paneButtonIcon" />
          <label class="paneButtonLabel"
            value="&testpilot.studiesWindow.studyFindings.label;"/>
        </radio>
        <radio pane="settings-pane-button" orient="vertical">
          <image class="paneButtonIcon" />
          <label class="paneButtonLabel"
            value="&testpilot.studiesWindow.settings.label;"/>
        </radio>
      </radiogroup>
    </windowdragbox>

    <deck id="tp-xulwindow-deck" flex="1">
      <prefpane id="current-studies-pane" class="tp-tab-panel">
        <richlistbox id="current-studies-listbox" class="tp-study-list"
          disabled="true">
          <richlistitem id="still-loading-msg" class="tp-study-list">
            <description class="pilot-largetext">
              &testpilot.studiesWindow.stillLoadingMessage;
            </description>
          </richlistitem>
        </richlistbox>
      </prefpane>

      <prefpane id="finished-studies-pane" class="tp-tab-panel">
        <richlistbox id="finished-studies-listbox" class="tp-study-list"
          disabled="true"/>
      </prefpane>

      <prefpane id="study-results-pane" class="tp-tab-panel">
        <richlistbox id="study-results-listbox" class="tp-study-list"
          disabled="true"/>
      </prefpane>

      <prefpane id="settings-pane" class="tp-tab-panel">
        <preferences>
          <preference id="notify-finished" type="bool"
                      name="extensions.testpilot.popup.showOnStudyFinished"/>
          <preference id="notify-new" type="bool"
                      name="extensions.testpilot.popup.showOnNewStudy"/>
          <preference id="notify-results" type="bool"
                      name="extensions.testpilot.popup.showOnNewResults"/>
          <preference id="always-submit-data" type="bool"
                      name="extensions.testpilot.alwaysSubmitData"/>
        </preferences>
        <vbox style="padding: 12px;">
          <groupbox>
            <caption label="&testpilot.settings.dataSubmission.label;" />
            <checkbox label="&testpilot.settings.alwaysSubmitData.label;"
                      preference="always-submit-data"/>
          </groupbox>
          <groupbox>
            <caption label="&testpilot.settings.notifications.label;" />
            <label value="&testpilot.settings.notifyWhen.label;"/>
            <hbox>
              <separator orient="vertical" />
              <vbox>
                <checkbox label="&testpilot.settings.readyToSubmit.label;"
                          preference="notify-finished"/>
                <checkbox label="&testpilot.settings.newStudy.label;"
                          preference="notify-new"/>
                <checkbox label="&testpilot.settings.hasNewResults.label;"
                          preference="notify-results"/>
              </vbox>
            </hbox>
          </groupbox>
        </vbox>
      </prefpane>
    </deck>
  </vbox>

  <!-- For the menubar on mac, the below elements are needed for
       macBrowserOverlay.xul to overlay this window. -->
  <stringbundleset id="stringbundleset"/>

  <commandset id="mainCommandSet"/>
  <commandset id="baseMenuCommandSet"/>
  <commandset id="placesCommands"/>

  <broadcasterset id="mainBroadcasterSet"/>

  <keyset id="mainKeyset"/>
  <keyset id="baseMenuKeyset"/>

  <menubar id="main-menubar" style="border:none !important;margin:0;padding:0;"/>

</prefwindow>
