diff --git a/python/plugins/db_manager/db_manager.py b/python/plugins/db_manager/db_manager.py index 2d5e67658cb..12febad46de 100644 --- a/python/plugins/db_manager/db_manager.py +++ b/python/plugins/db_manager/db_manager.py @@ -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 ) diff --git a/python/plugins/db_manager/dlg_export_vector.py b/python/plugins/db_manager/dlg_export_vector.py new file mode 100644 index 00000000000..86400279e8e --- /dev/null +++ b/python/plugins/db_manager/dlg_export_vector.py @@ -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_()) diff --git a/python/plugins/db_manager/dlg_import_vector.py b/python/plugins/db_manager/dlg_import_vector.py index e2108c3ab86..a32adc6dbaf 100644 --- a/python/plugins/db_manager/dlg_import_vector.py +++ b/python/plugins/db_manager/dlg_import_vector.py @@ -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__': diff --git a/python/plugins/db_manager/resources.qrc b/python/plugins/db_manager/resources.qrc index a7e5c91c197..8b489cb1fba 100644 --- a/python/plugins/db_manager/resources.qrc +++ b/python/plugins/db_manager/resources.qrc @@ -21,8 +21,8 @@ icons/toolbar/action_del_table.png icons/toolbar/action_edit_table.png - icons/toolbar/action_export.png - icons/toolbar/action_import.png + icons/toolbar/action_export.png + icons/toolbar/action_import.png icons/toolbar/action_new_table.png icons/toolbar/action_refresh.png icons/toolbar/action_sql_window.png diff --git a/python/plugins/db_manager/ui/DlgExportVector.ui b/python/plugins/db_manager/ui/DlgExportVector.ui new file mode 100644 index 00000000000..b89cf8f6717 --- /dev/null +++ b/python/plugins/db_manager/ui/DlgExportVector.ui @@ -0,0 +1,300 @@ + + + DlgExportVector + + + + 0 + 0 + 514 + 304 + + + + Export to vector file + + + + + + + 0 + 0 + + + + Output file + + + + + + + + + + ... + + + + + + + Action + + + + + + Create new file + + + true + + + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Drop existing one + + + + + + + + + false + + + Append data into file + + + + + + + + + + Options + + + + + + + + Source SRID + + + + + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + + + + + + Target SRID + + + + + + + false + + + + + + + + + Encoding + + + + + + + false + + + + 0 + 0 + + + + false + + + QComboBox::NoInsert + + + + + + + + + + Qt::Horizontal + + + QDialogButtonBox::Cancel|QDialogButtonBox::Ok + + + + + + + radCreate + chkDropTable + radAppend + chkSourceSrid + editSourceSrid + chkEncoding + cboEncoding + buttonBox + + + + + buttonBox + rejected() + DlgExportVector + reject() + + + 325 + 518 + + + 286 + 274 + + + + + chkSourceSrid + toggled(bool) + editSourceSrid + setEnabled(bool) + + + 115 + 390 + + + 166 + 394 + + + + + chkTargetSrid + toggled(bool) + editTargetSrid + setEnabled(bool) + + + 360 + 396 + + + 435 + 394 + + + + + chkEncoding + toggled(bool) + cboEncoding + setEnabled(bool) + + + 98 + 415 + + + 201 + 414 + + + + + radCreate + toggled(bool) + chkDropTable + setEnabled(bool) + + + 131 + 216 + + + 140 + 245 + + + + + buttonBox + accepted() + DlgExportVector + accept() + + + 452 + 505 + + + 508 + 243 + + + + + diff --git a/python/plugins/db_manager/ui/DlgImportVector.ui b/python/plugins/db_manager/ui/DlgImportVector.ui index 54119c2892d..b1c7df7e780 100644 --- a/python/plugins/db_manager/ui/DlgImportVector.ui +++ b/python/plugins/db_manager/ui/DlgImportVector.ui @@ -7,40 +7,143 @@ 0 0 514 - 461 + 590 Import vector layer - + - - - - - Schema: - - - - - - - - - - Table: - - - - - - - true - - - - + + + + + + + 0 + 0 + + + + Input + + + + + + + ... + + + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + true + + + QComboBox::NoInsert + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + Update options + + + + + + + + + + + + Output table + + + + + + Schema + + + + + + + + 0 + 0 + + + + + + + + Table + + + + + + + + 0 + 0 + + + + true + + + QComboBox::NoInsert + + + + + cboTable + label_2 + cboSchema + label_3 + widget_3 + cboTable + label_2 + cboSchema + label_3 + @@ -107,56 +210,91 @@ - Primary key: + Primary key - + + + false + + - Geometry column: + Geometry column - + + + false + + - Source SRID: + Source SRID - + + + false + + + + + + + Qt::Horizontal + + + QSizePolicy::Fixed + + + + 40 + 20 + + + - Target SRID: + Target SRID - + + + false + + - Encoding: + Encoding + + false + true @@ -193,10 +331,14 @@ + groupBox + groupBox_2 + buttonBox + widget + groupBox_3 + wdgInput - cboSchema - cboTable radCreate chkDropTable radAppend @@ -217,8 +359,8 @@ reject() - 316 - 260 + 325 + 518 286 @@ -226,5 +368,117 @@ + + chkPrimaryKey + toggled(bool) + editPrimaryKey + setEnabled(bool) + + + 108 + 347 + + + 207 + 345 + + + + + chkGeomColumn + toggled(bool) + editGeomColumn + setEnabled(bool) + + + 120 + 367 + + + 188 + 367 + + + + + chkSourceSrid + toggled(bool) + editSourceSrid + setEnabled(bool) + + + 115 + 390 + + + 166 + 394 + + + + + chkTargetSrid + toggled(bool) + editTargetSrid + setEnabled(bool) + + + 360 + 396 + + + 435 + 394 + + + + + chkEncoding + toggled(bool) + cboEncoding + setEnabled(bool) + + + 98 + 415 + + + 201 + 414 + + + + + radCreate + toggled(bool) + chkDropTable + setEnabled(bool) + + + 131 + 216 + + + 140 + 245 + + + + + buttonBox + accepted() + DlgImportVector + accept() + + + 452 + 505 + + + 508 + 243 + + +