Skip to content

Commit

Permalink
Updates to support widget factory
Browse files Browse the repository at this point in the history
  • Loading branch information
timlinux committed Sep 29, 2024
1 parent 501bf86 commit 797e285
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 31 deletions.
29 changes: 1 addition & 28 deletions geest/gui/geest_treeview.py
Original file line number Diff line number Diff line change
Expand Up @@ -199,34 +199,7 @@ def recurse_tree(item):
"layers": [recurse_tree(child) for child in item.childItems],
}
elif item.role == "layer":
# TODO: Add more layer details here
# like weighting etc.
return {
"layer": item.data(0),
"Text": item.data(4)["Text"],
"Default Weighting": item.data(4)["Default Weighting"],
"Use Aggregate": item.data(4)["Use Aggregate"],
"Default Index Score": item.data(4)["Default Index Score"],
"Index Score": item.data(4)["Index Score"],
"Use default Idex Score": item.data(4)["Use default Idex Score"],
"Rasterise Raster": item.data(4)["Rasterise Raster"],
"Rasterise Polygon": item.data(4)["Rasterise Polygon"],
"Rasterise Polyline": item.data(4)["Rasterise Polyline"],
"Rasterise Point": item.data(4)["Rasterise Point"],
"Default Buffer Distances": item.data(4)[
"Default Buffer Distances"
],
"Use Buffer point": item.data(4)["Use Buffer point"],
"Default pixel": item.data(4)["Default pixel"],
"Use Create Grid": item.data(4)["Use Create Grid"],
"Default Mode": item.data(4)["Default Mode"],
"Default Measurement": item.data(4)["Default Measurement"],
"Default Increments": item.data(4)["Default Increments"],
"Use Mode of Travel": item.data(4)["Use Mode of Travel"],
"source": item.data(4)["source"],
"indicator": item.data(4)["indicator"],
"query": item.data(4)["query"],
}
return item.data(3)

json_data = {
"dimensions": [recurse_tree(child) for child in self.rootItem.childItems]
Expand Down
7 changes: 4 additions & 3 deletions geest/gui/layer_detail_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -268,9 +268,10 @@ def accept_changes(self):
updated_data = self.config_widget.attributes_dict

# Set 'Analysis Mode' based on the selected radio button
selected_button = self.button_group.checkedButton()
if selected_button:
updated_data["Analysis Mode"] = selected_button.text()
# Taken from IndicatorConfigWidget now
#selected_button = self.button_group.checkedButton()
#if selected_button:
# updated_data["Analysis Mode"] = selected_button.text()

self.dataUpdated.emit(updated_data) # Emit the updated data as a dictionary
self.accept() # Close the dialog
Expand Down

0 comments on commit 797e285

Please sign in to comment.