File tree Expand file tree Collapse file tree
python/plugins/db_manager Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -179,9 +179,13 @@ def executeSql(self):
179179
180180 def loadSqlLayer (self ):
181181 uniqueFieldName = self .uniqueCombo .currentText ()
182- geomFieldName = self .geomCombo .currentText ()
182+ hasGeomCol = self .hasGeometryCol .checkState () == Qt .Checked
183+ if hasGeomCol :
184+ geomFieldName = self .geomCombo .currentText ()
185+ else :
186+ geomFieldName = None
183187
184- if geomFieldName == "" or uniqueFieldName == "" :
188+ if ( hasGeomCol and geomFieldName == "" ) or uniqueFieldName == "" :
185189 QMessageBox .warning (self , self .tr ("DB Manager" ), self .tr (
186190 "You must fill the required fields: \n geometry column - column with unique integer values" ))
187191 return
Original file line number Diff line number Diff line change @@ -205,12 +205,15 @@ integer values</string>
205205 </widget >
206206 </item >
207207 <item >
208- <widget class =" QLabel " name =" label_3 " >
208+ <widget class =" QCheckBox " name =" hasGeometryCol " >
209209 <property name =" text" >
210210 <string >Geometry column</string >
211211 </property >
212- <property name =" indent" >
213- <number >40</number >
212+ <property name =" checked" >
213+ <bool >true</bool >
214+ </property >
215+ <property name =" tristate" >
216+ <bool >false</bool >
214217 </property >
215218 </widget >
216219 </item >
@@ -384,5 +387,21 @@ columns</string>
384387 </hint >
385388 </hints >
386389 </connection >
390+ <connection >
391+ <sender >hasGeometryCol</sender >
392+ <signal >toggled(bool)</signal >
393+ <receiver >geomCombo</receiver >
394+ <slot >setEnabled(bool)</slot >
395+ <hints >
396+ <hint type =" sourcelabel" >
397+ <x >379</x >
398+ <y >385</y >
399+ </hint >
400+ <hint type =" destinationlabel" >
401+ <x >525</x >
402+ <y >385</y >
403+ </hint >
404+ </hints >
405+ </connection >
387406 </connections >
388407</ui >
You can’t perform that action at this time.
0 commit comments