On Jul 8, 2015 7:18 PM, Matthew Brush mbrush@codebrainz.ca wrote:
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.
I agree. Maybe a reload_plugin type function? I saw a similar problem in gedit plugins, where you have to restart the editor for some things to take effect. And you're right, if i remember correctly, I just want to be able to reload my own shortcuts, and the existing call does them all, which is overkill to say the least.
* 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).
Alternatively, is there an event i can tie in to? Basically the issue here is in focusing on the side panel or bottom panel, the focus lands in the wrong place to then capture ctrl+pg_up/down to switch notebook tabs. For example, when focusing my panel in external-tools, I need the focus to update to the read-only text field instead of the notebook tab label. I know I can use tab, but I'm trying to make the usage fluid.
* 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.
I'm not sure why that would be awkward? I'm away from the code right now, but I think this call is the same as that button, it just needs to be made an API.
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.
Ok, thanks! I'll see what I can do based on the feedback.
Steve
Cheers, Matthew Brush
Devel mailing list Devel@lists.geany.org https://lists.geany.org/cgi-bin/mailman/listinfo/devel
On 2015-07-08 07:28 PM, Steve wrote:
On Jul 8, 2015 7:18 PM, Matthew Brush mbrush@codebrainz.ca wrote:
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.
I agree. Maybe a reload_plugin type function? I saw a similar problem in gedit plugins, where you have to restart the editor for some things to take effect. And you're right, if i remember correctly, I just want to be able to reload my own shortcuts, and the existing call does them all, which is overkill to say the least.
GeanyPy, which also has sub-"tools" (still called plugins, but in Python scripts) has the same problem. I'll bet GeanyLua and GeanyMiniScript suffer of the same.
* 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).
Alternatively, is there an event i can tie in to? Basically the issue here is in focusing on the side panel or bottom panel, the focus lands in the wrong place to then capture ctrl+pg_up/down to switch notebook tabs. For example, when focusing my panel in external-tools, I need the focus to update to the read-only text field instead of the notebook tab label. I know I can use tab, but I'm trying to make the usage fluid.
You could probably dig-out the appropriate widgets from the Glade/GtkBuilder UI and connect to GtkWidget events such as "focus-in" and such, but I have the feeling the way you're doing it is better, without having actually looked at this part of the code.
* 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.
I'm not sure why that would be awkward? I'm away from the code right now, but I think this call is the same as that button, it just needs to be made an API.
I probably would have to see it. I just mean I can't envision a way to add a "Keybindings" to that "Configure Plugin" dialog that would be global to all plugin tabs.
Cheers, Matthew Brush
Am 09.07.2015 um 04:41 schrieb Matthew Brush:
On 2015-07-08 07:28 PM, Steve wrote:
I agree. Maybe a reload_plugin type function? I saw a similar problem in gedit plugins, where you have to restart the editor for some things to take effect. And you're right, if i remember correctly, I just want to be able to reload my own shortcuts, and the existing call does them all, which is overkill to say the least.
GeanyPy, which also has sub-"tools" (still called plugins, but in Python scripts) has the same problem. I'll bet GeanyLua and GeanyMiniScript suffer of the same.
Hopefully we can land my proxy plugins effort for 1.26, then external tools could create sub-plugins for each tool, each with their own keybindings (I do have adapted GeanyPy to already locally, works awesome).
So that's already 3 use cases for proxy plugins.
Best regards
Am 09.07.2015 um 04:28 schrieb Steve:
On Jul 8, 2015 7:18 PM, Matthew Brush mbrush@codebrainz.ca wrote:
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.
I agree. Maybe a reload_plugin type function? I saw a similar problem in gedit plugins, where you have to restart the editor for some things to take effect. And you're right, if i remember correctly, I just want to be able to reload my own shortcuts, and the existing call does them all, which is overkill to say the least.
Remember that plugin_set_key_group() can be called repeatedly. Calling it again will simply clear all existing keybindings, then you can start over again with keybindings_set_item().
So it looks like this can be achieved with current 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).
Alternatively, is there an event i can tie in to? Basically the issue here is in focusing on the side panel or bottom panel, the focus lands in the wrong place to then capture ctrl+pg_up/down to switch notebook tabs. For example, when focusing my panel in external-tools, I need the focus to update to the read-only text field instead of the notebook tab label. I know I can use tab, but I'm trying to make the usage fluid.
Not sure I completely understood this, but this sounds very much like not a keybinding issue.
The expected behavior is that ctrl+tab and ctrl+shift+tab switch the notebook page of whatever notebook their are in (the inner-most notebook in case of nested ones - this is sometimes inconvinient).
So if the sidebar is focussed, then ctrl+tab will switch pages in the sidebar.
But I don't fully understand what's the problem with this here. Where is this field you want to focus, is it not part of the youor sidebar panel?
* 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.
I'm not sure why that would be awkward? I'm away from the code right now, but I think this call is the same as that button, it just needs to be made an API.
I agree this button would make some sense in the configuration dialog.
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.
Ok, thanks! I'll see what I can do based on the feedback.
Steve
Best regards
Responses below:
On 07/08/2015 11:23 PM, Thomas Martitz wrote:
Remember that plugin_set_key_group() can be called repeatedly. Calling it again will simply clear all existing keybindings, then you can start over again with keybindings_set_item().
So it looks like this can be achieved with current Geany.
Thanks! I'll take a look.
Not sure I completely understood this, but this sounds very much like not a keybinding issue.
The expected behavior is that ctrl+tab and ctrl+shift+tab switch the notebook page of whatever notebook their are in (the inner-most notebook in case of nested ones - this is sometimes inconvinient).
So if the sidebar is focussed, then ctrl+tab will switch pages in the sidebar.
But I don't fully understand what's the problem with this here. Where is this field you want to focus, is it not part of the youor sidebar panel?
The components are within the notebook, but I want to change the default component that is in focus when the tab is selected. For example, in external-tools, I was setting the read-only textarea as focused, so you can highlight the output with the cursor via the keyboard without having to tab into that component first.
I agree this button would make some sense in the configuration dialog.
How about adding the button along the bottom of the dialog (to the left of where it says "Apply", "Cancel", "OK"), and just having it take you to the currently selected plugin's shortcuts?
Thanks,
Steve
Am 09.07.2015 um 18:00 schrieb Steven Blatnick:
Responses below:
On 07/08/2015 11:23 PM, Thomas Martitz wrote:
Remember that plugin_set_key_group() can be called repeatedly. Calling it again will simply clear all existing keybindings, then you can start over again with keybindings_set_item().
So it looks like this can be achieved with current Geany.
Thanks! I'll take a look.
Not sure I completely understood this, but this sounds very much like not a keybinding issue.
The expected behavior is that ctrl+tab and ctrl+shift+tab switch the notebook page of whatever notebook their are in (the inner-most notebook in case of nested ones - this is sometimes inconvinient).
So if the sidebar is focussed, then ctrl+tab will switch pages in the sidebar.
But I don't fully understand what's the problem with this here. Where is this field you want to focus, is it not part of the youor sidebar panel?
The components are within the notebook, but I want to change the default component that is in focus when the tab is selected. For example, in external-tools, I was setting the read-only textarea as focused, so you can highlight the output with the cursor via the keyboard without having to tab into that component first.
So how you propagate the focus is entirely up to you as you control the panel, I don't see why you need to mess with the keybindings.
Did you try gtk_container_set_focus_child() on notebook child?
Best regards
Thanks. I'll try that first. I may have not known about that function, especially at the time I wrote the plugin.
On 07/09/2015 11:48 AM, Thomas Martitz wrote:
So how you propagate the focus is entirely up to you as you control the panel, I don't see why you need to mess with the keybindings.
Did you try gtk_container_set_focus_child() on notebook child?