Skip to content
Permalink
Browse files

[DBManager] Allow non-spatial layers

  • Loading branch information
Hugo Mercier
Hugo Mercier committed May 4, 2015
1 parent 72eb1aa commit 00618fcabf53007953853e463ec5364694a8f54d
Showing with 28 additions and 5 deletions.
  1. +6 −2 python/plugins/db_manager/dlg_sql_window.py
  2. +22 −3 python/plugins/db_manager/ui/DlgSqlWindow.ui
@@ -179,9 +179,13 @@ def executeSql(self):

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>

0 comments on commit 00618fc

Please sign in to comment.
You can’t perform that action at this time.