<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>TemplateDialog</class>
 <widget class="QDialog" name="TemplateDialog">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>588</width>
    <height>546</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="windowTitle">
   <string>Edit template</string>
  </property>
  <layout class="QVBoxLayout" name="verticalLayout">
   <item>
    <widget class="QScrollArea" name="scroll_area">
     <property name="widgetResizable">
      <bool>true</bool>
     </property>
     <widget class="QWidget" name="wid1">
      <layout class="QVBoxLayout" name="verticalLayout">
       <item>
        <widget class="QWidget" name="color_layout">
         <layout class="QGridLayout">
          <item row="0" column="0">
           <widget class="QLabel" name="colored_field_label">
            <property name="text">
             <string>Set the color of the column:</string>
            </property>
            <property name="buddy">
             <cstring>colored_field</cstring>
            </property>
           </widget>
          </item>
          <item row="0" column="1">
           <widget class="QComboBox" name="colored_field">
           </widget>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="color_chooser_label">
            <property name="text">
             <string>Copy a color name to the clipboard:</string>
            </property>
            <property name="buddy">
             <cstring>color_name</cstring>
            </property>
           </widget>
          </item>
          <item row="1" column="1">
           <widget class="ColorButton" name="color_name">
           </widget>
          </item>
          <item row="1" column="2">
           <widget class="QToolButton" name="color_copy_button">
            <property name="icon">
             <iconset resource="../../../../resources/images.qrc">
              <normaloff>:/images/edit-copy.png</normaloff>:/images/edit-copy.png</iconset>
            </property>
            <property name="toolTip">
             <string>Copy the selected color name to the clipboard</string>
            </property>
           </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item>
        <widget class="QWidget" name="icon_layout">
         <layout class="QGridLayout">
          <item row="0" column="0" colspan="2">
           <layout class="QHBoxLayout" name="icon_kind_layout">
            <item>
             <widget class="QLabel" name="icon_kind_label">
              <property name="text">
               <string>Kind:</string>
              </property>
             </widget>
            </item>
            <item>
             <widget class="QComboBox" name="icon_kind">
             </widget>
            </item>
           </layout>
          </item>
          <item row="1" column="0">
           <widget class="QLabel" name="icon_chooser_label">
            <property name="text">
             <string>Apply the icon to column:</string>
            </property>
            <property name="buddy">
             <cstring>icon_field</cstring>
            </property>
           </widget>
          </item>
          <item row="1" column="1">
           <widget class="QComboBox" name="icon_field">
           </widget>
          </item>
          <item row="2" column="0">
           <widget class="QLabel" name="image_chooser_label">
            <property name="text">
             <string>Copy an icon file name to the clipboard:</string>
            </property>
            <property name="buddy">
             <cstring>icon_files</cstring>
            </property>
           </widget>
          </item>
          <item row="2" column="1">
           <widget class="QWidget">
            <layout class="QHBoxLayout" name="icon_select_layout">
             <item>
              <widget class="QComboBox" name="icon_files">
               <property name="toolTip">
                <string>&lt;p&gt;The template must return the name of the icon file
                to display. If you wish to display multiple icons, separate the
                individual icon file names with a ':' (colon). They will all be
                displayed in the column&lt;/p&gt;</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QToolButton" name="icon_copy_button">
               <property name="icon">
                <iconset resource="../../../../resources/images.qrc">
                 <normaloff>:/images/edit-copy.png</normaloff>:/images/edit-copy.png</iconset>
               </property>
               <property name="toolTip">
                <string>Copy the selected icon file name to the clipboard</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QPushButton" name="filename_button">
               <property name="text">
                <string>Add icon</string>
               </property>
               <property name="toolTip">
                <string>Add an icon file to the set of choices</string>
               </property>
              </widget>
             </item>
            </layout>
           </widget>
          </item>
         </layout>
        </widget>
       </item>
       <item>
        <layout class="QGridLayout" name="gridLayout">
         <item row="0" column="0">
          <layout class="QHBoxLayout">
           <item>
            <widget class="QLabel" name="template_name_label">
             <property name="text">
              <string>Template &amp;name:</string>
             </property>
             <property name="buddy">
              <cstring>template_name</cstring>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QComboBox" name="template_name">
             <property name="editable">
              <bool>true</bool>
             </property>
             <property name="toolTip">
              <string>The name of the callable template</string>
             </property>
            </widget>
           </item>
          </layout>
         </item>
         <item row="1" column="0" colspan="3">
          <layout class="FlowLayout">
           <item>
            <widget class="QLabel">
             <property name="text">
              <string>T&amp;emplate:</string>
             </property>
             <property name="buddy">
              <cstring>textbox</cstring>
             </property>
             <property name="toolTip">
              <string>The text of the template program goes into the box below</string>
             </property>
             <property name="alignment">
              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignVCenter</set>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLabel">
             <property name="text">
              <string>        </string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QCheckBox" name="run_as_you_type_box">
             <property name="text">
              <string>R&amp;un as you type</string>
             </property>
             <property name="toolTip">
              <string>&lt;p&gt;If checked then the template will be run (tested) after every
keystroke. If unchecked then the template will be run when the "Go" button is pushed.&lt;/p&gt;</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="Separator">
             <property name="buddy">
              <cstring>go_button</cstring>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QToolButton" name="go_button">
             <property name="text">
              <string>&amp;Go</string>
             </property>
             <property name="icon">
              <iconset resource="../../../../resources/images.qrc">
               <normaloff>:/images/sync-right.png</normaloff>:/images/sync-right.png</iconset>
             </property>
             <property name="toolButtonStyle">
              <set>Qt::ToolButtonTextBesideIcon</set>
             </property>
             <property name="toolTip">
              <string>If 'Run as you type' is not checked then click this button to run your template</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="Separator">
             <property name="buddy">
              <cstring>go_button</cstring>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QCheckBox" name="break_box">
             <property name="text">
              <string>Enable &amp;breakpoints</string>
             </property>
             <property name="toolTip">
              <string>&lt;p&gt;If checked, the template evaluator will stop when it
evaluates an expression on a double-clicked line number, opening a dialog showing
you the value as well as all the local variables&lt;/p&gt;</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLabel" name="breakpoint_line_box_label">
             <property name="text">
              <string>&amp;Line:</string>
             </property>
             <property name="buddy">
              <cstring>breakpoint_line_box</cstring>
             </property>
             <property name="toolTip">
              <string>Line number to toggle</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QSpinBox" name="breakpoint_line_box">
             <property name="toolTip">
              <string>Line number to toggle</string>
             </property>
             <property name="minimum">
              <number>1</number>
             </property>
             <property name="maximum">
              <number>999</number>
             </property>
             <property name="value">
              <number>1</number>
             </property>
             <property name="alignment">
              <set>Qt::AlignRight</set>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QToolButton" name="toggle_button">
             <property name="text">
              <string>&amp;Toggle</string>
             </property>
             <property name="toolButtonStyle">
              <set>Qt::ToolButtonTextBesideIcon</set>
             </property>
             <property name="icon">
              <iconset resource="../../../../resources/images.qrc">
               <normaloff>:/images/swap.png</normaloff>:/images/swap.png</iconset>
             </property>
             <property name="toolTip">
              <string>Toggle the breakpoint on the line number in the box</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="Separator">
             <property name="buddy">
              <cstring>go_button</cstring>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QToolButton" name="remove_all_button">
             <property name="text">
              <string>&amp;Remove all</string>
             </property>
             <property name="toolButtonStyle">
              <set>Qt::ToolButtonTextBesideIcon</set>
             </property>
             <property name="icon">
              <iconset resource="../../../../resources/images.qrc">
               <normaloff>:/images/list_remove.png</normaloff>:/images/list_remove.png</iconset>
             </property>
             <property name="toolTip">
              <string>Remove all breakpoints</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QToolButton" name="set_all_button">
             <property name="text">
              <string>&amp;Set all</string>
             </property>
             <property name="toolButtonStyle">
              <set>Qt::ToolButtonTextBesideIcon</set>
             </property>
             <property name="icon">
              <iconset resource="../../../../resources/images.qrc">
               <normaloff>:/images/plus.png</normaloff>:/images/plus.png</iconset>
             </property>
             <property name="toolTip">
              <string>Set breakpoint on every line</string>
             </property>
            </widget>
           </item>
          </layout>
         </item>
         <item row="2" column="0" colspan="3">
          <widget class="CodeEditor" name="textbox">
           <property name="toolTip">
            <string>&lt;p&gt;The text of the template program goes in this box.
            A General Program Mode template must begin with the word "program:".
            A Python template must begin with the word "python:" followed by a
            function definition line. There is a context menu item you can use
            to enter the first lines of a Python template.&lt;/p&gt;</string>
           </property>
           <property name="sizePolicy">
            <sizepolicy hsizetype="MinimumExpanding" vsizetype="MinimumExpanding">
             <horstretch>0</horstretch>
             <verstretch>1</verstretch>
            </sizepolicy>
           </property>
          </widget>
         </item>
         <item row="3" column="0">
          <widget class="QLabel" name="new_doc_label">
           <property name="text">
            <string>D&amp;ocumentation:</string>
           </property>
           <property name="buddy">
            <cstring>new_doc</cstring>
           </property>
           <property name="alignment">
            <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
           </property>
          </widget>
         </item>
         <item row="4" column="0" colspan="3">
          <widget class="QTextEdit" name="new_doc">
           <property name="toolTip">
            <string>Documentation for the function being defined or edited</string>
           </property>
          </widget>
         </item>
         <item row="7" column="0">
          <layout class="QHBoxLayout">
           <item>
            <widget class="QLabel">
             <property name="text">
              <string>Template value:</string>
             </property>
             <property name="buddy">
              <cstring>template_value</cstring>
             </property>
             <property name="toolTip">
              <string>The value of the template using the currently selected book(s)
in the library view</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QCheckBox" name="show_all_selected_books">
             <property name="text">
              <string>Show template result for all selected books</string>
             </property>
             <property name="toolTip">
              <string>&lt;p&gt;If checked then the template will be evaluated for all selected
books. If not checked then the template will be evaluated for the first selected book. Unchecking this
box is useful if the template uses the selected books to generate a report.&lt;/p&gt;</string>
             </property>
            </widget>
           </item>
          </layout>
         </item>
         <item row="8" column="0" colspan="3">
          <widget class="QTableWidget" name="template_value">
          </widget>
         </item>
         <item row="11" column="0">
          <widget class="QLabel" name="user_label_1">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="11" column="1">
          <layout class="QVBoxLayout" name="user_layout_1">
          </layout>
         </item>
         <item row="12" column="0">
          <widget class="QLabel" name="user_label_2">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="12" column="1">
          <layout class="QVBoxLayout" name="user_layout_2">
          </layout>
         </item>
         <item row="13" column="0">
          <widget class="QLabel" name="user_label_3">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="13" column="1">
          <layout class="QVBoxLayout" name="user_layout_3">
          </layout>
         </item>
         <item row="14" column="0">
          <widget class="QLabel" name="user_label_4">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="14" column="1">
          <layout class="QVBoxLayout" name="user_layout_4">
          </layout>
         </item>
         <item row="15" column="0">
          <widget class="QLabel" name="user_label_5">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="15" column="1">
          <layout class="QVBoxLayout" name="user_layout_5">
          </layout>
         </item>
         <item row="16" column="0">
          <widget class="QLabel" name="user_label_6">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="16" column="1">
          <layout class="QVBoxLayout" name="user_layout_6">
          </layout>
         </item>
         <item row="17" column="0">
          <widget class="QLabel" name="user_label_7">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="17" column="1">
          <layout class="QVBoxLayout" name="user_layout_7">
          </layout>
         </item>
         <item row="18" column="0">
          <widget class="QLabel" name="user_label_8">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="18" column="1">
          <layout class="QVBoxLayout" name="user_layout_8">
          </layout>
         </item>
         <item row="19" column="0">
          <widget class="QLabel" name="user_label_9">
           <property name="text">
            <string>User label</string>
           </property>
           <property name="buddy">
            <cstring>template_value</cstring>
           </property>
           <property name="visible">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="24" column="0" colspan="3">
          <layout class="QHBoxLayout">
           <item>
            <widget class="QLabel" name="font_name_label">
             <property name="text">
              <string>Font:</string>
             </property>
             <property name="buddy">
              <cstring>font_box</cstring>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QFontComboBox" name="font_box">
             <property name="toolTip">
              <string>Select the font for the Template box</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLabel" name="font_size_label">
             <property name="text">
              <string>Size:</string>
             </property>
             <property name="buddy">
              <cstring>font_size_box</cstring>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QSpinBox" name="font_size_box">
             <property name="toolTip">
              <string>Select the font size for the Template box</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QFrame" name="frame">
             <property name="frameShape">
              <enum>QFrame::VLine</enum>
             </property>
             <property name="frameShadow">
              <enum>QFrame::Raised</enum>
             </property>
             <property name="lineWidth">
              <number>3</number>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QToolButton" name="load_button">
             <property name="text">
              <string>Lo&amp;ad</string>
             </property>
             <property name="toolTip">
              <string>Load the template from a file</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QToolButton" name="save_button">
             <property name="text">
              <string>Sa&amp;ve</string>
             </property>
             <property name="toolTip">
              <string>Save the template in a file</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QFrame" name="frame">
             <property name="frameShape">
              <enum>QFrame::VLine</enum>
             </property>
             <property name="frameShadow">
              <enum>QFrame::Raised</enum>
             </property>
             <property name="lineWidth">
              <number>3</number>
             </property>
            </widget>
           </item>
           <item>
            <spacer>
             <property name="orientation">
              <enum>Qt::Horizontal</enum>
             </property>
             <property name="sizeHint" stdset="0">
              <size>
               <width>10</width>
               <height>0</height>
              </size>
             </property>
            </spacer>
           </item>
           <item>
            <widget class="QDialogButtonBox" name="buttonBox">
             <property name="orientation">
              <enum>Qt::Horizontal</enum>
             </property>
             <property name="standardButtons">
              <set>QDialogButtonBox::Cancel|QDialogButtonBox::Ok</set>
             </property>
            </widget>
           </item>
          </layout>
         </item>
         <item row="25" column="0" colspan="3">
          <widget class="QFrame">
           <property name="frameShape">
            <enum>QFrame::HLine</enum>
           </property>
          </widget>
         </item>
         <item row="30" column="0" colspan="3">
          <layout class="QGridLayout">
           <item row="0" column="0" colspan="2">
            <layout class="QHBoxLayout">
             <item>
              <spacer>
               <property name="orientation">
                <enum>Qt::Horizontal</enum>
               </property>
               <property name="sizeHint" stdset="0">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
              </spacer>
             </item>
             <item>
              <widget class="QLabel" name="tf_ref">
               <property name="text">
                <string>Template Function Reference</string>
               </property>
               <property name="openExternalLinks">
                <bool>true</bool>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QLabel" name="template_tutorial">
               <property name="openExternalLinks">
                <bool>true</bool>
               </property>
              </widget>
             </item>
             <item>
              <spacer>
               <property name="orientation">
                <enum>Qt::Horizontal</enum>
               </property>
               <property name="sizeHint" stdset="0">
                <size>
                 <width>10</width>
                 <height>0</height>
                </size>
               </property>
              </spacer>
             </item>
            </layout>
           </item>
           <item row="1" column="0">
            <widget class="QLabel" name="label">
             <property name="text">
              <string>Function &amp;name:</string>
             </property>
             <property name="buddy">
              <cstring>function</cstring>
             </property>
            </widget>
           </item>
           <item row="1" column="1">
            <widget class="QComboBox" name="function"/>
           </item>
           <item row="2" column="0">
            <widget class="QLabel" name="label_22">
             <property name="text">
              <string>&amp;Function type:</string>
             </property>
             <property name="alignment">
              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
             </property>
             <property name="buddy">
              <cstring>func_type</cstring>
             </property>
            </widget>
           </item>
           <item row="2" column="1">
            <widget class="QLineEdit" name="func_type">
             <property name="readOnly">
              <bool>true</bool>
             </property>
            </widget>
           </item>
           <item row="3" column="0">
            <layout class="QVBoxLayout" name="lo_34">
             <item>
              <widget class="QPushButton" name="doc_button">
               <property name="text">
                <string>&amp;Documentation</string>
               </property>
               <property name="toolTip">
                <string>Click this button to open the documentation in a separate dialog.
If no function is selected above then show all functions.
Selecting a function will show only that function's documentation</string>
               </property>
              </widget>
             </item>
             <item>
              <widget class="QPushButton" name="general_info_button">
               <property name="text">
                 <string>General &amp;information</string>
               </property>
               <property name="toolTip">
                 <string>Click this button to see general help about using template functions
 and how they are documented.</string>
               </property>
              </widget>
             </item>
            </layout>
           </item>
           <item row="3" column="1">
            <widget class="QTextBrowser" name="documentation">
             <property name="maximumSize">
              <size>
               <width>16777215</width>
               <height>75</height>
              </size>
             </property>
            </widget>
           </item>
           <item row="4" column="0">
            <widget class="QLabel" name="label_3">
             <property name="text">
              <string>&amp;Code:</string>
             </property>
             <property name="alignment">
              <set>Qt::AlignLeading|Qt::AlignLeft|Qt::AlignTop</set>
             </property>
             <property name="buddy">
              <cstring>source_code</cstring>
             </property>
            </widget>
           </item>
           <item row="4" column="1">
            <widget class="QPlainTextEdit" name="source_code">
             <property name="maximumSize">
              <size>
               <width>16777215</width>
               <height>75</height>
              </size>
             </property>
            </widget>
           </item>
          </layout>
         </item>
        </layout>
       </item>
      </layout>
     </widget>
    </widget>
   </item>
  </layout>
 </widget>
 <customwidgets>
  <customwidget>
   <class>ColorButton</class>
   <extends>QPushButton</extends>
   <header>calibre/gui2/widgets2.h</header>
  </customwidget>
  <customwidget>
   <class>FlowLayout</class>
   <extends>QLayout</extends>
   <header>calibre/gui2/widgets2.h</header>
  </customwidget>
  <customwidget>
   <class>BoxLayout</class>
   <extends>QBoxLayout</extends>
   <header>calibre/gui2/dialogs/template_dialog_box_layout.h</header>
  </customwidget>
  <customwidget>
   <class>Separator</class>
   <extends>QWidget</extends>
   <header>calibre/gui2/widgets2.h</header>
  </customwidget>
  <customwidget>
   <class>CodeEditor</class>
   <extends>QPlainTextEdit</extends>
   <header>calibre/gui2/dialogs/template_dialog_code_widget.h</header>
  </customwidget>
 </customwidgets>
 <resources/>
 <connections>
  <connection>
   <sender>buttonBox</sender>
   <signal>accepted()</signal>
   <receiver>TemplateDialog</receiver>
   <slot>accept()</slot>
   <hints>
    <hint type="sourcelabel">
     <x>229</x>
     <y>211</y>
    </hint>
    <hint type="destinationlabel">
     <x>157</x>
     <y>234</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>buttonBox</sender>
   <signal>rejected()</signal>
   <receiver>TemplateDialog</receiver>
   <slot>reject()</slot>
   <hints>
    <hint type="sourcelabel">
     <x>297</x>
     <y>217</y>
    </hint>
    <hint type="destinationlabel">
     <x>286</x>
     <y>234</y>
    </hint>
   </hints>
  </connection>
 </connections>
</ui>
