# -*- coding: utf-8 -*-

# Form implementation generated from reading ui file '/tmp/SBo/slackrepo.BgmkId/build_qgis/qgis-2.18.11/python/plugins/db_manager/ui/DlgSqlWindow.ui'
#
# Created by: PyQt4 UI code generator 4.11.4
#
# WARNING! All changes made in this file will be lost!

from PyQt4 import QtCore, QtGui

try:
    _fromUtf8 = QtCore.QString.fromUtf8
except AttributeError:
    def _fromUtf8(s):
        return s

try:
    _encoding = QtGui.QApplication.UnicodeUTF8
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig, _encoding)
except AttributeError:
    def _translate(context, text, disambig):
        return QtGui.QApplication.translate(context, text, disambig)

class Ui_DbManagerDlgSqlWindow(object):
    def setupUi(self, DbManagerDlgSqlWindow):
        DbManagerDlgSqlWindow.setObjectName(_fromUtf8("DbManagerDlgSqlWindow"))
        DbManagerDlgSqlWindow.resize(626, 525)
        self.gridLayout_2 = QtGui.QGridLayout(DbManagerDlgSqlWindow)
        self.gridLayout_2.setObjectName(_fromUtf8("gridLayout_2"))
        self.loadAsLayerGroup = QtGui.QGroupBox(DbManagerDlgSqlWindow)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.loadAsLayerGroup.sizePolicy().hasHeightForWidth())
        self.loadAsLayerGroup.setSizePolicy(sizePolicy)
        self.loadAsLayerGroup.setCheckable(True)
        self.loadAsLayerGroup.setChecked(True)
        self.loadAsLayerGroup.setObjectName(_fromUtf8("loadAsLayerGroup"))
        self.gridLayout = QtGui.QGridLayout(self.loadAsLayerGroup)
        self.gridLayout.setObjectName(_fromUtf8("gridLayout"))
        self.loadAsLayerWidget = QtGui.QWidget(self.loadAsLayerGroup)
        self.loadAsLayerWidget.setObjectName(_fromUtf8("loadAsLayerWidget"))
        self.gridLayout_3 = QtGui.QGridLayout(self.loadAsLayerWidget)
        self.gridLayout_3.setMargin(0)
        self.gridLayout_3.setObjectName(_fromUtf8("gridLayout_3"))
        self.horizontalLayout_2 = QtGui.QHBoxLayout()
        self.horizontalLayout_2.setObjectName(_fromUtf8("horizontalLayout_2"))
        self.avoidSelectById = QtGui.QCheckBox(self.loadAsLayerWidget)
        self.avoidSelectById.setObjectName(_fromUtf8("avoidSelectById"))
        self.horizontalLayout_2.addWidget(self.avoidSelectById)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_2.addItem(spacerItem)
        self.loadLayerBtn = QtGui.QPushButton(self.loadAsLayerWidget)
        self.loadLayerBtn.setObjectName(_fromUtf8("loadLayerBtn"))
        self.horizontalLayout_2.addWidget(self.loadLayerBtn)
        self.gridLayout_3.addLayout(self.horizontalLayout_2, 2, 0, 1, 1)
        self.horizontalLayout_6 = QtGui.QHBoxLayout()
        self.horizontalLayout_6.setObjectName(_fromUtf8("horizontalLayout_6"))
        self.uniqueColumnCheck = QtGui.QCheckBox(self.loadAsLayerWidget)
        self.uniqueColumnCheck.setObjectName(_fromUtf8("uniqueColumnCheck"))
        self.horizontalLayout_6.addWidget(self.uniqueColumnCheck)
        self.uniqueCombo = QtGui.QComboBox(self.loadAsLayerWidget)
        self.uniqueCombo.setEnabled(False)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.uniqueCombo.sizePolicy().hasHeightForWidth())
        self.uniqueCombo.setSizePolicy(sizePolicy)
        self.uniqueCombo.setEditable(True)
        self.uniqueCombo.setInsertPolicy(QtGui.QComboBox.NoInsert)
        self.uniqueCombo.setObjectName(_fromUtf8("uniqueCombo"))
        self.horizontalLayout_6.addWidget(self.uniqueCombo)
        self.hasGeometryCol = QtGui.QCheckBox(self.loadAsLayerWidget)
        self.hasGeometryCol.setChecked(True)
        self.hasGeometryCol.setTristate(False)
        self.hasGeometryCol.setObjectName(_fromUtf8("hasGeometryCol"))
        self.horizontalLayout_6.addWidget(self.hasGeometryCol)
        self.geomCombo = QtGui.QComboBox(self.loadAsLayerWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.geomCombo.sizePolicy().hasHeightForWidth())
        self.geomCombo.setSizePolicy(sizePolicy)
        self.geomCombo.setEditable(True)
        self.geomCombo.setInsertPolicy(QtGui.QComboBox.NoInsert)
        self.geomCombo.setObjectName(_fromUtf8("geomCombo"))
        self.horizontalLayout_6.addWidget(self.geomCombo)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_6.addItem(spacerItem1)
        self.getColumnsBtn = QtGui.QPushButton(self.loadAsLayerWidget)
        self.getColumnsBtn.setObjectName(_fromUtf8("getColumnsBtn"))
        self.horizontalLayout_6.addWidget(self.getColumnsBtn)
        self.gridLayout_3.addLayout(self.horizontalLayout_6, 0, 0, 1, 1)
        self.horizontalLayout_7 = QtGui.QHBoxLayout()
        self.horizontalLayout_7.setObjectName(_fromUtf8("horizontalLayout_7"))
        self.label_5 = QtGui.QLabel(self.loadAsLayerWidget)
        self.label_5.setObjectName(_fromUtf8("label_5"))
        self.horizontalLayout_7.addWidget(self.label_5)
        self.layerNameEdit = QtGui.QLineEdit(self.loadAsLayerWidget)
        self.layerNameEdit.setEnabled(True)
        self.layerNameEdit.setText(_fromUtf8(""))
        self.layerNameEdit.setObjectName(_fromUtf8("layerNameEdit"))
        self.horizontalLayout_7.addWidget(self.layerNameEdit)
        self.layerTypeWidget = QtGui.QWidget(self.loadAsLayerWidget)
        self.layerTypeWidget.setObjectName(_fromUtf8("layerTypeWidget"))
        self.horizontalLayout_3 = QtGui.QHBoxLayout(self.layerTypeWidget)
        self.horizontalLayout_3.setMargin(0)
        self.horizontalLayout_3.setObjectName(_fromUtf8("horizontalLayout_3"))
        self.label_6 = QtGui.QLabel(self.layerTypeWidget)
        self.label_6.setIndent(40)
        self.label_6.setObjectName(_fromUtf8("label_6"))
        self.horizontalLayout_3.addWidget(self.label_6)
        self.vectorRadio = QtGui.QRadioButton(self.layerTypeWidget)
        self.vectorRadio.setChecked(True)
        self.vectorRadio.setObjectName(_fromUtf8("vectorRadio"))
        self.horizontalLayout_3.addWidget(self.vectorRadio)
        self.rasterRadio = QtGui.QRadioButton(self.layerTypeWidget)
        self.rasterRadio.setObjectName(_fromUtf8("rasterRadio"))
        self.horizontalLayout_3.addWidget(self.rasterRadio)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Fixed, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout_3.addItem(spacerItem2)
        self.horizontalLayout_7.addWidget(self.layerTypeWidget)
        self.btnSetFilter = QtGui.QPushButton(self.loadAsLayerWidget)
        self.btnSetFilter.setAutoDefault(False)
        self.btnSetFilter.setObjectName(_fromUtf8("btnSetFilter"))
        self.horizontalLayout_7.addWidget(self.btnSetFilter)
        self.gridLayout_3.addLayout(self.horizontalLayout_7, 1, 0, 1, 1)
        self.gridLayout.addWidget(self.loadAsLayerWidget, 0, 0, 1, 1)
        self.gridLayout_2.addWidget(self.loadAsLayerGroup, 1, 0, 1, 1)
        self.splitter = QtGui.QSplitter(DbManagerDlgSqlWindow)
        self.splitter.setOrientation(QtCore.Qt.Vertical)
        self.splitter.setObjectName(_fromUtf8("splitter"))
        self.layoutWidget = QtGui.QWidget(self.splitter)
        self.layoutWidget.setObjectName(_fromUtf8("layoutWidget"))
        self.verticalLayout_2 = QtGui.QVBoxLayout(self.layoutWidget)
        self.verticalLayout_2.setObjectName(_fromUtf8("verticalLayout_2"))
        self.horizontalLayout = QtGui.QHBoxLayout()
        self.horizontalLayout.setObjectName(_fromUtf8("horizontalLayout"))
        self.queryBuilderBtn = QtGui.QToolButton(self.layoutWidget)
        self.queryBuilderBtn.setText(_fromUtf8(""))
        self.queryBuilderBtn.setObjectName(_fromUtf8("queryBuilderBtn"))
        self.horizontalLayout.addWidget(self.queryBuilderBtn)
        spacerItem3 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem3)
        self.label = QtGui.QLabel(self.layoutWidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.presetCombo = QtGui.QComboBox(self.layoutWidget)
        self.presetCombo.setObjectName(_fromUtf8("presetCombo"))
        self.horizontalLayout.addWidget(self.presetCombo)
        self.label_2 = QtGui.QLabel(self.layoutWidget)
        self.label_2.setObjectName(_fromUtf8("label_2"))
        self.horizontalLayout.addWidget(self.label_2)
        self.presetName = QtGui.QLineEdit(self.layoutWidget)
        self.presetName.setText(_fromUtf8(""))
        self.presetName.setObjectName(_fromUtf8("presetName"))
        self.horizontalLayout.addWidget(self.presetName)
        self.presetStore = QtGui.QPushButton(self.layoutWidget)
        self.presetStore.setObjectName(_fromUtf8("presetStore"))
        self.horizontalLayout.addWidget(self.presetStore)
        self.presetDelete = QtGui.QPushButton(self.layoutWidget)
        self.presetDelete.setObjectName(_fromUtf8("presetDelete"))
        self.horizontalLayout.addWidget(self.presetDelete)
        self.verticalLayout_2.addLayout(self.horizontalLayout)
        self.editSql = QgsCodeEditorSQL(self.layoutWidget)
        self.editSql.setObjectName(_fromUtf8("editSql"))
        self.verticalLayout_2.addWidget(self.editSql)
        self.hboxlayout = QtGui.QHBoxLayout()
        self.hboxlayout.setObjectName(_fromUtf8("hboxlayout"))
        self.btnExecute = QtGui.QPushButton(self.layoutWidget)
        self.btnExecute.setObjectName(_fromUtf8("btnExecute"))
        self.hboxlayout.addWidget(self.btnExecute)
        self.lblResult = QtGui.QLabel(self.layoutWidget)
        self.lblResult.setText(_fromUtf8(""))
        self.lblResult.setObjectName(_fromUtf8("lblResult"))
        self.hboxlayout.addWidget(self.lblResult)
        self.btnCreateView = QtGui.QPushButton(self.layoutWidget)
        self.btnCreateView.setObjectName(_fromUtf8("btnCreateView"))
        self.hboxlayout.addWidget(self.btnCreateView)
        spacerItem4 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.hboxlayout.addItem(spacerItem4)
        self.btnClear = QtGui.QPushButton(self.layoutWidget)
        self.btnClear.setObjectName(_fromUtf8("btnClear"))
        self.hboxlayout.addWidget(self.btnClear)
        self.verticalLayout_2.addLayout(self.hboxlayout)
        self.layoutWidget1 = QtGui.QWidget(self.splitter)
        self.layoutWidget1.setObjectName(_fromUtf8("layoutWidget1"))
        self.verticalLayout = QtGui.QVBoxLayout(self.layoutWidget1)
        self.verticalLayout.setObjectName(_fromUtf8("verticalLayout"))
        self.viewResult = QtGui.QTableView(self.layoutWidget1)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Expanding)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(3)
        sizePolicy.setHeightForWidth(self.viewResult.sizePolicy().hasHeightForWidth())
        self.viewResult.setSizePolicy(sizePolicy)
        self.viewResult.setSelectionBehavior(QtGui.QAbstractItemView.SelectRows)
        self.viewResult.setHorizontalScrollMode(QtGui.QAbstractItemView.ScrollPerPixel)
        self.viewResult.setObjectName(_fromUtf8("viewResult"))
        self.verticalLayout.addWidget(self.viewResult)
        self.gridLayout_2.addWidget(self.splitter, 0, 0, 1, 1)

        self.retranslateUi(DbManagerDlgSqlWindow)
        QtCore.QObject.connect(self.loadAsLayerGroup, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.avoidSelectById.setVisible)
        QtCore.QObject.connect(self.hasGeometryCol, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.geomCombo.setEnabled)
        QtCore.QObject.connect(self.uniqueColumnCheck, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.uniqueCombo.setEnabled)
        QtCore.QObject.connect(self.loadAsLayerGroup, QtCore.SIGNAL(_fromUtf8("toggled(bool)")), self.loadAsLayerWidget.setVisible)
        QtCore.QMetaObject.connectSlotsByName(DbManagerDlgSqlWindow)
        DbManagerDlgSqlWindow.setTabOrder(self.btnExecute, self.btnClear)
        DbManagerDlgSqlWindow.setTabOrder(self.btnClear, self.viewResult)

    def retranslateUi(self, DbManagerDlgSqlWindow):
        DbManagerDlgSqlWindow.setWindowTitle(_translate("DbManagerDlgSqlWindow", "SQL window", None))
        self.loadAsLayerGroup.setTitle(_translate("DbManagerDlgSqlWindow", "Load as new layer", None))
        self.avoidSelectById.setToolTip(_translate("DbManagerDlgSqlWindow", "<html><head/><body><p>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.</p></body></html>", None))
        self.avoidSelectById.setText(_translate("DbManagerDlgSqlWindow", "Avoid selecting by feature id", None))
        self.loadLayerBtn.setText(_translate("DbManagerDlgSqlWindow", "Load now!", None))
        self.uniqueColumnCheck.setText(_translate("DbManagerDlgSqlWindow", "Column(s) with \n"
"unique values", None))
        self.hasGeometryCol.setText(_translate("DbManagerDlgSqlWindow", "Geometry column", None))
        self.getColumnsBtn.setText(_translate("DbManagerDlgSqlWindow", "Retrieve \n"
"columns", None))
        self.label_5.setText(_translate("DbManagerDlgSqlWindow", "Layer name (prefix)", None))
        self.label_6.setText(_translate("DbManagerDlgSqlWindow", "Type", None))
        self.vectorRadio.setText(_translate("DbManagerDlgSqlWindow", "Vector", None))
        self.rasterRadio.setText(_translate("DbManagerDlgSqlWindow", "Raster", None))
        self.btnSetFilter.setText(_translate("DbManagerDlgSqlWindow", "Set filter", None))
        self.label.setText(_translate("DbManagerDlgSqlWindow", "Saved query:", None))
        self.label_2.setText(_translate("DbManagerDlgSqlWindow", "Name", None))
        self.presetStore.setText(_translate("DbManagerDlgSqlWindow", "Store", None))
        self.presetDelete.setText(_translate("DbManagerDlgSqlWindow", "Delete", None))
        self.btnExecute.setText(_translate("DbManagerDlgSqlWindow", "&Execute (F5)", None))
        self.btnExecute.setShortcut(_translate("DbManagerDlgSqlWindow", "F5", None))
        self.btnCreateView.setText(_translate("DbManagerDlgSqlWindow", "Create a view", None))
        self.btnClear.setText(_translate("DbManagerDlgSqlWindow", "&Clear", None))

from qgis.gui import QgsCodeEditorSQL
