mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-14 00:07:35 -04:00
dbmanager: allow to import layer from canvas (fix #6824),
add dialog to choose vector file to be imported (fix #6825), allow to export table to vector file (fix #6826) Thanks to Silvio Grosso for the sponsorship!
This commit is contained in:
parent
fcf108db22
commit
de3ea74ab6
@ -144,6 +144,30 @@ class DBManager(QMainWindow):
|
||||
self.preview.setDirty()
|
||||
self.refreshItem()
|
||||
|
||||
def importActionSlot(self):
|
||||
db = self.tree.currentDatabase()
|
||||
if db is None:
|
||||
QMessageBox.information(self, "Sorry", "No database selected or you are not connected to it.")
|
||||
return
|
||||
|
||||
from .dlg_import_vector import DlgImportVector
|
||||
dlg = DlgImportVector(None, db, db.uri(), self)
|
||||
dlg.exec_()
|
||||
|
||||
def exportActionSlot(self):
|
||||
table = self.tree.currentTable()
|
||||
if table is None:
|
||||
QMessageBox.information(self, "Sorry", "Select the table you want export to file.")
|
||||
return
|
||||
|
||||
inLayer = table.toMapLayer()
|
||||
|
||||
from .dlg_export_vector import DlgExportVector
|
||||
dlg = DlgExportVector(inLayer, table.database(), self)
|
||||
dlg.exec_()
|
||||
|
||||
inLayer.deleteLater()
|
||||
|
||||
def runSqlWindow(self):
|
||||
db = self.tree.currentDatabase()
|
||||
if db == None:
|
||||
@ -289,7 +313,6 @@ class DBManager(QMainWindow):
|
||||
menuActions[i].setVisible(False)
|
||||
break
|
||||
|
||||
|
||||
action.deleteLater()
|
||||
return True
|
||||
|
||||
@ -365,13 +388,17 @@ class DBManager(QMainWindow):
|
||||
|
||||
# menu TABLE
|
||||
sep = self.menuTable.addSeparator(); sep.setObjectName("DB_Manager_TableMenu_placeholder"); sep.setVisible(False)
|
||||
self.actionImport = self.menuTable.addAction( QIcon(":/db_manager/actions/import"), "&Import layer/file", self.importActionSlot )
|
||||
self.actionExport = self.menuTable.addAction( QIcon(":/db_manager/actions/export"), "&Export to file", self.exportActionSlot )
|
||||
self.menuTable.addSeparator()
|
||||
#self.actionShowSystemTables = self.menuTable.addAction("Show system tables/views", self.showSystemTables)
|
||||
#self.actionShowSystemTables.setCheckable(True)
|
||||
#self.actionShowSystemTables.setChecked(True)
|
||||
actionMenuTable.setVisible(False)
|
||||
self.actionShowSystemTables = self.menuTable.addAction("Show system tables/views", self.showSystemTables)
|
||||
self.actionShowSystemTables.setCheckable(True)
|
||||
self.actionShowSystemTables.setChecked(True)
|
||||
self.actionShowSystemTables.setVisible(False)
|
||||
|
||||
# add actions to the toolbar
|
||||
self.toolBar.addAction( self.actionRefresh )
|
||||
self.toolBar.addAction( self.actionSqlWindow )
|
||||
self.toolBar.addAction( self.actionImport )
|
||||
self.toolBar.addAction( self.actionExport )
|
||||
|
||||
|
173
python/plugins/db_manager/dlg_export_vector.py
Normal file
173
python/plugins/db_manager/dlg_export_vector.py
Normal file
@ -0,0 +1,173 @@
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
"""
|
||||
/***************************************************************************
|
||||
Name : DB Manager
|
||||
Description : Database manager plugin for QuantumGIS
|
||||
Date : Oct 13, 2011
|
||||
copyright : (C) 2011 by Giuseppe Sucameli
|
||||
email : brush.tyler@gmail.com
|
||||
|
||||
The content of this file is based on
|
||||
- PG_Manager by Martin Dobias (GPLv2 license)
|
||||
***************************************************************************/
|
||||
|
||||
/***************************************************************************
|
||||
* *
|
||||
* This program is free software; you can redistribute it and/or modify *
|
||||
* it under the terms of the GNU General Public License as published by *
|
||||
* the Free Software Foundation; either version 2 of the License, or *
|
||||
* (at your option) any later version. *
|
||||
* *
|
||||
***************************************************************************/
|
||||
"""
|
||||
|
||||
from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
|
||||
import qgis.core
|
||||
from qgis.utils import iface
|
||||
|
||||
from .ui.ui_DlgExportVector import Ui_DlgExportVector
|
||||
|
||||
class DlgExportVector(QDialog, Ui_DlgExportVector):
|
||||
|
||||
def __init__(self, inLayer, inDb, parent=None):
|
||||
QDialog.__init__(self, parent)
|
||||
self.inLayer = inLayer
|
||||
self.db = inDb
|
||||
self.setupUi(self)
|
||||
|
||||
# update UI
|
||||
self.setupWorkingMode()
|
||||
self.populateEncodings()
|
||||
|
||||
def setupWorkingMode(self):
|
||||
# set default values
|
||||
inCrs = self.inLayer.crs()
|
||||
srid = inCrs.postgisSrid() if inCrs.isValid() else 4236
|
||||
self.editSourceSrid.setText( "%s" % srid )
|
||||
self.editTargetSrid.setText( "%s" % srid )
|
||||
|
||||
QObject.connect( self.btnChooseOutputFile, SIGNAL("clicked()"), self.chooseOutputFile )
|
||||
self.checkSupports()
|
||||
|
||||
def checkSupports(self):
|
||||
""" update options available for the current input layer """
|
||||
allowSpatial = self.db.connector.hasSpatialSupport()
|
||||
hasGeomType = self.inLayer and self.inLayer.hasGeometryType()
|
||||
self.chkSourceSrid.setEnabled(allowSpatial and hasGeomType)
|
||||
self.chkTargetSrid.setEnabled(allowSpatial and hasGeomType)
|
||||
self.chkSpatialIndex.setEnabled(allowSpatial and hasGeomType)
|
||||
|
||||
|
||||
def chooseOutputFile(self):
|
||||
# get last used dir and format
|
||||
settings = QSettings()
|
||||
lastDir = settings.value("/db_manager/lastUsedDir", "").toString()
|
||||
# ask for a filename
|
||||
filename = QFileDialog.getSaveFileName(self, "Choose where to save the file", lastDir, "Shapefiles (*.shp)")
|
||||
if filename == "":
|
||||
return
|
||||
if filename[:-4] != ".shp":
|
||||
filename += ".shp"
|
||||
# store the last used dir and format
|
||||
settings.setValue("/db_manager/lastUsedDir", QFileInfo(filename).filePath())
|
||||
|
||||
self.editOutputFile.setText( filename )
|
||||
|
||||
def populateEncodings(self):
|
||||
# populate the combo with supported encodings
|
||||
self.cboEncoding.addItems(qgis.core.QgsVectorDataProvider.availableEncodings())
|
||||
|
||||
# set the last used encoding
|
||||
settings = QSettings()
|
||||
enc = self.inLayer.dataProvider().encoding()
|
||||
idx = self.cboEncoding.findText( enc )
|
||||
if idx < 0:
|
||||
self.cboEncoding.insertItem( 0, enc )
|
||||
idx = 0
|
||||
self.cboEncoding.setCurrentIndex( idx )
|
||||
|
||||
def accept(self):
|
||||
# sanity checks
|
||||
if self.editOutputFile.text() == "":
|
||||
QMessageBox.information(self, "Export to file", "Output table name is required")
|
||||
return
|
||||
|
||||
if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
|
||||
sourceSrid, ok = self.editSourceSrid.text().toInt()
|
||||
if not ok:
|
||||
QMessageBox.information(self, "Export to file", "Invalid source srid: must be an integer")
|
||||
return
|
||||
|
||||
if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
|
||||
targetSrid, ok = self.editTargetSrid.text().toInt()
|
||||
if not ok:
|
||||
QMessageBox.information(self, "Export to file", "Invalid target srid: must be an integer")
|
||||
return
|
||||
|
||||
# override cursor
|
||||
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
|
||||
# store current input layer crs, so I can restore it later
|
||||
prevInCrs = self.inLayer.crs()
|
||||
try:
|
||||
uri = self.editOutputFile.text()
|
||||
providerName = "ogr"
|
||||
driverName = "ESRI Shapefile"
|
||||
|
||||
options = {}
|
||||
|
||||
# set the OGR driver will be used
|
||||
options['driverName'] = driverName
|
||||
# set the output file encoding
|
||||
if self.chkEncoding.isEnabled() and self.chkEncoding.isChecked():
|
||||
enc = self.cboEncoding.currentText()
|
||||
options['fileEncoding'] = enc
|
||||
|
||||
if self.radCreate.isChecked() and self.chkDropTable.isChecked():
|
||||
options['overwrite'] = True
|
||||
elif self.radAppend.isChecked():
|
||||
options['append'] = True
|
||||
|
||||
outCrs = None
|
||||
if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
|
||||
targetSrid = self.editTargetSrid.text().toInt()[0]
|
||||
outCrs = qgis.core.QgsCoordinateReferenceSystem(targetSrid)
|
||||
|
||||
# update input layer crs
|
||||
if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
|
||||
sourceSrid = self.editSourceSrid.text().toInt()[0]
|
||||
inCrs = qgis.core.QgsCoordinateReferenceSystem(sourceSrid)
|
||||
self.inLayer.setCrs( inCrs )
|
||||
|
||||
# do the export!
|
||||
ret, errMsg = qgis.core.QgsVectorLayerImport.importLayer( self.inLayer, uri, providerName, outCrs, False, False, options )
|
||||
except Exception as e:
|
||||
ret = -1
|
||||
errMsg = unicode( e )
|
||||
|
||||
finally:
|
||||
# restore input layer crs and encoding
|
||||
self.inLayer.setCrs( prevInCrs )
|
||||
# restore cursor
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
||||
if ret != 0:
|
||||
QMessageBox.warning(self, "Export to file", u"Error %d\n%s" % (ret, errMsg) )
|
||||
return
|
||||
|
||||
# create spatial index
|
||||
if self.chkSpatialIndex.isEnabled() and self.chkSpatialIndex.isChecked():
|
||||
self.db.connector.createSpatialIndex( (schema, table), geom )
|
||||
|
||||
QMessageBox.information(self, "Export to file", "Export finished.")
|
||||
return QDialog.accept(self)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
import sys
|
||||
a = QApplication(sys.argv)
|
||||
dlg = DlgLoadData()
|
||||
dlg.show()
|
||||
sys.exit(a.exec_())
|
@ -26,14 +26,14 @@ from PyQt4.QtCore import *
|
||||
from PyQt4.QtGui import *
|
||||
|
||||
import qgis.core
|
||||
|
||||
from .db_plugins.plugin import DbError
|
||||
from .dlg_db_error import DlgDbError
|
||||
from qgis.utils import iface
|
||||
|
||||
from .ui.ui_DlgImportVector import Ui_DlgImportVector
|
||||
|
||||
class DlgImportVector(QDialog, Ui_DlgImportVector):
|
||||
|
||||
HAS_INPUT_MODE, ASK_FOR_INPUT_MODE = range(2)
|
||||
|
||||
def __init__(self, inLayer, outDb, outUri, parent=None):
|
||||
QDialog.__init__(self, parent)
|
||||
self.inLayer = inLayer
|
||||
@ -45,45 +45,129 @@ class DlgImportVector(QDialog, Ui_DlgImportVector):
|
||||
self.default_geom = "geom"
|
||||
|
||||
# updates of UI
|
||||
for widget in [self.radCreate, self.chkDropTable, self.radAppend,
|
||||
self.chkPrimaryKey, self.chkGeomColumn, self.chkSpatialIndex,
|
||||
self.chkSourceSrid, self.chkTargetSrid, self.chkEncoding]:
|
||||
self.connect(widget, SIGNAL("clicked()"), self.updateUi)
|
||||
self.setupWorkingMode()
|
||||
|
||||
self.cboTable.setEditText(self.outUri.table())
|
||||
|
||||
self.populateLayers()
|
||||
|
||||
self.connect(self.cboSchema, SIGNAL("currentIndexChanged(int)"), self.populateTables)
|
||||
self.connect(self.buttonBox, SIGNAL("accepted()"), self.importLayer)
|
||||
|
||||
self.populateSchemas()
|
||||
self.populateTables()
|
||||
|
||||
self.populateEncodings()
|
||||
self.updateUi()
|
||||
|
||||
# set default values
|
||||
self.cboTable.setEditText(self.outUri.table())
|
||||
|
||||
pk = self.outUri.keyColumn()
|
||||
self.editPrimaryKey.setText(pk if pk != "" else self.default_pk)
|
||||
if self.inLayer.hasGeometryType():
|
||||
geom = self.outUri.geometryColumn()
|
||||
self.editGeomColumn.setText(geom if geom != "" else self.default_geom)
|
||||
def setupWorkingMode(self):
|
||||
""" display the widget to select a layer/file if there's no input layer """
|
||||
self.mode = self.ASK_FOR_INPUT_MODE if self.inLayer is None else self.HAS_INPUT_MODE
|
||||
self.wdgInput.setVisible( self.mode == self.ASK_FOR_INPUT_MODE )
|
||||
|
||||
inCrs = self.inLayer.crs()
|
||||
srid = inCrs.postgisSrid() if inCrs.isValid() else 4236
|
||||
self.editSourceSrid.setText( "%s" % srid )
|
||||
self.editTargetSrid.setText( "%s" % srid )
|
||||
if not self.inLayer:
|
||||
QObject.connect( self.btnChooseInputFile, SIGNAL("clicked()"), self.chooseInputFile )
|
||||
#QObject.connect( self.cboInputLayer.lineEdit(), SIGNAL("editingFinished()"), self.updateInputLayer )
|
||||
QObject.connect( self.cboInputLayer, SIGNAL("editTextChanged(const QString &)"), self.inputPathChanged )
|
||||
#QObject.connect( self.cboInputLayer, SIGNAL("currentIndexChanged(int)"), self.updateInputLayer )
|
||||
QObject.connect( self.btnUpdateInputLayer, SIGNAL("clicked()"), self.updateInputLayer )
|
||||
else:
|
||||
# set default values
|
||||
pk = self.outUri.keyColumn()
|
||||
self.editPrimaryKey.setText(pk if pk != "" else self.default_pk)
|
||||
if self.inLayer.hasGeometryType():
|
||||
geom = self.outUri.geometryColumn()
|
||||
self.editGeomColumn.setText(geom if geom != "" else self.default_geom)
|
||||
|
||||
self.checkSupports()
|
||||
inCrs = self.inLayer.crs()
|
||||
srid = inCrs.postgisSrid() if inCrs.isValid() else 4236
|
||||
self.editSourceSrid.setText( "%s" % srid )
|
||||
self.editTargetSrid.setText( "%s" % srid )
|
||||
|
||||
self.checkSupports()
|
||||
|
||||
def checkSupports(self):
|
||||
""" update options available for the current input layer """
|
||||
allowSpatial = self.db.connector.hasSpatialSupport()
|
||||
hasGeomType = self.inLayer.hasGeometryType()
|
||||
hasGeomType = self.inLayer and self.inLayer.hasGeometryType()
|
||||
self.chkGeomColumn.setEnabled(allowSpatial and hasGeomType)
|
||||
self.chkSourceSrid.setEnabled(allowSpatial and hasGeomType)
|
||||
self.chkTargetSrid.setEnabled(allowSpatial and hasGeomType)
|
||||
#self.chkSinglePart.setEnabled(allowSpatial and hasGeomType)
|
||||
self.chkSpatialIndex.setEnabled(allowSpatial and hasGeomType)
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
def populateLayers(self):
|
||||
self.cboInputLayer.clear()
|
||||
for index, layer in enumerate( iface.legendInterface().layers() ):
|
||||
# TODO: add import raster support!
|
||||
if layer.type() == qgis.core.QgsMapLayer.VectorLayer:
|
||||
self.cboInputLayer.addItem( layer.name(), index )
|
||||
|
||||
def deleteInputLayer(self):
|
||||
""" destroy the input layer instance, but only if it was
|
||||
created from this dialog """
|
||||
if self.mode == self.ASK_FOR_INPUT_MODE and self.inLayer:
|
||||
self.inLayer.deleteLater()
|
||||
self.inLayer = None
|
||||
return True
|
||||
return False
|
||||
|
||||
def chooseInputFile(self):
|
||||
vectorFormats = qgis.core.QgsVectorFileWriter.fileFilterString()
|
||||
# get last used dir and format
|
||||
settings = QSettings()
|
||||
lastDir = settings.value("/db_manager/lastUsedDir", "").toString()
|
||||
lastVectorFormat = settings.value("/UI/lastVectorFileFilter", "").toString()
|
||||
# ask for a filename
|
||||
filename = QFileDialog.getOpenFileName(self, "Choose the file to import", lastDir, vectorFormats, lastVectorFormat)
|
||||
if filename == "":
|
||||
return
|
||||
# store the last used dir and format
|
||||
settings.setValue("/db_manager/lastUsedDir", QFileInfo(filename).filePath())
|
||||
#settings.setValue("/UI/lastVectorFileFilter", lastVectorFormat)
|
||||
|
||||
self.cboInputLayer.setEditText( filename )
|
||||
|
||||
def inputPathChanged(self, path):
|
||||
if self.cboInputLayer.currentIndex() < 0:
|
||||
return
|
||||
self.cboInputLayer.blockSignals(True)
|
||||
self.cboInputLayer.setCurrentIndex( -1 )
|
||||
self.cboInputLayer.setEditText( path )
|
||||
self.cboInputLayer.blockSignals(False)
|
||||
|
||||
def updateInputLayer(self):
|
||||
""" create the input layer and update available options """
|
||||
if self.mode != self.ASK_FOR_INPUT_MODE:
|
||||
return
|
||||
|
||||
self.deleteInputLayer()
|
||||
|
||||
index = self.cboInputLayer.currentIndex()
|
||||
if index < 0:
|
||||
filename = self.cboInputLayer.currentText()
|
||||
if filename == "":
|
||||
return False
|
||||
|
||||
layerName = QFileInfo(filename).completeBaseName()
|
||||
layer = qgis.core.QgsVectorLayer(filename, layerName, "ogr")
|
||||
if not layer.isValid() or layer.type() != qgis.core.QgsMapLayer.VectorLayer:
|
||||
layer.deleteLater()
|
||||
return False
|
||||
|
||||
self.inLayer = layer
|
||||
|
||||
else:
|
||||
legendIndex = self.cboInputLayer.itemData( index ).toInt()[0]
|
||||
self.inLayer = iface.legendInterface().layers()[ legendIndex ]
|
||||
|
||||
# update the output table name
|
||||
self.cboTable.setEditText(self.inLayer.name())
|
||||
|
||||
self.checkSupports()
|
||||
return True
|
||||
|
||||
|
||||
def populateSchemas(self):
|
||||
if not self.db:
|
||||
return
|
||||
@ -129,95 +213,108 @@ class DlgImportVector(QDialog, Ui_DlgImportVector):
|
||||
for enc in encodings:
|
||||
self.cboEncoding.addItem(enc)
|
||||
self.cboEncoding.setCurrentIndex(2)
|
||||
|
||||
def updateUi(self):
|
||||
allowDropTable = self.radCreate.isChecked()
|
||||
self.chkDropTable.setEnabled(allowDropTable)
|
||||
|
||||
allowSetPrimaryKey = self.chkPrimaryKey.isChecked()
|
||||
self.editPrimaryKey.setEnabled(allowSetPrimaryKey)
|
||||
|
||||
allowSetGeomColumn = self.chkGeomColumn.isChecked()
|
||||
self.editGeomColumn.setEnabled(allowSetGeomColumn)
|
||||
|
||||
allowSetSourceSrid = self.chkSourceSrid.isChecked()
|
||||
self.editSourceSrid.setEnabled(allowSetSourceSrid)
|
||||
|
||||
allowSetTargetSrid = self.chkTargetSrid.isChecked()
|
||||
self.editTargetSrid.setEnabled(allowSetTargetSrid)
|
||||
|
||||
allowSetEncoding = self.chkEncoding.isChecked()
|
||||
self.cboEncoding.setEnabled(allowSetEncoding)
|
||||
|
||||
|
||||
def importLayer(self):
|
||||
def accept(self):
|
||||
# sanity checks
|
||||
if self.cboTable.currentText().isEmpty():
|
||||
QMessageBox.information(self, "Import to database", "Table name is required")
|
||||
if self.inLayer is None:
|
||||
# create the input layer and update available options
|
||||
if not self.updateInputLayer():
|
||||
QMessageBox.information(self, "Import to database", "Input layer missing or not valid")
|
||||
return
|
||||
|
||||
if self.cboTable.currentText() == "":
|
||||
QMessageBox.information(self, "Import to database", "Output table name is required")
|
||||
return
|
||||
|
||||
if self.chkSourceSrid.isChecked():
|
||||
if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
|
||||
sourceSrid, ok = self.editSourceSrid.text().toInt()
|
||||
if not ok:
|
||||
QMessageBox.information(self, "Import to database", "Invalid source srid: must be an integer")
|
||||
return
|
||||
|
||||
if self.chkTargetSrid.isChecked():
|
||||
if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
|
||||
targetSrid, ok = self.editTargetSrid.text().toInt()
|
||||
if not ok:
|
||||
QMessageBox.information(self, "Import to database", "Invalid target srid: must be an integer")
|
||||
return
|
||||
|
||||
# override cursor
|
||||
QApplication.setOverrideCursor(QCursor(Qt.WaitCursor))
|
||||
# store current input layer crs and encoding, so I can restore it
|
||||
prevInCrs = self.inLayer.crs()
|
||||
prevInEncoding = self.inLayer.dataProvider().encoding()
|
||||
|
||||
schema = self.outUri.schema() if not self.cboSchema.isEnabled() else self.cboSchema.currentText()
|
||||
table = self.cboTable.currentText()
|
||||
try:
|
||||
schema = self.outUri.schema() if not self.cboSchema.isEnabled() else self.cboSchema.currentText()
|
||||
table = self.cboTable.currentText()
|
||||
|
||||
# get pk and geom field names from the source layer or use the
|
||||
# ones defined by the user
|
||||
pk = self.outUri.keyColumn() if not self.chkPrimaryKey.isChecked() else self.editPrimaryKey.text()
|
||||
if self.inLayer.hasGeometryType():
|
||||
geom = self.outUri.geometryColumn() if not self.chkGeomColumn.isChecked() else self.editGeomColumn.text()
|
||||
geom = geom if geom != "" else self.default_geom
|
||||
else:
|
||||
geom = QString()
|
||||
|
||||
self.outUri.setDataSource( schema, table, geom, QString(), pk )
|
||||
uri = self.outUri.uri()
|
||||
# get pk and geom field names from the source layer or use the
|
||||
# ones defined by the user
|
||||
pk = self.outUri.keyColumn() if not self.chkPrimaryKey.isChecked() else self.editPrimaryKey.text()
|
||||
|
||||
providerName = self.db.dbplugin().providerName()
|
||||
if self.inLayer.hasGeometryType() and self.chkGeomColumn.isEnabled():
|
||||
geom = self.outUri.geometryColumn() if not self.chkGeomColumn.isChecked() else self.editGeomColumn.text()
|
||||
geom = geom if geom != "" else self.default_geom
|
||||
else:
|
||||
geom = QString()
|
||||
|
||||
if self.chkSourceSrid.isChecked():
|
||||
sourceSrid = self.editSourceSrid.text().toInt()[0]
|
||||
inCrs = qgis.core.QgsCoordinateReferenceSystem(sourceSrid)
|
||||
self.inLayer.setCrs( inCrs )
|
||||
# get output params, update output URI
|
||||
self.outUri.setDataSource( schema, table, geom, QString(), pk )
|
||||
uri = self.outUri.uri()
|
||||
|
||||
outCrs = None
|
||||
if self.chkTargetSrid.isChecked():
|
||||
targetSrid = self.editTargetSrid.text().toInt()[0]
|
||||
outCrs = qgis.core.QgsCoordinateReferenceSystem(targetSrid)
|
||||
providerName = self.db.dbplugin().providerName()
|
||||
|
||||
if self.chkEncoding.isChecked():
|
||||
enc = self.cboEncoding.currentText()
|
||||
self.inLayer.setProviderEncoding( enc )
|
||||
options = {}
|
||||
if self.radCreate.isChecked() and self.chkDropTable.isChecked():
|
||||
options['overwrite'] = True
|
||||
elif self.radAppend.isChecked():
|
||||
options['append'] = True
|
||||
|
||||
options = {}
|
||||
if self.radCreate.isChecked() and self.chkDropTable.isChecked():
|
||||
options['overwrite'] = True
|
||||
elif self.radAppend.isChecked():
|
||||
options['append'] = True
|
||||
outCrs = None
|
||||
if self.chkTargetSrid.isEnabled() and self.chkTargetSrid.isChecked():
|
||||
targetSrid = self.editTargetSrid.text().toInt()[0]
|
||||
outCrs = qgis.core.QgsCoordinateReferenceSystem(targetSrid)
|
||||
|
||||
# update input layer crs and encoding
|
||||
if self.chkSourceSrid.isEnabled() and self.chkSourceSrid.isChecked():
|
||||
sourceSrid = self.editSourceSrid.text().toInt()[0]
|
||||
inCrs = qgis.core.QgsCoordinateReferenceSystem(sourceSrid)
|
||||
self.inLayer.setCrs( inCrs )
|
||||
|
||||
if self.chkEncoding.isEnabled() and self.chkEncoding.isChecked():
|
||||
enc = self.cboEncoding.currentText()
|
||||
self.inLayer.setProviderEncoding( enc )
|
||||
|
||||
# do the import!
|
||||
ret, errMsg = qgis.core.QgsVectorLayerImport.importLayer( self.inLayer, uri, providerName, outCrs, False, False, options )
|
||||
except Exception as e:
|
||||
ret = -1
|
||||
errMsg = unicode( e )
|
||||
|
||||
finally:
|
||||
# restore input layer crs and encoding
|
||||
self.inLayer.setCrs( prevInCrs )
|
||||
self.inLayer.setProviderEncoding( prevInEncoding )
|
||||
# restore cursor
|
||||
QApplication.restoreOverrideCursor()
|
||||
|
||||
ret, errMsg = qgis.core.QgsVectorLayerImport.importLayer( self.inLayer, uri, providerName, outCrs, False, False, options )
|
||||
QApplication.restoreOverrideCursor()
|
||||
if ret != 0:
|
||||
QMessageBox.warning(self, "Import to database", u"Error %d\n%s" % (ret, errMsg) )
|
||||
return
|
||||
|
||||
if self.chkSpatialIndex.isChecked():
|
||||
# create spatial index
|
||||
if self.chkSpatialIndex.isEnabled() and self.chkSpatialIndex.isChecked():
|
||||
self.db.connector.createSpatialIndex( (schema, table), geom )
|
||||
|
||||
QMessageBox.information(self, "Import to database", "Import was successful.")
|
||||
return self.accept()
|
||||
return QDialog.accept(self)
|
||||
|
||||
|
||||
def closeEvent(self, event):
|
||||
# destroy the input layer instance but only if it was created
|
||||
# from this dialog!
|
||||
self.deleteInputLayer()
|
||||
QDialog.closeEvent(self, event)
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
|
@ -21,8 +21,8 @@
|
||||
<qresource prefix="/db_manager/actions">
|
||||
<file alias="del_table">icons/toolbar/action_del_table.png</file>
|
||||
<file alias="edit_table">icons/toolbar/action_edit_table.png</file>
|
||||
<file>icons/toolbar/action_export.png</file>
|
||||
<file>icons/toolbar/action_import.png</file>
|
||||
<file alias="export">icons/toolbar/action_export.png</file>
|
||||
<file alias="import">icons/toolbar/action_import.png</file>
|
||||
<file alias="create_table">icons/toolbar/action_new_table.png</file>
|
||||
<file alias="refresh">icons/toolbar/action_refresh.png</file>
|
||||
<file alias="sql_window">icons/toolbar/action_sql_window.png</file>
|
||||
|
300
python/plugins/db_manager/ui/DlgExportVector.ui
Normal file
300
python/plugins/db_manager/ui/DlgExportVector.ui
Normal file
@ -0,0 +1,300 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DlgExportVector</class>
|
||||
<widget class="QDialog" name="DlgExportVector">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>514</width>
|
||||
<height>304</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Export to vector file</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Output file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="editOutputFile"/>
|
||||
</item>
|
||||
<item row="0" column="2">
|
||||
<widget class="QToolButton" name="btnChooseOutputFile">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>Action</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radCreate">
|
||||
<property name="text">
|
||||
<string>Create new file</string>
|
||||
</property>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<layout class="QHBoxLayout">
|
||||
<item>
|
||||
<spacer>
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkDropTable">
|
||||
<property name="text">
|
||||
<string>Drop existing one</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QRadioButton" name="radAppend">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Append data into file</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="3">
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Options</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout">
|
||||
<item row="0" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkSourceSrid">
|
||||
<property name="text">
|
||||
<string>Source SRID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editSourceSrid">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkTargetSrid">
|
||||
<property name="text">
|
||||
<string>Target SRID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editTargetSrid">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="chkEncoding">
|
||||
<property name="text">
|
||||
<string>Encoding</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="cboEncoding">
|
||||
<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>false</bool>
|
||||
</property>
|
||||
<property name="insertPolicy">
|
||||
<enum>QComboBox::NoInsert</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="0" colspan="2">
|
||||
<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>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>radCreate</tabstop>
|
||||
<tabstop>chkDropTable</tabstop>
|
||||
<tabstop>radAppend</tabstop>
|
||||
<tabstop>chkSourceSrid</tabstop>
|
||||
<tabstop>editSourceSrid</tabstop>
|
||||
<tabstop>chkEncoding</tabstop>
|
||||
<tabstop>cboEncoding</tabstop>
|
||||
<tabstop>buttonBox</tabstop>
|
||||
</tabstops>
|
||||
<resources/>
|
||||
<connections>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>rejected()</signal>
|
||||
<receiver>DlgExportVector</receiver>
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>325</x>
|
||||
<y>518</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
<y>274</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>chkSourceSrid</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>editSourceSrid</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>115</x>
|
||||
<y>390</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>166</x>
|
||||
<y>394</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>chkTargetSrid</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>editTargetSrid</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>360</x>
|
||||
<y>396</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>435</x>
|
||||
<y>394</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>chkEncoding</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>cboEncoding</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>98</x>
|
||||
<y>415</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>201</x>
|
||||
<y>414</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>radCreate</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>chkDropTable</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>131</x>
|
||||
<y>216</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>140</x>
|
||||
<y>245</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DlgExportVector</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>452</x>
|
||||
<y>505</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>508</x>
|
||||
<y>243</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
@ -7,40 +7,143 @@
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>514</width>
|
||||
<height>461</height>
|
||||
<height>590</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Import vector layer</string>
|
||||
</property>
|
||||
<layout class="QVBoxLayout">
|
||||
<layout class="QVBoxLayout" name="verticalLayout">
|
||||
<item>
|
||||
<layout class="QGridLayout">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Schema:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="cboSchema"/>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Table:</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="cboTable">
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<widget class="QWidget" name="wdgInput" native="true">
|
||||
<layout class="QGridLayout" name="gridLayout_3">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_5">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Fixed" vsizetype="Preferred">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
<property name="text">
|
||||
<string>Input</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="3">
|
||||
<widget class="QToolButton" name="btnChooseInputFile">
|
||||
<property name="text">
|
||||
<string>...</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="4">
|
||||
<widget class="Line" name="line">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1" colspan="2">
|
||||
<widget class="QComboBox" name="cboInputLayer">
|
||||
<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 row="1" column="0" colspan="4">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<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="QPushButton" name="btnUpdateInputLayer">
|
||||
<property name="text">
|
||||
<string>Update options</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_3">
|
||||
<property name="title">
|
||||
<string>Output table</string>
|
||||
</property>
|
||||
<layout class="QGridLayout" name="gridLayout_2">
|
||||
<item row="0" column="0">
|
||||
<widget class="QLabel" name="label_2">
|
||||
<property name="text">
|
||||
<string>Schema</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QComboBox" name="cboSchema">
|
||||
<property name="sizePolicy">
|
||||
<sizepolicy hsizetype="Expanding" vsizetype="Fixed">
|
||||
<horstretch>0</horstretch>
|
||||
<verstretch>0</verstretch>
|
||||
</sizepolicy>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QLabel" name="label_3">
|
||||
<property name="text">
|
||||
<string>Table</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QComboBox" name="cboTable">
|
||||
<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>
|
||||
<zorder>cboTable</zorder>
|
||||
<zorder>label_2</zorder>
|
||||
<zorder>cboSchema</zorder>
|
||||
<zorder>label_3</zorder>
|
||||
<zorder>widget_3</zorder>
|
||||
<zorder>cboTable</zorder>
|
||||
<zorder>label_2</zorder>
|
||||
<zorder>cboSchema</zorder>
|
||||
<zorder>label_3</zorder>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
@ -107,56 +210,91 @@
|
||||
<item row="0" column="0">
|
||||
<widget class="QCheckBox" name="chkPrimaryKey">
|
||||
<property name="text">
|
||||
<string>Primary key:</string>
|
||||
<string>Primary key</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="0" column="1">
|
||||
<widget class="QLineEdit" name="editPrimaryKey"/>
|
||||
<widget class="QLineEdit" name="editPrimaryKey">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="0">
|
||||
<widget class="QCheckBox" name="chkGeomColumn">
|
||||
<property name="text">
|
||||
<string>Geometry column:</string>
|
||||
<string>Geometry column</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="1" column="1">
|
||||
<widget class="QLineEdit" name="editGeomColumn"/>
|
||||
<widget class="QLineEdit" name="editGeomColumn">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="2" column="0" colspan="2">
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkSourceSrid">
|
||||
<property name="text">
|
||||
<string>Source SRID:</string>
|
||||
<string>Source SRID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editSourceSrid"/>
|
||||
<widget class="QLineEdit" name="editSourceSrid">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<spacer name="spacer">
|
||||
<property name="orientation">
|
||||
<enum>Qt::Horizontal</enum>
|
||||
</property>
|
||||
<property name="sizeType">
|
||||
<enum>QSizePolicy::Fixed</enum>
|
||||
</property>
|
||||
<property name="sizeHint" stdset="0">
|
||||
<size>
|
||||
<width>40</width>
|
||||
<height>20</height>
|
||||
</size>
|
||||
</property>
|
||||
</spacer>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QCheckBox" name="chkTargetSrid">
|
||||
<property name="text">
|
||||
<string>Target SRID:</string>
|
||||
<string>Target SRID</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLineEdit" name="editTargetSrid"/>
|
||||
<widget class="QLineEdit" name="editTargetSrid">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</item>
|
||||
<item row="3" column="0">
|
||||
<widget class="QCheckBox" name="chkEncoding">
|
||||
<property name="text">
|
||||
<string>Encoding:</string>
|
||||
<string>Encoding</string>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
<item row="3" column="1">
|
||||
<widget class="QComboBox" name="cboEncoding">
|
||||
<property name="enabled">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
<property name="editable">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
@ -193,10 +331,14 @@
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
<zorder>groupBox</zorder>
|
||||
<zorder>groupBox_2</zorder>
|
||||
<zorder>buttonBox</zorder>
|
||||
<zorder>widget</zorder>
|
||||
<zorder>groupBox_3</zorder>
|
||||
<zorder>wdgInput</zorder>
|
||||
</widget>
|
||||
<tabstops>
|
||||
<tabstop>cboSchema</tabstop>
|
||||
<tabstop>cboTable</tabstop>
|
||||
<tabstop>radCreate</tabstop>
|
||||
<tabstop>chkDropTable</tabstop>
|
||||
<tabstop>radAppend</tabstop>
|
||||
@ -217,8 +359,8 @@
|
||||
<slot>reject()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>316</x>
|
||||
<y>260</y>
|
||||
<x>325</x>
|
||||
<y>518</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>286</x>
|
||||
@ -226,5 +368,117 @@
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>chkPrimaryKey</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>editPrimaryKey</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>108</x>
|
||||
<y>347</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>207</x>
|
||||
<y>345</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>chkGeomColumn</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>editGeomColumn</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>120</x>
|
||||
<y>367</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>188</x>
|
||||
<y>367</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>chkSourceSrid</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>editSourceSrid</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>115</x>
|
||||
<y>390</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>166</x>
|
||||
<y>394</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>chkTargetSrid</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>editTargetSrid</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>360</x>
|
||||
<y>396</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>435</x>
|
||||
<y>394</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>chkEncoding</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>cboEncoding</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>98</x>
|
||||
<y>415</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>201</x>
|
||||
<y>414</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>radCreate</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>chkDropTable</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>131</x>
|
||||
<y>216</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>140</x>
|
||||
<y>245</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>buttonBox</sender>
|
||||
<signal>accepted()</signal>
|
||||
<receiver>DlgImportVector</receiver>
|
||||
<slot>accept()</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>452</x>
|
||||
<y>505</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>508</x>
|
||||
<y>243</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
Loading…
x
Reference in New Issue
Block a user