Skip to content

Commit

Permalink
Fix geometry digitizing step missing when adding a relationship paren…
Browse files Browse the repository at this point in the history
…t via the relation combobox
  • Loading branch information
nirvn committed Nov 14, 2024
1 parent ce54e67 commit 020f237
Showing 1 changed file with 18 additions and 3 deletions.
21 changes: 18 additions & 3 deletions src/qml/RelationCombobox.qml
Original file line number Diff line number Diff line change
Expand Up @@ -614,9 +614,11 @@ Item {
visible: enabled && allowAddFeature && relation !== undefined && relation.isValid

onClicked: {
embeddedPopup.state = 'Add';
embeddedPopup.currentLayer = relationCombobox.relation ? relationCombobox.relation.referencedLayer : null;
embeddedPopup.open();
if (relationCombobox.relation.referencedLayer.geometryType() !== Qgis.GeometryType.Null) {
requestGeometry(relationCombobox, relationCombobox.relation.referencedLayer);
return;
}
showAddFeaturePopup();
}
}

Expand Down Expand Up @@ -646,4 +648,17 @@ Item {
}
}
}

function requestedGeometryReceived(geometry) {
showAddFeaturePopup(geometry);
}

function showAddFeaturePopup(geometry) {
embeddedPopup.state = 'Add';
embeddedPopup.currentLayer = relationCombobox.relation ? relationCombobox.relation.referencedLayer : null;
if (geometry !== undefined) {
embeddedPopup.applyGeometry(geometry);
}
embeddedPopup.open();
}
}

0 comments on commit 020f237

Please sign in to comment.