Implement widgets for settings that use basic types

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

QuLogic
gplugin/gplugin
default
pidgin

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.

Summary
Implement widgets for settings that use basic types
Description From Last Updated

are these guaranted to be non-null?

grimgrim

What happens if there is no description set? Do we get an empty tooltip?

grimgrim

might be useful to put the type name in the label

grimgrim
grim
grim
  1. 
      
  2. are these guaranted to be non-null?

    1. Yes, it's the values passed to gtk_drop_down_new_from_strings.

  3. What happens if there is no description set? Do we get an empty tooltip?

    1. Then you get no tooltip.

  4. might be useful to put the type name in the label

  5. 
      
QuLogic
grim
  1. Ship It!
  2. Great work, thanks!!

  3. 
      
grim
Review request changed

Status: Closed (submitted)

Loading...