- Testing Done:
-
~ 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 is does warn once for the unimplementedflags
type.)~ 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 unimplementedflags
type.)Also checked that plugins set up in /r/2131 had some settings.
Implement widgets for settings that use basic types
Review Request #2150 — Created Dec. 22, 2022 and submitted
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 adict[str, str]
in a table widget, but this is so far not implemented here. We should probably think about whether that makes sense to handledict
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 unimplementedflags
type.)Also checked that plugins set up in /r/2131 had some settings.
- Change Summary:
-
Re-factor and comment to improve clarity.
Note that after adding the ranged settings to the plugin, I've realized that
(u)int64
anddouble
are broken inGtkSpinButton
. This is because 64-bit is too large to be represented in adouble
, so we'll likely have to move toGtkEntry
with manual binding. That is not yet implemented here.And as noted before, the
flags
type is still not implemented. - Commits:
-
Summary ID e99e8e6ae90a2fb74359bc68c913dcccdca241ad ff7a551d03045100ae2063db3ae966064fd5b205 - Diff:
-
Revision 2 (+798 -28)