<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
 <class>DbManagerDlgSqlWindow</class>
 <widget class="QDialog" name="DbManagerDlgSqlWindow">
  <property name="geometry">
   <rect>
    <x>0</x>
    <y>0</y>
    <width>995</width>
    <height>716</height>
   </rect>
  </property>
  <property name="sizePolicy">
   <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
    <horstretch>0</horstretch>
    <verstretch>0</verstretch>
   </sizepolicy>
  </property>
  <property name="windowTitle">
   <string>SQL Window</string>
  </property>
  <layout class="QGridLayout" name="gridLayout_4">
   <item row="0" column="0">
    <widget class="QSplitter" name="splitter">
     <property name="orientation">
      <enum>Qt::Vertical</enum>
     </property>
     <widget class="QWidget" name="layoutWidget">
      <layout class="QVBoxLayout" name="verticalLayout_2">
       <item>
        <layout class="QHBoxLayout" name="horizontalLayout">
         <item>
          <widget class="QToolButton" name="queryBuilderBtn">
           <property name="text">
            <string/>
           </property>
          </widget>
         </item>
         <item>
          <spacer name="horizontalSpacer">
           <property name="orientation">
            <enum>Qt::Horizontal</enum>
           </property>
           <property name="sizeHint" stdset="0">
            <size>
             <width>40</width>
             <height>20</height>
            </size>
           </property>
          </spacer>
         </item>
         <item>
          <widget class="QLabel" name="label">
           <property name="text">
            <string>Saved query</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QComboBox" name="presetCombo">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
             <horstretch>1</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QLabel" name="label_2">
           <property name="text">
            <string>Name</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QLineEdit" name="presetName">
           <property name="sizePolicy">
            <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
             <horstretch>1</horstretch>
             <verstretch>0</verstretch>
            </sizepolicy>
           </property>
           <property name="text">
            <string notr="true"/>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QPushButton" name="presetStore">
           <property name="text">
            <string>Save</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QPushButton" name="presetDelete">
           <property name="text">
            <string>Delete</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QPushButton" name="presetLoadFile">
           <property name="toolTip">
            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Load SQL file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
           </property>
           <property name="text">
            <string>Load File</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QPushButton" name="presetSaveAsFile">
           <property name="toolTip">
            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Save the query as SQL file&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
           </property>
           <property name="text">
            <string>Save As File</string>
           </property>
          </widget>
         </item>
        </layout>
       </item>
       <item>
        <widget class="QSplitter" name="splitterHistory">
         <property name="orientation">
          <enum>Qt::Horizontal</enum>
         </property>
         <property name="handleWidth">
          <number>2</number>
         </property>
         <widget class="QgsCodeEditorSQL" name="editSql"/>
         <widget class="QWidget" name="queryHistoryWidget" native="true">
          <layout class="QGridLayout" name="gridLayout_2">
           <property name="leftMargin">
            <number>0</number>
           </property>
           <property name="topMargin">
            <number>0</number>
           </property>
           <property name="rightMargin">
            <number>0</number>
           </property>
           <property name="bottomMargin">
            <number>0</number>
           </property>
           <item row="0" column="0">
            <widget class="QTableWidget" name="queryHistoryTableWidget">
             <property name="editTriggers">
              <set>QAbstractItemView::NoEditTriggers</set>
             </property>
             <property name="alternatingRowColors">
              <bool>true</bool>
             </property>
             <property name="selectionMode">
              <enum>QAbstractItemView::SingleSelection</enum>
             </property>
             <property name="selectionBehavior">
              <enum>QAbstractItemView::SelectRows</enum>
             </property>
             <attribute name="horizontalHeaderStretchLastSection">
              <bool>true</bool>
             </attribute>
             <column>
              <property name="text">
               <string>Query</string>
              </property>
             </column>
             <column>
              <property name="text">
               <string>Rows affected</string>
              </property>
             </column>
             <column>
              <property name="text">
               <string>Duration (secs)</string>
              </property>
             </column>
            </widget>
           </item>
          </layout>
         </widget>
        </widget>
       </item>
       <item>
        <layout class="QHBoxLayout" name="buttonLayout">
         <item>
          <widget class="QPushButton" name="btnExecute">
           <property name="toolTip">
            <string>Execute query (Ctrl+R)</string>
           </property>
           <property name="text">
            <string>Execute</string>
           </property>
           <property name="shortcut">
            <string>Ctrl+R</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QLabel" name="lblResult">
           <property name="text">
            <string/>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QPushButton" name="btnCreateView">
           <property name="text">
            <string>Create a view</string>
           </property>
          </widget>
         </item>
         <item>
          <widget class="QPushButton" name="btnClear">
           <property name="text">
            <string>&amp;Clear</string>
           </property>
          </widget>
         </item>
         <item>
          <spacer>
           <property name="orientation">
            <enum>Qt::Horizontal</enum>
           </property>
           <property name="sizeHint" stdset="0">
            <size>
             <width>40</width>
             <height>20</height>
            </size>
           </property>
          </spacer>
         </item>
         <item>
          <widget class="QPushButton" name="btnQueryHistory">
           <property name="text">
            <string>Query History</string>
           </property>
           <property name="checkable">
            <bool>true</bool>
           </property>
          </widget>
         </item>
        </layout>
       </item>
      </layout>
     </widget>
     <widget class="QWidget" name="layoutWidget">
      <layout class="QVBoxLayout" name="verticalLayout">
       <item>
        <widget class="QgsCodeEditorSQL" name="errorText">
         <property name="visible">
          <bool>false</bool>
         </property>
         <property name="readOnly">
          <bool>true</bool>
         </property>
        </widget>
       </item>
       <item>
        <widget class="QTableView" name="viewResult">
         <property name="sizePolicy">
          <sizepolicy hsizetype="Expanding" vsizetype="Expanding">
           <horstretch>0</horstretch>
           <verstretch>3</verstretch>
          </sizepolicy>
         </property>
         <property name="selectionBehavior">
          <enum>QAbstractItemView::SelectRows</enum>
         </property>
         <property name="horizontalScrollMode">
          <enum>QAbstractItemView::ScrollPerPixel</enum>
         </property>
        </widget>
       </item>
      </layout>
     </widget>
    </widget>
   </item>
   <item row="1" column="0">
    <widget class="QGroupBox" name="loadAsLayerGroup">
     <property name="sizePolicy">
      <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
       <horstretch>0</horstretch>
       <verstretch>0</verstretch>
      </sizepolicy>
     </property>
     <property name="title">
      <string>Load as new layer</string>
     </property>
     <property name="checkable">
      <bool>true</bool>
     </property>
     <property name="checked">
      <bool>true</bool>
     </property>
     <layout class="QGridLayout" name="gridLayout">
      <item row="0" column="0" colspan="2">
       <widget class="QWidget" name="loadAsLayerWidget" native="true">
        <layout class="QGridLayout" name="gridLayout_3">
         <property name="leftMargin">
          <number>0</number>
         </property>
         <property name="topMargin">
          <number>0</number>
         </property>
         <property name="rightMargin">
          <number>0</number>
         </property>
         <property name="bottomMargin">
          <number>0</number>
         </property>
         <item row="0" column="3">
          <widget class="QPushButton" name="getColumnsBtn">
           <property name="text">
            <string>Retrieve 
columns</string>
           </property>
          </widget>
         </item>
         <item row="2" column="1">
          <spacer name="horizontalSpacer_2">
           <property name="orientation">
            <enum>Qt::Horizontal</enum>
           </property>
           <property name="sizeHint" stdset="0">
            <size>
             <width>40</width>
             <height>20</height>
            </size>
           </property>
          </spacer>
         </item>
         <item row="1" column="3">
          <widget class="QPushButton" name="btnSetFilter">
           <property name="text">
            <string>Set filter</string>
           </property>
           <property name="autoDefault">
            <bool>false</bool>
           </property>
          </widget>
         </item>
         <item row="2" column="3">
          <widget class="QPushButton" name="loadLayerBtn">
           <property name="text">
            <string>Load</string>
           </property>
          </widget>
         </item>
         <item row="2" column="0">
          <widget class="QCheckBox" name="avoidSelectById">
           <property name="toolTip">
            <string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;&lt;p&gt;Avoid selecting feature by id. Sometimes - especially when running expensive queries/views - fetching the data sequentially instead of fetching features by id can be much quicker.&lt;/p&gt;&lt;/body&gt;&lt;/html&gt;</string>
           </property>
           <property name="text">
            <string>Avoid selecting by feature id</string>
           </property>
          </widget>
         </item>
         <item row="1" column="0" colspan="2">
          <layout class="QHBoxLayout" name="horizontalLayout_7">
           <item>
            <widget class="QLabel" name="label_5">
             <property name="text">
              <string>Layer name (prefix)</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QLineEdit" name="layerNameEdit">
             <property name="enabled">
              <bool>true</bool>
             </property>
             <property name="text">
              <string notr="true"/>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QWidget" name="layerTypeWidget" native="true">
             <layout class="QHBoxLayout" name="horizontalLayout_3">
              <property name="leftMargin">
               <number>0</number>
              </property>
              <property name="topMargin">
               <number>0</number>
              </property>
              <property name="rightMargin">
               <number>0</number>
              </property>
              <property name="bottomMargin">
               <number>0</number>
              </property>
              <item>
               <widget class="QLabel" name="label_6">
                <property name="text">
                 <string>Type</string>
                </property>
                <property name="indent">
                 <number>40</number>
                </property>
               </widget>
              </item>
              <item>
               <widget class="QRadioButton" name="vectorRadio">
                <property name="text">
                 <string>Vector</string>
                </property>
                <property name="checked">
                 <bool>true</bool>
                </property>
               </widget>
              </item>
              <item>
               <widget class="QRadioButton" name="rasterRadio">
                <property name="text">
                 <string>Raster</string>
                </property>
               </widget>
              </item>
             </layout>
            </widget>
           </item>
          </layout>
         </item>
         <item row="0" column="0" colspan="2">
          <layout class="QHBoxLayout" name="horizontalLayout_6">
           <item>
            <widget class="QCheckBox" name="uniqueColumnCheck">
             <property name="text">
              <string>Column(s) with 
unique values</string>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QComboBox" name="uniqueCombo">
             <property name="enabled">
              <bool>false</bool>
             </property>
             <property name="sizePolicy">
              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="editable">
              <bool>true</bool>
             </property>
             <property name="insertPolicy">
              <enum>QComboBox::NoInsert</enum>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QCheckBox" name="hasGeometryCol">
             <property name="text">
              <string>Geometry column</string>
             </property>
             <property name="checked">
              <bool>true</bool>
             </property>
             <property name="tristate">
              <bool>false</bool>
             </property>
            </widget>
           </item>
           <item>
            <widget class="QComboBox" name="geomCombo">
             <property name="sizePolicy">
              <sizepolicy hsizetype="Expanding" vsizetype="Fixed">
               <horstretch>0</horstretch>
               <verstretch>0</verstretch>
              </sizepolicy>
             </property>
             <property name="editable">
              <bool>true</bool>
             </property>
             <property name="insertPolicy">
              <enum>QComboBox::NoInsert</enum>
             </property>
            </widget>
           </item>
          </layout>
         </item>
        </layout>
       </widget>
      </item>
     </layout>
    </widget>
   </item>
   <item row="2" column="0">
    <layout class="QHBoxLayout" name="horizontalLayout_4">
     <property name="bottomMargin">
      <number>0</number>
     </property>
     <item>
      <widget class="QProgressBar" name="progressBar">
       <property name="value">
        <number>24</number>
       </property>
      </widget>
     </item>
     <item>
      <widget class="QPushButton" name="btnCancel">
       <property name="toolTip">
        <string>Cancel query (ESC)</string>
       </property>
       <property name="text">
        <string>Cancel</string>
       </property>
      </widget>
     </item>
    </layout>
   </item>
  </layout>
 </widget>
 <customwidgets>
  <customwidget>
   <class>QgsCodeEditorSQL</class>
   <extends>QTextEdit</extends>
   <header>qgis.gui</header>
  </customwidget>
 </customwidgets>
 <tabstops>
  <tabstop>queryBuilderBtn</tabstop>
  <tabstop>presetCombo</tabstop>
  <tabstop>presetName</tabstop>
  <tabstop>presetDelete</tabstop>
  <tabstop>editSql</tabstop>
  <tabstop>btnExecute</tabstop>
  <tabstop>btnCreateView</tabstop>
  <tabstop>btnClear</tabstop>
  <tabstop>viewResult</tabstop>
  <tabstop>loadAsLayerGroup</tabstop>
  <tabstop>uniqueColumnCheck</tabstop>
  <tabstop>uniqueCombo</tabstop>
  <tabstop>hasGeometryCol</tabstop>
  <tabstop>geomCombo</tabstop>
  <tabstop>getColumnsBtn</tabstop>
  <tabstop>layerNameEdit</tabstop>
  <tabstop>vectorRadio</tabstop>
  <tabstop>rasterRadio</tabstop>
  <tabstop>btnSetFilter</tabstop>
  <tabstop>avoidSelectById</tabstop>
  <tabstop>loadLayerBtn</tabstop>
 </tabstops>
 <resources/>
 <connections>
  <connection>
   <sender>loadAsLayerGroup</sender>
   <signal>toggled(bool)</signal>
   <receiver>avoidSelectById</receiver>
   <slot>setVisible(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>88</x>
     <y>351</y>
    </hint>
    <hint type="destinationlabel">
     <x>142</x>
     <y>451</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>hasGeometryCol</sender>
   <signal>toggled(bool)</signal>
   <receiver>geomCombo</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>379</x>
     <y>385</y>
    </hint>
    <hint type="destinationlabel">
     <x>525</x>
     <y>385</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>uniqueColumnCheck</sender>
   <signal>toggled(bool)</signal>
   <receiver>uniqueCombo</receiver>
   <slot>setEnabled(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>109</x>
     <y>385</y>
    </hint>
    <hint type="destinationlabel">
     <x>274</x>
     <y>385</y>
    </hint>
   </hints>
  </connection>
  <connection>
   <sender>loadAsLayerGroup</sender>
   <signal>toggled(bool)</signal>
   <receiver>loadAsLayerWidget</receiver>
   <slot>setVisible(bool)</slot>
   <hints>
    <hint type="sourcelabel">
     <x>312</x>
     <y>450</y>
    </hint>
    <hint type="destinationlabel">
     <x>312</x>
     <y>456</y>
    </hint>
   </hints>
  </connection>
 </connections>
</ui>
