Skip to content

Commit

Permalink
Merge pull request #623 from kartoza/timlinux/issue619
Browse files Browse the repository at this point in the history
Data choice not carried through to indicators
  • Loading branch information
timlinux authored Nov 20, 2024
2 parents dabbdae + 0180aee commit f4220b9
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 8 deletions.
7 changes: 2 additions & 5 deletions geest/gui/indicator_configuration_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,6 +58,7 @@ def update_attributes(self, new_data: dict) -> None:
"""
Updates the attributes dictionary with new data from radio buttons.
"""
# log_message(f"Updating attributes dictionary with new data: {new_data}")
# In the ctor of the widget factor we humanise the name
# now we roll it back to the snake case version so it matches keys
# in the JSON data model
Expand All @@ -66,9 +67,5 @@ def update_attributes(self, new_data: dict) -> None:
)
new_data["analysis_mode"] = snake_case_mode
self.attributes.update(new_data)
# log_message(f"Updated attributes dictionary: {self.attributes}")
self.data_changed.emit()
# log_message(
# f"Updated attributes dictionary: {self.attributes}",
# "Geest",
# level=Qgis.Info
# )
2 changes: 2 additions & 0 deletions geest/gui/widgets/combined_widgets/base_indicator_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,10 @@ def update_data(self) -> None:
Gathers data from internal widgets and emits the data_changed signal.
"""
if self.isChecked():
log_message("Updating data...")
try:
data = self.get_data()
# log_message(f"Data: {data}")
self.data_changed.emit(data)
except Exception as e:
log_message(f"Error in update_data: {e}", level=Qgis.Critical)
Expand Down
6 changes: 3 additions & 3 deletions geest/gui/widgets/combined_widgets/point_layer_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ def _add_point_layer_widgets(self) -> None:
self.main_layout.addWidget(self.point_layer_combo)

# Restore previously selected point layer
point_layer_id = self.attributes.get(f"{self.widget_key}_point_layer_id", None)
point_layer_id = self.attributes.get(f"{self.widget_key}_layer_id", None)
if point_layer_id:
point_layer = QgsProject.instance().mapLayer(point_layer_id)
if point_layer:
Expand All @@ -78,9 +78,9 @@ def _add_point_layer_widgets(self) -> None:
self.point_shapefile_button = QToolButton()
self.point_shapefile_button.setText("...")
self.point_shapefile_button.clicked.connect(self.select_point_shapefile)
if self.attributes.get(f"{self.widget_key}_point_shapefile", False):
if self.attributes.get(f"{self.widget_key}_shapefile", False):
self.point_shapefile_line_edit.setText(
self.attributes[f"{self.widget_key}_point_shapefile"]
self.attributes[f"{self.widget_key}_shapefile"]
)
self.point_shapefile_layout.addWidget(self.point_shapefile_line_edit)
self.point_shapefile_layout.addWidget(self.point_shapefile_button)
Expand Down

0 comments on commit f4220b9

Please sign in to comment.