[QGIS-Developer] Auxiliary data storage for labeling, UNDO/REDO - where does it belong to?

Régis Haubourg regis.haubourg at gmail.com
Tue Aug 22 06:46:13 PDT 2017

Hi all,

one major drawback of QGIS has long been that labeling was considered as
part of the datasources, which can be true in some cases, but often it more
belong to a project map object

We, at Oslandia, working on adding Auxiliary storage capabilities to QGIS,
which was discussed in several QEP [1] before.

Now we are close to merge but the work but I would like to discuss some
ergonomics and design polishing.

In all GIS tool, custom labeling informations have been stored in project
file, except in QGIS (which was a brilliant idea to keep it simple !).

A user will now have two ways of storing labeling data :
 - In the datasource by manually adding the fields and setting the
corresponding labeling widget. Only advanced users, with grants on the
datasource do that
-  Using an auxiliary data source sqlite db stored inside the project, just
directly using the labeling toolbar, even on readonly layers. 90 % of the
users will use that I think.

If we consider that a label modification (location, style, rotation ...)
belongs to a project, then we save it when a user saves the project.
If we consider it is belonging to the data, we save it with data save
Rollback for data edits exists using the edit buffer.
But Rolling back project modifications exists only partially, in composer's
edit command list or in dynamic styling panel.

Our concern is about how to handle and display the undo/redo actions for
labeling when they are stored inside the project file.

We thought about 4  ways before concluding that:
- merge the labeling command in the source layer's edit buffer stack ->
that won't work if the layer is readonly. If a user chose not to use the
auxiliary data, then it will work like normal editing.
- add separate buttons to save auxiliary data by hand (which is the same
action as saving a project in fact). Tollbars are too cluttered and users
are already confusing data and project save buttons.
- Create a global "project" or maybe "mapcanvas" level stack, but I suspect
users would like to be able to rollback style, composer and labeling
independently, when undoing some labeling action could also remove some
layers or important styling things.
- Finally, we decided to add a separate edit buffer for the auxiliary data
inside the dynamic styling panel, just below the style/label edit buffer.

So  has anyone any strong opinion here?

Is there any plan somewhere for a Project Undo/Redo, allowing for instance
to Cancel a layer deletion ?

If yes, please share your thoughts so that we store each undo/redo stack at
the right place, and hopefully with something users will understand easily.

All the best,

 [1] https://github.com/qgis/QGIS-Enhancement-Proposals/issues/27
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.osgeo.org/pipermail/qgis-developer/attachments/20170822/14897242/attachment-0001.html>

More information about the QGIS-Developer mailing list