"Double click to reset" issue on Lua in preferences / lua options

Maybe the issue is simple but I don’t figure out how to make it work.
Double click to reset doesn’t work on “file” type. On “bool” type neither.

image

The code is following:

dt.preferences.register(“module_OpenInApp”, “bin_path”, – name
“file”, – type
‘OpenInApp: Application location’, – label
‘Location of Application executable’, – tooltip
“(None)” – default
)
dt.preferences.register(“module_OpenInApp”, “flag”, – name
“bool”, – type
‘OpenInApp: Flag’, – label
‘Some text’, – tooltip
false – default
)

What can I miss ? Any idea ?
Thanks

Edit : I’ve opened the issue Bug #12294 in redmine.

Fixed in master. Eventually it will be picked to the stable branch and be part of the next release.

1 Like

Thanks Houz. The double click reset works and in lua preferences I see now the default value.
However, the data behind the scene (preferences read and in darktablerc) are still somehow unpredictable. I’ve detailed this in redmine on the same issue as above.

If you’re writing an OpenInApp plugin for the exporter, I’d recommend moving the file selector to the GUI. That way you can make your application selection, then click export and it will just work versus having to restart darktable every time you change the preference.

If you look at contrib/gimp.lua near the bottom of the file, right before the register storage is an example. Just remove the surrounding if statement, so that it shows up all the time. For executables, just use “OpenInApp”. As soon as you select the application, the widget writes the preference. When you do the export, check_if_bin_exists() will query the preferences and return the path to the application. This way you could select an application, run it, select a different application, run it, etc. all without restarting darktable.

1 Like

Hi Bill, great suggestion. I wanted write an open raw file plugin with several potential executables. But I think I can use your suggestion without using, or in conjunction with, the export plugin.
On the other hand, using preferences is a way to keep the UI as light as possible (with the price to have to exit dt after change).

I noticed. But more than one bug in a single bug report is not going to work so I just fixed the initial thing and closed it. Feel free to file the other bug separately.