On 2015-07-08 10:57 AM, Steven Blatnick wrote:
So I've finally got a chance to look at my non-API calls. I was able to code around most of them, but there are two that would be much easier if we could make them APIs. (I haven't pushed any of these changes to my git repo yet.) Could we consider making these API?
- keybindings_load_keyfile - I dynamically add/remove a variable number of plugin keybindings based on the plugin settings, so this allows me to refresh the results easily. This allows my external-tools plugin to have any number of tools with each their own keybinding. Otherwise, most plugins have a set number of bindings.
This sounds dubious.
I assume you're talking about `external-tools` plugin? Maybe I don't understand the code enough, but it looks to me like it's just leaking GeanyKeyGroups in `reload_tools()` and then calling `keybindings_load_keyfile()` happens to reload the key group it newly created?
I completely agree there needs to be a way to dynamically add/remove keybindings, but I'm not sure we should promote this way if I understand it correctly. IMO, it would be much better to fix Geany.
- keybindings_lookup_item - I know keybindings_get_item is available already, but I am attempting to look up a core group keybinding and not plugin's own keybindings.
This sounds reasonable, though I think it would be better if made public to rename it to something like `keybindings_get_builtin_item()` or something. Also I think we should change the signature to use the correct types (those enums we already expose).
- keybindings_dialog_show_prefs_scroll - I remember someone saying the "Configure Plugins" window would have a button to this already in a later version, but I still don't see it. I only need this API if the button isn't added.
Could probably make such a button/link use the same code as the "Keybindings" button in the Plugin Manager dialog, since it does just that. It might be a bit awkward UI-wise though.
Let me know if this is possible or how I should proceed. I use geany with my plugins daily, and can't upgrade my code base until my plugins are working.
Best is to make a PR with the changes you want. Second best is to raise an Issue and hope somebody else wants them enough to do it.
Cheers, Matthew Brush