Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

UsabILItyHub: Override optimize strategy by topping #857

Merged
merged 2 commits into from
Dec 6, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 13 additions & 1 deletion QgisModelBaker/gui/workflow_wizard/project_creation_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -277,13 +277,25 @@ def _create_project(self):

self.progress_bar.setValue(55)

# override optimize strategy if give n by topic
optimize_strategy = custom_project_properties.get("ili_optimize_strategy", None)

if optimize_strategy == "HIDE":
optimize_strategy = OptimizeStrategy.HIDE
elif optimize_strategy == "GROUP":
optimize_strategy = OptimizeStrategy.GROUP
elif optimize_strategy == "NONE":
optimize_strategy = OptimizeStrategy.NONE
else:
optimize_strategy = self.optimize_combo.currentData()

# on geopackages we don't use the transaction mode on default, since this leaded to troubles, except the topping sais so
project = Project(
auto_transaction=not bool(self.configuration.tool & DbIliMode.gpkg)
or custom_project_properties.get("transaction_mode", "")
== "AutomaticGroups",
context={"catalogue_datasetname": CATALOGUE_DATASETNAME},
optimize_strategy=self.optimize_combo.currentData(),
optimize_strategy=optimize_strategy,
)
project.layers = available_layers
project.relations = relations
Expand Down
Loading