mirror of
https://github.com/qgis/QGIS.git
synced 2025-04-15 00:04:00 -04:00
[DBManager] Allow non-spatial layers
This commit is contained in:
parent
72eb1aae97
commit
00618fcabf
@ -179,9 +179,13 @@ class DlgSqlWindow(QDialog, Ui_Dialog):
|
||||
|
||||
def loadSqlLayer(self):
|
||||
uniqueFieldName = self.uniqueCombo.currentText()
|
||||
geomFieldName = self.geomCombo.currentText()
|
||||
hasGeomCol = self.hasGeometryCol.checkState() == Qt.Checked
|
||||
if hasGeomCol:
|
||||
geomFieldName = self.geomCombo.currentText()
|
||||
else:
|
||||
geomFieldName = None
|
||||
|
||||
if geomFieldName == "" or uniqueFieldName == "":
|
||||
if (hasGeomCol and geomFieldName == "") or uniqueFieldName == "":
|
||||
QMessageBox.warning(self, self.tr("DB Manager"), self.tr(
|
||||
"You must fill the required fields: \ngeometry column - column with unique integer values"))
|
||||
return
|
||||
|
@ -205,12 +205,15 @@ integer values</string>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QLabel" name="label_3">
|
||||
<widget class="QCheckBox" name="hasGeometryCol">
|
||||
<property name="text">
|
||||
<string>Geometry column</string>
|
||||
</property>
|
||||
<property name="indent">
|
||||
<number>40</number>
|
||||
<property name="checked">
|
||||
<bool>true</bool>
|
||||
</property>
|
||||
<property name="tristate">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
@ -384,5 +387,21 @@ columns</string>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
<connection>
|
||||
<sender>hasGeometryCol</sender>
|
||||
<signal>toggled(bool)</signal>
|
||||
<receiver>geomCombo</receiver>
|
||||
<slot>setEnabled(bool)</slot>
|
||||
<hints>
|
||||
<hint type="sourcelabel">
|
||||
<x>379</x>
|
||||
<y>385</y>
|
||||
</hint>
|
||||
<hint type="destinationlabel">
|
||||
<x>525</x>
|
||||
<y>385</y>
|
||||
</hint>
|
||||
</hints>
|
||||
</connection>
|
||||
</connections>
|
||||
</ui>
|
||||
|
Loading…
x
Reference in New Issue
Block a user