1
0
mirror of https://github.com/weechat/weechat.git synced 2026-06-30 06:46:38 +02:00

Add infolist "key" with key bindings

This commit is contained in:
Sebastien Helleu
2009-05-16 00:47:14 +02:00
parent 041b754980
commit 947ae241ce
14 changed files with 110 additions and 9 deletions
+19
View File
@@ -316,6 +316,7 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name,
struct t_gui_filter *ptr_filter;
struct t_gui_window *ptr_window;
struct t_gui_hotlist *ptr_hotlist;
struct t_gui_key *ptr_key;
struct t_weechat_plugin *ptr_plugin;
char buffer_full_name[1024];
@@ -574,6 +575,22 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name,
return ptr_infolist;
}
}
else if (string_strcasecmp (infolist_name, "key") == 0)
{
ptr_infolist = infolist_new ();
if (ptr_infolist)
{
for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key)
{
if (!gui_keyboard_add_to_infolist (ptr_infolist, ptr_key))
{
infolist_free (ptr_infolist);
return NULL;
}
}
return ptr_infolist;
}
}
else if (string_strcasecmp (infolist_name, "nicklist") == 0)
{
/* invalid buffer pointer ? */
@@ -883,6 +900,8 @@ plugin_api_init ()
&plugin_api_infolist_get_internal, NULL);
hook_infolist (NULL, "hotlist", N_("list of buffers in hotlist"),
&plugin_api_infolist_get_internal, NULL);
hook_infolist (NULL, "key", N_("list of key bindings"),
&plugin_api_infolist_get_internal, NULL);
hook_infolist (NULL, "nicklist", N_("nicks in nicklist for a buffer"),
&plugin_api_infolist_get_internal, NULL);
hook_infolist (NULL, "option", N_("list of options"),