Use a method to do the change

http://bazaar.launchpad.net/~openlp-core/openlp/2.4/view/head:/openlp/core/common/settings.py


has some converters.

On 8 November 2017 at 18:21, Raoul Snyman <[email protected]> wrote:

> Hi guys,
>
> We've got a settings migration system which will migrate an old setting to
> a new setting. I want to migrate a group of settings to a single new
> setting, but this is not currently supported. Here's what I'm trying to do:
>
> With the current monitor settings, we store the monitor number the user
> has selected in the settings dialog, the size of the screen, and if the
> size is overridden. I want to migrate this all to a single setting which
> contains a JSON object which allows us to (in the future) support more
> monitors and more detailed settings for each monitor.
>
> One of the ideas that I had was to read the new value before writing it.
> I'm not sure if this is a good way to do it, but perhaps that could work?
> e.g.
>
>   ('monitor', 'monitors', [upgrade_monitor, '{}']),
>   ('x position', 'monitors', [upgrade_x_position, '{}']),
>   ('y position', 'monitors', [upgrade_y_position, '{}']),
>   ('width', 'monitors', [upgrade_width, '{}']),
>   ('height', 'monitors', [upgrade_height, '{}']),
>
> Any other ideas?
>
>
> --
> Raoul Snyman
> +1 (520) 490-9743
> [email protected]
> _______________________________________________
> openlp-dev mailing list
> [email protected]
> https://lists.openlp.io/mailman/listinfo/openlp-dev
>



-- 
Tim and Alison Bentley
[email protected]
_______________________________________________
openlp-dev mailing list
[email protected]
https://lists.openlp.io/mailman/listinfo/openlp-dev

Reply via email to