With this release, Model Baker brings some cool improvements on the GUI like the consistent use of the data source settings and the dark mode. As well it fixes the missing GeoPackage part and offers optimization strategies on smart 1 inheritance implementations. As well it contains the handy detection and setting of unique and not-null constraints on OID fields.
GUI / UX
Night Model Baking
Many users work with QGIS in its velvety dark mode. Since this release Model Baker supports it as well.
![Screenshot from 2024-06-27 12-18-24](https://github.com/opengisch/QgisModelBaker/assets/28384354/2c99e871-c830-44c3-b5b9-a0869a0edd53)
As well the "Blend of Gray" theme is supported.
![image](https://github.com/opengisch/QgisModelBaker/assets/28384354/3836b93c-69c2-4d34-96a8-5c979f19b79b)
Concequent detecting of database settings
Dataset Manager
Because you barely want to edit datasets on another data source than the one you are using in your current project, Model Baker detects automatically the source (according to the selected layer). You cannot edit the data source in the Dataset Manager anymore. We removed it because it leaded to confusion.
![Screenshot from 2024-06-21 13-04-34](https://github.com/opengisch/QgisModelBaker/assets/28384354/2082d175-a943-49e8-bf55-69dde402a06f)
And what if my current layer is not a valid layer (e.g. a group or a WMS)?
> Then it goes through all the layers and takes the first valid one.
And what if I have no project opened at all?
> Then it takes the last used connection (used anywhere - not only in Dataset Manager)
Export
On export it does the same. It checks for layers in the current project and takes their data source. If no project or valid layer present, it takes the last used connection. Unlike in the Dataset Manager the connection is still editable here.
Import / Generate
Although on schema import you usually create a new schema / data file we adapted the behavior here, because we I assume, that mostly the other parameters (like the db / host) are the same like the one of the opened project. If no project or valid layer present, it takes the last used connection.
On generating a project you usually have no project opened yet. But to have it everywhere in the same way, the behavior is everywhere the same.
Help in the Workflow Wizard
The workflow wizard provides support by help button. There is a summary about the current page and the description of the most important options. Then there are links to the corresponding chapter in the documentation, to the GitHub issues and to the discourse INTERLIS forum.
![image](https://github.com/opengisch/QgisModelBaker/assets/28384354/00ed74ce-efa6-4042-92a1-51ddb89dad5d)
Other improvements
- Remove button to manage baskets when the **Dataset Manager** is opened via the wizard (since in that case you created the basket before or you will create it by importing the data)
- More descriptive baskets on export / validation by showing the attachement key
![image](https://github.com/opengisch/QgisModelBaker/assets/28384354/5bbd128c-d5f1-480c-b9ac-d4b8100c30e3)
- Remember previous settings when using a PostgreSQL connection service file
Sponsors
Financed by the QGIS Model Baker Group
Mandatory and unique constraints on OIDs
The columns based on [OIDs](https://opengisch.github.io/QgisModelBaker/background_info/oid_tid_generator/#oid-tid-bid-t_ili_tid-tid-sorry-what) in physical databases (the `t_ili_tid` fields) contain neither a not-null nor a unique constraint when generated by ili2db. This is because some tables created based on special inheritance structures have a `t_ili_tid` but no OID. It may also be that you want to collect the data without filling in the OID.
Still, most of the time they must be unique and not null. At least as soon as you want to split or duplicate features in QGIS. This is why Model Baker sets the field widget of `t_ili_tid` to not-null and unique by default as soon as an OID is defined in the INTERLIS model. But as well, those settings are provided by the **OID Manager**, so you are free to change them.
![image](https://github.com/opengisch/QgisModelBaker/assets/28384354/01dff661-46b1-4df7-8904-7c1d6bfd503b)
Sponsors
Financed by Canton of Schwyz
Improvements on Smart 1 inheritance
When a physical database based on an INTERLIS model was created with the `--smart1inheritance` setting, this mostly means that multiple classes are "merged" to one table containing all the attributes. As well it contains a field `t_type` describing of what class the current object is.
Provide possible `t_type` values in dropdown
With QGIS projects based on PostgreSQL this was already provided before this release, but now it's also possible with GeoPackage. As well the names of the possible classes are more descriptive.
![image](https://github.com/opengisch/QgisModelBakerLibrary/assets/28384354/2d3bf3bc-4d25-4801-839f-3b8bcbf37a61)
Project optimization
Projects based on the smart 1 inheritance, can now be optimized. Means on "Hide"-strategy all the irrelevant classes will be filtered out from the `t_type` dropdown.
![image](https://github.com/opengisch/QgisModelBaker/assets/28384354/99829658-e1da-496c-b486-5661889b0149)
As well the irrelevant baskets are deselected per default.
Sponsors
Financed by the QGIS Model Baker Group
ili2db