Kaydet (Commit) 745f424b authored tarafından Jiří Techet's avatar Jiří Techet Kaydeden (comit) Matthew Brush

Export keybindings_load_keyfile() for plugins

This allows plugins to reload keybindings later during their execution.
For more info see the comment in the commit.

Closes #1430
üst 169feae9
...@@ -824,6 +824,15 @@ static void apply_kb_accel(GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer u ...@@ -824,6 +824,15 @@ static void apply_kb_accel(GeanyKeyGroup *group, GeanyKeyBinding *kb, gpointer u
} }
/** Reloads keybinding settings from configuration file. Normally plugins do
* not need to call this function as it is called automatically when a the
* plugin is activated. However, plugins which need to create keybindings
* dynamically and reload them when needed should call this function after
* all keybindings have been updated with plugin_set_key_group() and
* keybindings_set_item() calls - this makes sure that the corresponding user
* keybinding shortcuts are applied.
* @since 1.31. */
GEANY_API_SYMBOL
void keybindings_load_keyfile(void) void keybindings_load_keyfile(void)
{ {
load_user_kb(); load_user_kb();
......
...@@ -293,6 +293,8 @@ GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id); ...@@ -293,6 +293,8 @@ GeanyKeyBinding *keybindings_get_item(GeanyKeyGroup *group, gsize key_id);
GdkModifierType keybindings_get_modifiers(GdkModifierType mods); GdkModifierType keybindings_get_modifiers(GdkModifierType mods);
void keybindings_load_keyfile(void);
#ifdef GEANY_PRIVATE #ifdef GEANY_PRIVATE
extern GPtrArray *keybinding_groups; /* array of GeanyKeyGroup pointers */ extern GPtrArray *keybinding_groups; /* array of GeanyKeyGroup pointers */
...@@ -300,8 +302,6 @@ extern GPtrArray *keybinding_groups; /* array of GeanyKeyGroup pointers */ ...@@ -300,8 +302,6 @@ extern GPtrArray *keybinding_groups; /* array of GeanyKeyGroup pointers */
void keybindings_init(void); void keybindings_init(void);
void keybindings_load_keyfile(void);
void keybindings_free(void); void keybindings_free(void);
GeanyKeyGroup *keybindings_get_core_group(guint id); GeanyKeyGroup *keybindings_get_core_group(guint id);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment