Skip to content

Commit

Permalink
Merge pull request #90 from ricardogsilva/83-lock-to-first-layer-is-n…
Browse files Browse the repository at this point in the history
…ot-working-#83

Fix lock layer attributes button
  • Loading branch information
ricardogsilva authored Jul 28, 2024
2 parents df1340d + d1dc247 commit 664dccc
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 1 deletion.
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

## [Unreleased]

- Fix 'lock attributes to first layer' button not working
- Prevent using a float attribute as the node identifier
- Add validation of node-related attributes when using the processing algorithm that prepares conefor inputs
- Fix main dialog always using default values for layers
Expand Down
1 change: 1 addition & 0 deletions src/qgis_conefor/conefordialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ def use_selected_features_toggled(self, state: int):

def toggle_lock_layers(self, lock):
index = self.model.index(0, 0)
self.model.lock_layers = lock
self.tableView.setFocus()

def show_help(self):
Expand Down
1 change: 1 addition & 0 deletions src/qgis_conefor/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -318,6 +318,7 @@ def prepare_conefor_inputs(self):
kwargs.update({
"default_node_identifier_name": first.id_attribute_field_name,
"default_node_attribute_name": first.attribute_field_name,
"default_nodes_to_add_attribute_name": first.nodes_to_add_field_name,
})
for idx, data_item in enumerate(self.dialog.model.layers_to_process):
if idx == 0 or not self.dialog.lock_layers_chb.isChecked():
Expand Down
2 changes: 1 addition & 1 deletion src/qgis_conefor/tablemodel.py
Original file line number Diff line number Diff line change
Expand Up @@ -110,7 +110,7 @@ def headerData(self, section: int, orientation, role=QtCore.Qt.DisplayRole):

def flags(self, index):
if self.lock_layers:
if index.row() == 0:
if index.row() == 0 or index.column() == 0:
result = QtCore.Qt.ItemFlags(
QtCore.QAbstractTableModel.flags(self, index) |
QtCore.Qt.ItemIsEditable
Expand Down

0 comments on commit 664dccc

Please sign in to comment.