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

# Form implementation generated from reading ui file 'C:/src/qgis/python/plugins/db_manager/ui/DlgSqlWindow.ui'
#
# Created: Sat Apr 21 05:37:11 2018
#      by: PyQt4 UI code generator 4.10.2
#
# 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(679, 525)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Preferred, QtGui.QSizePolicy.Preferred)
        sizePolicy.setHorizontalStretch(0)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(DbManagerDlgSqlWindow.sizePolicy().hasHeightForWidth())
        DbManagerDlgSqlWindow.setSizePolicy(sizePolicy)
        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.getColumnsBtn = QtGui.QPushButton(self.loadAsLayerWidget)
        self.getColumnsBtn.setObjectName(_fromUtf8("getColumnsBtn"))
        self.gridLayout_3.addWidget(self.getColumnsBtn, 0, 3, 1, 1)
        spacerItem = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.gridLayout_3.addItem(spacerItem, 2, 1, 1, 1)
        self.btnSetFilter = QtGui.QPushButton(self.loadAsLayerWidget)
        self.btnSetFilter.setAutoDefault(False)
        self.btnSetFilter.setObjectName(_fromUtf8("btnSetFilter"))
        self.gridLayout_3.addWidget(self.btnSetFilter, 1, 3, 1, 1)
        self.loadLayerBtn = QtGui.QPushButton(self.loadAsLayerWidget)
        self.loadLayerBtn.setObjectName(_fromUtf8("loadLayerBtn"))
        self.gridLayout_3.addWidget(self.loadLayerBtn, 2, 3, 1, 1)
        self.avoidSelectById = QtGui.QCheckBox(self.loadAsLayerWidget)
        self.avoidSelectById.setObjectName(_fromUtf8("avoidSelectById"))
        self.gridLayout_3.addWidget(self.avoidSelectById, 2, 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)
        self.horizontalLayout_7.addWidget(self.layerTypeWidget)
        self.gridLayout_3.addLayout(self.horizontalLayout_7, 1, 0, 1, 2)
        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)
        self.gridLayout_3.addLayout(self.horizontalLayout_6, 0, 0, 1, 2)
        self.gridLayout.addWidget(self.loadAsLayerWidget, 0, 0, 1, 2)
        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.setMargin(0)
        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)
        spacerItem1 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.horizontalLayout.addItem(spacerItem1)
        self.label = QtGui.QLabel(self.layoutWidget)
        self.label.setObjectName(_fromUtf8("label"))
        self.horizontalLayout.addWidget(self.label)
        self.presetCombo = QtGui.QComboBox(self.layoutWidget)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.presetCombo.sizePolicy().hasHeightForWidth())
        self.presetCombo.setSizePolicy(sizePolicy)
        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)
        sizePolicy = QtGui.QSizePolicy(QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Fixed)
        sizePolicy.setHorizontalStretch(1)
        sizePolicy.setVerticalStretch(0)
        sizePolicy.setHeightForWidth(self.presetName.sizePolicy().hasHeightForWidth())
        self.presetName.setSizePolicy(sizePolicy)
        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)
        spacerItem2 = QtGui.QSpacerItem(40, 20, QtGui.QSizePolicy.Expanding, QtGui.QSizePolicy.Minimum)
        self.hboxlayout.addItem(spacerItem2)
        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.setMargin(0)
        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.queryBuilderBtn, self.presetCombo)
        DbManagerDlgSqlWindow.setTabOrder(self.presetCombo, self.presetName)
        DbManagerDlgSqlWindow.setTabOrder(self.presetName, self.presetStore)
        DbManagerDlgSqlWindow.setTabOrder(self.presetStore, self.presetDelete)
        DbManagerDlgSqlWindow.setTabOrder(self.presetDelete, self.editSql)
        DbManagerDlgSqlWindow.setTabOrder(self.editSql, self.btnExecute)
        DbManagerDlgSqlWindow.setTabOrder(self.btnExecute, self.btnCreateView)
        DbManagerDlgSqlWindow.setTabOrder(self.btnCreateView, self.btnClear)
        DbManagerDlgSqlWindow.setTabOrder(self.btnClear, self.viewResult)
        DbManagerDlgSqlWindow.setTabOrder(self.viewResult, self.loadAsLayerGroup)
        DbManagerDlgSqlWindow.setTabOrder(self.loadAsLayerGroup, self.uniqueColumnCheck)
        DbManagerDlgSqlWindow.setTabOrder(self.uniqueColumnCheck, self.uniqueCombo)
        DbManagerDlgSqlWindow.setTabOrder(self.uniqueCombo, self.hasGeometryCol)
        DbManagerDlgSqlWindow.setTabOrder(self.hasGeometryCol, self.geomCombo)
        DbManagerDlgSqlWindow.setTabOrder(self.geomCombo, self.getColumnsBtn)
        DbManagerDlgSqlWindow.setTabOrder(self.getColumnsBtn, self.layerNameEdit)
        DbManagerDlgSqlWindow.setTabOrder(self.layerNameEdit, self.vectorRadio)
        DbManagerDlgSqlWindow.setTabOrder(self.vectorRadio, self.rasterRadio)
        DbManagerDlgSqlWindow.setTabOrder(self.rasterRadio, self.btnSetFilter)
        DbManagerDlgSqlWindow.setTabOrder(self.btnSetFilter, self.avoidSelectById)
        DbManagerDlgSqlWindow.setTabOrder(self.avoidSelectById, self.loadLayerBtn)

    def retranslateUi(self, DbManagerDlgSqlWindow):
        DbManagerDlgSqlWindow.setWindowTitle(_translate("DbManagerDlgSqlWindow", "SQL window", None))
        self.loadAsLayerGroup.setTitle(_translate("DbManagerDlgSqlWindow", "Load as new layer", None))
        self.getColumnsBtn.setText(_translate("DbManagerDlgSqlWindow", "Retrieve \n"
"columns", None))
        self.btnSetFilter.setText(_translate("DbManagerDlgSqlWindow", "Set filter", None))
        self.loadLayerBtn.setText(_translate("DbManagerDlgSqlWindow", "Load now!", 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.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.uniqueColumnCheck.setText(_translate("DbManagerDlgSqlWindow", "Column(s) with \n"
"unique values", None))
        self.hasGeometryCol.setText(_translate("DbManagerDlgSqlWindow", "Geometry column", 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
