Old-style script dialogs don't save Resource choice to settings
Environment/Versions
- GIMP version: 2.99 latest
- Package: self-built
- Operating System: Linux
Description of the bug
Dialogs for old-style scripts having an argument that is a resource don't show the last choice i.e. don't save the prior choice in settings aka config.
Reproduction
Is the bug reproducible?
Reproduction steps:
- Use an old-style script such as Filters>Render>Lava, expect the initial gradient is "Coffee" (or from context, because the declared default "German Flag Smooth" doesn't actually exist.)
- Change the gradient e.g. "Cold Steel"
- Choose OK, expect lava rendered
- Choose Filters>Re-Show "Lava"
Expected result: Initial choice of gradient is prior choice "Cold Steel"
Actual result: Initial choice is still the one from context, i.e. "Coffee"
Additional information
Related to changes to GimpResource, changes we overlooked.
Happens because ScriptFu v2 implements its own settings. If you port the plugin to script-fu-register-filter, which uses GimpProcedureDialog, this doesn't happen, the settings are implemented by the machinery common to plugins in all languages.
One approach is to fix ScriptFu's implementation of its own settings re resources.
Another approach is to port all scripts to script-fu-register-filter. We should do this anyway, so we don't have duplicate code and so the script dialogs are uniform instead of having two different look-and-feels. This may require implementing script-fu-register-nonimage-filter to replace script-fu-register for those plugins which are not actually filters i.e. don't take an image and drawable and are not GimpImageProcedures but rather plain GimpProcedures.