Skip to content

Commit

Permalink
Merge pull request #984 from opengisch/lgo
Browse files Browse the repository at this point in the history
improve log outputs
  • Loading branch information
signedav authored Nov 21, 2024
2 parents 4fae2e7 + 24feadd commit 02d97e4
Show file tree
Hide file tree
Showing 12 changed files with 35 additions and 20 deletions.
2 changes: 1 addition & 1 deletion QgisModelBaker/gui/workflow_wizard/execution_page.py
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def _on_process_finished(self, exit_code, result):
level = LogLevel.SUCCESS
if self.db_action_type == DbActionType.GENERATE:
message = self.tr(
"Interlis model(s) successfully imported into the database!"
"INTERLIS model(s) successfully imported into the database!"
)
elif self.db_action_type == DbActionType.IMPORT_DATA:
message = self.tr(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ def __init__(self, parent, title):
self.xtf_file_line_edit,
title=self.tr("Save in XTF Transfer File"),
file_filter=self.tr(
"XTF Transfer File (*.xtf *XTF);;Interlis 1 Transfer File (*.itf *ITF);;XML (*.xml *XML);;GML (*.gml *GML)"
"XTF Transfer File (*.xtf *XTF);;INTERLIS 1 Transfer File (*.itf *ITF);;XML (*.xml *XML);;GML (*.gml *GML)"
),
extension=".xtf",
extensions=["." + ext for ext in self.ValidExtensions],
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,9 +59,9 @@ def __init__(self, parent, title):
self.file_browse_button.clicked.connect(
make_file_selector(
self.input_line_edit,
title=self.tr("Open Interlis Model, Transfer or Catalogue File"),
title=self.tr("Open INTERLIS Model, Transfer or Catalogue File"),
file_filter=self.tr(
"Interlis Model / Transfer / Catalogue File (*.ili *.xtf *.itf *.XTF *.ITF *.xml *.XML *.xls *.XLS *.xlsx *.XLSX)"
"INTERLIS Model / Transfer / Catalogue File (*.ili *.xtf *.itf *.XTF *.ITF *.xml *.XML *.xls *.XLS *.xlsx *.XLSX)"
),
)
)
Expand Down
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
2 changes: 1 addition & 1 deletion QgisModelBaker/metadata.txt
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ qgisMinimumVersion=3.16
qgisMaximumVersion=3.99
author=OPENGIS.ch GmbH in collaboration with SwissTierras Colombia
[email protected]
about=Model Baker (previously QgsProjectGenerator) creates QGIS projects from Interlis models, PostGIS database schemas or GeoPackages. It preconfigures layers, widgets, relations and much more based on meta information available from models.
about=Model Baker (previously QgsProjectGenerator) creates QGIS projects from INTERLIS models, PostGIS database schemas or GeoPackages. It preconfigures layers, widgets, relations and much more based on meta information available from models.
tags=model,schema,postgres,postgis,geopackage,gpkg,interlis,ili,xtf,projectgenerator,project,modelbaker,QgisModelBaker
tracker=https://github.com/opengisch/QgisModelBaker/issues
repository=https://github.com/opengisch/QgisModelBaker
Expand Down
4 changes: 2 additions & 2 deletions QgisModelBaker/ui/options.ui
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@
</widget>
<widget class="QWidget" name="tab_2">
<attribute name="title">
<string>Interlis</string>
<string>INTERLIS</string>
</attribute>
<layout class="QGridLayout" name="gridLayout_2">
<item row="0" column="0" colspan="2">
Expand All @@ -115,7 +115,7 @@
</property>
<property name="toolTip">
<string>&lt;html&gt;&lt;head/&gt;&lt;body&gt;
&lt;p&gt;Directories which contain Interlis Models (ili files). Several paths can be separated with a semicolon `;`. It is also possible to specify URL's of model repositories.&lt;/p&gt;
&lt;p&gt;Directories which contain INTERLIS Models (ili files). Several paths can be separated with a semicolon `;`. It is also possible to specify URL's of model repositories.&lt;/p&gt;
&lt;dl&gt;
&lt;dt&gt;%ILI_FROM_DB&lt;/dt&gt;&lt;dd&gt;is a placeholder for the models in the database (in the table &lt;code&gt;t_ili2db_model&lt;/code&gt;).
&lt;/dt&gt;
Expand Down
2 changes: 1 addition & 1 deletion QgisModelBaker/ui/topping_wizard/referencedata.ui
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@
<item row="0" column="2">
<widget class="QToolButton" name="file_browse_button">
<property name="toolTip">
<string>Browse Interlis files</string>
<string>Browse INTERLIS files</string>
</property>
<property name="text">
<string>…</string>
Expand Down
4 changes: 2 additions & 2 deletions QgisModelBaker/ui/workflow_wizard/database_selection.ui
Original file line number Diff line number Diff line change
Expand Up @@ -77,12 +77,12 @@
<widget class="QComboBox" name="type_combo_box">
<item>
<property name="text">
<string>Interlis (PostGIS)</string>
<string>INTERLIS (PostGIS)</string>
</property>
</item>
<item>
<property name="text">
<string>Interlis (GeoPackage)</string>
<string>INTERLIS (GeoPackage)</string>
</property>
</item>
<item>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@
<item row="0" column="2">
<widget class="QToolButton" name="file_browse_button">
<property name="toolTip">
<string>Browse Interlis files</string>
<string>Browse INTERLIS files</string>
</property>
<property name="text">
<string>…</string>
Expand Down
2 changes: 1 addition & 1 deletion QgisModelBaker/ui/workflow_wizard/project_creation.ui
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@
<item row="1" column="2">
<widget class="QToolButton" name="topping_file_browse_button">
<property name="toolTip">
<string>Browse Interlis files</string>
<string>Browse INTERLIS files</string>
</property>
<property name="text">
<string>…</string>
Expand Down
8 changes: 4 additions & 4 deletions QgisModelBaker/utils/globals.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,15 +33,15 @@
DbIliMode.pg: QCoreApplication.translate("QgisModelBaker", "PostGIS"),
DbIliMode.gpkg: QCoreApplication.translate("QgisModelBaker", "GeoPackage"),
DbIliMode.mssql: QCoreApplication.translate("QgisModelBaker", "SQL Server"),
DbIliMode.ili: QCoreApplication.translate("QgisModelBaker", "Interlis"),
DbIliMode.ili: QCoreApplication.translate("QgisModelBaker", "INTERLIS"),
DbIliMode.ili2pg: QCoreApplication.translate(
"QgisModelBaker", "Interlis (use PostGIS)"
"QgisModelBaker", "INTERLIS (use PostGIS)"
),
DbIliMode.ili2gpkg: QCoreApplication.translate(
"QgisModelBaker", "Interlis (use GeoPackage)"
"QgisModelBaker", "INTERLIS (use GeoPackage)"
),
DbIliMode.ili2mssql: QCoreApplication.translate(
"QgisModelBaker", "Interlis (use SQL Server)"
"QgisModelBaker", "INTERLIS (use SQL Server)"
),
}

Expand Down
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ Configuring QGIS layers and forms manually is a tedious and error prone process.
This plugin loads database schemas with various meta information to preconfigure the
layer tree, widget configuration, relations and more.

[Interlis](https://en.wikipedia.org/wiki/Interlis) models contain more information than a plain database schema. This
plugin uses [ili2pg](https://github.com/claeis/ili2db#ili2db---importsexports-interlis-transfer-files-to-a-sql-db) to import an Interlis model into a PostGIS database and uses
[INTERLIS](https://en.wikipedia.org/wiki/INTERLIS) models contain more information than a plain database schema. This
plugin uses [ili2pg](https://github.com/claeis/ili2db#ili2db---importsexports-interlis-transfer-files-to-a-sql-db) to import an INTERLIS model into a PostGIS database and uses
the additional meta information to configure the user interface even better.

[Read the documentation](https://opengisch.github.io/QgisModelBaker/) for more information.
Expand Down

0 comments on commit 02d97e4

Please sign in to comment.