qgis / QGIS

QGIS is a free, open source, cross platform (lin/win/mac) geographical information system (GIS)
https://qgis.org
GNU General Public License v2.0
10.61k stars 3.01k forks source link

Add an option to copy and paste widget configuration settings #58971

Open ponceta opened 1 month ago

ponceta commented 1 month ago

Feature description

Inspired by --- copy / paste symbol --- copy / paste style :

image

Scope :

Avoid :

Exceptions :

Additional context

Widget configurations are valued with more and more options, we should ease the maintenance of these configuration via copy paste tools like we did a few years ago with copy paste style.

Uses cases

  1. Between similar fields configuration (dates, value lists, Not NULL values, ...) (2. Between projects)
ponceta commented 1 month ago

@3nids does it sounds like a good idea? Feasible or with a huge complexity?

andreasneumann commented 1 month ago

@ponceta - are you thinking about all widgets together for the whole layer (I think this is already possible) or one or more selected individual widgets?

Probably the latter?

ponceta commented 1 month ago

My particular exemple is that one widget configuration is the same for several fields and I have to make exactly the same clics and configuration so my widgets looks the same. It is then easy to miss a click and it is very time consuming.

Here i have fk_dataowner, fk_provider, fk_owner, fk_operator all referincing an organisation table and having exactly the same widget configuration. And this is replicated to some other layers.

andreasneumann commented 1 month ago

So you want to copy widget configurations within the same layer - not to another layer - right?

ponceta commented 1 month ago

So you want to copy widget configurations within the same layer - not to another layer - right?

Yes! (but if it is in your clipboard you could be able to paste it on any other field (including a field in another layer or in another project))

3nids commented 1 month ago

You can already to this by selecting the editor widget category from copy/paste style. This would reuse what is possible (fields with the same names)

andreasneumann commented 1 month ago

You can already to this by selecting the editor widget category from copy/paste style. This would reuse what is possible (fields with the same names)

@3nids - I believe this is a different thing. This would be to copy widget configs from one layer to another, but if I understand it correctly, @ponceta wants to copy widget configuration from one field to another within the same layer.

gacarrillor commented 1 week ago

@ponceta, nice feature request indeed!

Just a couple of questions:

  1. The copy&paste context menu should be displayed only for items of the Fields category in the Available Widgets panel or do you expect it also for items of the Relations category?

  2. Do you imagine a scope selection between the copy and paste actions (e.g., a dialog to select which scopes you want to copy) or perhaps something more direct (i.e., copy all the scopes you listed and paste what makes sense to paste)?

gacarrillor commented 6 days ago

We probably want to avoid copying field comments as well?

ponceta commented 4 days ago
  1. This is a different copy paste but yes we could extend it to copy pasting relations widget configuration. But the copy paste will be available from relations to relations.
  2. If we distinct scope we could copy either parts of the field widget configuration or all sections:
    • ALL Sections
    • affichage,
    • general,
    • type,
    • constraints,
    • defaults,
    • strategies
gacarrillor commented 3 days ago

@ponceta, would copy from a field and paste to the very same field be useful for your use cases?

At first we thought it would be disabled, but it also might make sense to copy a field's config to keep it in the clipboard, do some changes, visualize and test those changes, and after that, return to what we had in the clipboard (i.e., paste the config in the same field as a way to undo things).

What do you think?

ponceta commented 2 days ago

@ponceta, would copy from a field and paste to the very same field be useful for your use cases?

Yes, between two projects would be the most probable scenario but I see no strong necessity of disabling it.