Re: [anjuta-devel] Dconf and GSettings



Hi all,


I have looked at the Anjuta code for preferences and I have another more important proposal: We could just described all keys in a .gschema.xml file and keep only the key name in the .ui file.

+ We don't need the builder2schema.pl script nor the build-schemas.mk makefile

+ We can add information in the .gschema.xml file like description

+ Each key can be associated with a widget in the preference dialog by using the key name by example preferences:use-tabs. We could still keep the unused field to keep more compatibility preferences_dummy:dummy:dummy:dummy:use-tabs.

+ Nothing special need to be done when we have additional keys not usable in the preference dialog. It is just a key which doesn't have a corresponding widget.



We will "loose" 4 informations: object_type, data_type, default_value, flags. We keep the key name only.


* object_type can be found by checking the kind of the widget. By example a GtkColorButton is of type ANJUTA_PROPERTY_OBJECT_TYPE_COLOR. We can find a correspondence for all types.

+ This object_type is used only for connecting to the right signal depending on the widget type. So it already assumes that the widget has a defined type. - But for most widget it's only a connection to a signal with this change a custom widget has to derivate from the standard GtkWidget while it isn't mandatory if we keep the information in the .ui file. + On the other hand, all our current preferences use the standard widget so this information is redundant.


* The data_type is not used. I imagine that it was useful with gconf.


* The default_value is already defined in gsettings so I think we don't need it except for the combo box where it allows us to define the possible choice. + These choices are already defined in the .gschema.xml file. It is possible to get them using the function g_settings_get_range. - The documentation consider that this function should be used for introspection only. Perhaps we should find another way to get the possible choices.


* The flags should be used to define if the configuration is system or project wide but it's not working. Currently all configurations are system wide so I think we can remove it.

Do you agree to make those changes?


I don't see a real need to add more support in .ui file for gsettings key so I don't expect some improvements here.


Regards,

Sébastien



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