Implement widgets for settings that use basic types

Review Request #2150 — Created Dec. 23, 2022 and submitted — Latest diff uploaded

Information

gplugin/gplugin
default

Reviewers

This implements enums, integral types, double, and string. I have not yet implemented flags, and I'm not sure if we need those. The numeric types use spin buttons, though I suppose they could be sliders. The rates/digits/increments are somewhat arbitrary and could probably be adjusted, but seem good enough for now.

I think this should be sufficient for all libpurple plugins. The GTK plugins may or may not be possible. For example, spellchk has a full table of replacements. This may work as a dict[str, str] in a table widget, but this is so far not implemented here. We should probably think about whether that makes sense to handle dict semi-generically or whether to expose some kind of GTK extension point as in the old API.

Also note that there are no GSettings types for things like directories or files, so those don't get any special treatment other than a string input. If we do want special handling, we may have to come up with some setting conventions (e.g., a setting name ending in -dir gets a directory chooser widget instead of an entry automatically, or similar).

Ran gplugin-gtk4-viewer -p gplugin/native-settings-plugin and checked that all the settings had widgets with expected limits, and that setting them then going to another plugin and back preserved the settings. (Note that it does warn once for the unimplemented flags type.)

Also checked that plugins set up in /r/2131 had some settings.

Commits

Files