Skip to content

Commit

Permalink
improve log outputs
Browse files Browse the repository at this point in the history
  • Loading branch information
signedav committed Nov 19, 2024
1 parent 4fae2e7 commit 59ee1ae
Showing 1 changed file with 17 additions and 2 deletions.
19 changes: 17 additions & 2 deletions QgisModelBaker/gui/workflow_wizard/project_creation_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,8 @@ def _create_project(self):
)
legend = generator.legend(available_layers)

self.progress_bar.setValue(50)

custom_layer_order_structure = list()
custom_project_properties = {}
mapthemes = {}
Expand Down Expand Up @@ -530,8 +532,9 @@ def _create_project(self):
LogLevel.TOPPING,
)

self.progress_bar.setValue(55)
self.progress_bar.setValue(55)

self.workflow_wizard.log_panel.print_info(self.tr("Set transaction mode…"))
# override transaction mode if give n by topic
transaction_mode = custom_project_properties.get("transaction_mode", None)

Expand Down Expand Up @@ -561,6 +564,12 @@ def _create_project(self):
transaction_mode = Qgis.TransactionMode.Disabled.name
# otherwise it's already a string and could be everything

self.progress_bar.setValue(60)

self.workflow_wizard.log_panel.print_info(
self.tr("Optimize according the strategy...")
)

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

Expand Down Expand Up @@ -592,19 +601,25 @@ def _create_project(self):
)
project.post_generate()

self.progress_bar.setValue(70)

qgis_project = QgsProject.instance()

self.workflow_wizard.log_panel.print_info(self.tr("Generate QGIS project…"))
project.create(None, qgis_project)

self.progress_bar.setValue(75)

self.workflow_wizard.log_panel.print_info(self.tr("Set map canvas extent..."))

# Set the extent of the mapCanvas from the first layer extent found
for layer in project.layers:
if layer.extent is not None:
self.workflow_wizard.iface.mapCanvas().setExtent(layer.extent)
self.workflow_wizard.iface.mapCanvas().refresh()
break

self.progress_bar.setValue(60)
self.progress_bar.setValue(80)

# QML Toppings in the metadata: collect, download and apply
# This configuration is legacy (should be in project topping instead), but it's still supported
Expand Down

0 comments on commit 59ee1ae

Please sign in to comment.