Skip to content
Snippets Groups Projects
Commit d66231e6 authored by Alexian Masson's avatar Alexian Masson
Browse files

ProfileDialog: Check if topo_bath field is present

parent baebd86c
No related branches found
No related tags found
1 merge request!75Gsedfqgis 118 create dedicated algo
...@@ -376,6 +376,22 @@ class ProfileDialog(QtWidgets.QDialog, FORM_CLASS): ...@@ -376,6 +376,22 @@ class ProfileDialog(QtWidgets.QDialog, FORM_CLASS):
if self.file is not None and self.file.layer() is not None: if self.file is not None and self.file.layer() is not None:
self.file.layer().layerModified.disconnect(self.layer_modified) self.file.layer().layerModified.disconnect(self.layer_modified)
# Check if topo_bath field is present
if layer is not None:
if layer.fields().indexFromName("topo_bath") == -1:
self.message_bar.pushMessage(
self.tr("Missing field"),
self.tr(
"The field 'topo_bath' is missing in the layer. "
"Please add it with hte re pair profiles algorithm before using this tool."
),
Qgis.MessageLevel.Critical,
duration=5,
)
self.layerComboBox.setLayer(None)
return
self.file = PreCourlisFileLine(layer) self.file = PreCourlisFileLine(layer)
self.sectionItemModel.setLayer(layer) self.sectionItemModel.setLayer(layer)
self.sectionComboBox.setCurrentIndex(0) self.sectionComboBox.setCurrentIndex(0)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment