Re: [anjuta-devel] Dconf and GSettings



Hi Johannes,


Le 08/11/2011 22:08, Johannes Schmid a écrit :
http://developer.gnome.org/gio/2.28/ch28s06.html has some details about
the Makefile.am rules but I think what you posted is basically right.
Don't forget to add the schema files to git and to EXTRA_DIST.

Ok.


Do I move the gsettings from org.gnome.anjuta._plugin_name__key_name to
org.gnome.anjuta.plugins._plugin_name_._key_name_?

Do whatever you like better. But the latter looks more reasonable and we
avoid the 32 character restriction for the key name.

Yes, I think too that the later is better even if it breaks the compatibility.


We have translations but this is because the choices are also included
in the combo-box definition (model) in the ui files. I don't remember
the details but I think can easily mess things up if you change the
order either in the schema (or widget name) or in the ui definition.

I haven't thought about this. Indeed the name displayed in the combo box are coming from the .ui file. It's better than using the gschema file.

What is important is to keep the same order in the widget name and the ui model definition. I'm not sure the order is kept when using g_settings_get_range even if I suppose it's the case. Anyway relying on the ordering even in the widget name is I think not the best solution.


I think it would be better to add an additional column in the GtkListStore model of the .ui file containing a untranslated name and use this name in settings. I think we can even set it as the id column (gtk_combo_box_set_id_column). With this solution, I don't need to use g_settings_get_range and we don't need a particular order.

As a work around, if this id column is missing and I remove the choices element in the settings, I can use the translated name in the settings. It will break if the user change his language but it should be quite uncommon.

A third solution could be to store only the number of the row but it will break if we add another choice in the middle or remove one choice.

What do you think?


Regards,

Sébastien



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]