diff options
-rw-r--r-- | doc/en/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | doc/fr/autogen/plugin_api/infolists.txt | 2 | ||||
-rw-r--r-- | po/cs.po | 6 | ||||
-rw-r--r-- | po/de.po | 6 | ||||
-rw-r--r-- | po/es.po | 6 | ||||
-rw-r--r-- | po/fr.po | 7 | ||||
-rw-r--r-- | po/hu.po | 6 | ||||
-rw-r--r-- | po/pl.po | 6 | ||||
-rw-r--r-- | po/ru.po | 6 | ||||
-rw-r--r-- | po/weechat.pot | 5 | ||||
-rw-r--r-- | src/gui/gui-history.c | 26 | ||||
-rw-r--r-- | src/gui/gui-history.h | 5 | ||||
-rw-r--r-- | src/plugins/plugin-api.c | 26 |
13 files changed, 99 insertions, 10 deletions
diff --git a/doc/en/autogen/plugin_api/infolists.txt b/doc/en/autogen/plugin_api/infolists.txt index 1d2c157e5..29fe8db69 100644 --- a/doc/en/autogen/plugin_api/infolists.txt +++ b/doc/en/autogen/plugin_api/infolists.txt @@ -37,6 +37,8 @@ | weechat | filter | list of filters +| weechat | history | history of commands + | weechat | hook | list of hooks | weechat | hotlist | list of buffers in hotlist diff --git a/doc/fr/autogen/plugin_api/infolists.txt b/doc/fr/autogen/plugin_api/infolists.txt index 0e75f8653..225ec774d 100644 --- a/doc/fr/autogen/plugin_api/infolists.txt +++ b/doc/fr/autogen/plugin_api/infolists.txt @@ -37,6 +37,8 @@ | weechat | filter | liste des filtres +| weechat | history | historique des commandes + | weechat | hook | liste des hooks | weechat | hotlist | liste des tampons dans la hotlist @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.0-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-06-10 13:00+0200\n" +"POT-Creation-Date: 2009-06-10 19:09+0200\n" "PO-Revision-Date: 2009-05-11 13:02+0200\n" "Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4973,6 +4973,10 @@ msgid "list of filters" msgstr "Seznam pro aliasy:\n" #, fuzzy +msgid "history of commands" +msgstr "Další příkazy:" + +#, fuzzy msgid "list of hooks" msgstr "Seznam pro aliasy:\n" @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.0-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-06-10 13:00+0200\n" +"POT-Creation-Date: 2009-06-10 19:09+0200\n" "PO-Revision-Date: 2009-05-11 13:02+0200\n" "Last-Translator: Thomas Schuetz <i18n@internet-villa.de>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4923,6 +4923,10 @@ msgid "list of filters" msgstr "Liste der Aliases:\n" #, fuzzy +msgid "history of commands" +msgstr "%s interne Befehle:\n" + +#, fuzzy msgid "list of hooks" msgstr "Liste der Aliases:\n" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.0-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-06-10 13:00+0200\n" +"POT-Creation-Date: 2009-06-10 19:09+0200\n" "PO-Revision-Date: 2009-05-11 13:02+0200\n" "Last-Translator: Roberto González Cardenete <robert.glez@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4912,6 +4912,10 @@ msgid "list of filters" msgstr "Lista de alias:\n" #, fuzzy +msgid "history of commands" +msgstr "Comandos internos %s :\n" + +#, fuzzy msgid "list of hooks" msgstr "Lista de alias:\n" @@ -6,8 +6,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.0-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-06-10 13:00+0200\n" -"PO-Revision-Date: 2009-06-10 13:05+0200\n" +"POT-Creation-Date: 2009-06-10 19:09+0200\n" +"PO-Revision-Date: 2009-06-10 19:09+0200\n" "Last-Translator: FlashCode <flashcode@flashtux.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" "MIME-Version: 1.0\n" @@ -5136,6 +5136,9 @@ msgstr "lignes d'un tampon" msgid "list of filters" msgstr "liste des filtres" +msgid "history of commands" +msgstr "historique des commandes" + msgid "list of hooks" msgstr "liste des hooks" @@ -12,7 +12,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.0-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-06-10 13:00+0200\n" +"POT-Creation-Date: 2009-06-10 19:09+0200\n" "PO-Revision-Date: 2009-05-11 13:02+0200\n" "Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4983,6 +4983,10 @@ msgid "list of filters" msgstr "Aliaszok listája:\n" #, fuzzy +msgid "history of commands" +msgstr "%s belső parancsok:\n" + +#, fuzzy msgid "list of hooks" msgstr "Aliaszok listája:\n" @@ -9,7 +9,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.0-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-06-10 13:00+0200\n" +"POT-Creation-Date: 2009-06-10 19:09+0200\n" "PO-Revision-Date: 2009-05-11 13:02+0200\n" "Last-Translator: <soltys@szluug.org>\n" "Language-Team: Polish\n" @@ -4299,6 +4299,10 @@ msgstr "" msgid "list of filters" msgstr "" +#, fuzzy +msgid "history of commands" +msgstr "Pozostałe komendy:" + msgid "list of hooks" msgstr "" @@ -6,7 +6,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.0-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-06-10 13:00+0200\n" +"POT-Creation-Date: 2009-06-10 19:09+0200\n" "PO-Revision-Date: 2009-05-11 13:02+0200\n" "Last-Translator: Pavel Shevchuk <stlwrt@gmail.com>\n" "Language-Team: weechat-dev <weechat-dev@nongnu.org>\n" @@ -4956,6 +4956,10 @@ msgid "list of filters" msgstr "Список сокращений:\n" #, fuzzy +msgid "history of commands" +msgstr "Внутренние команды %s:\n" + +#, fuzzy msgid "list of hooks" msgstr "Список сокращений:\n" diff --git a/po/weechat.pot b/po/weechat.pot index fa856c3bc..e8f27fca2 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2009-06-10 13:00+0200\n" +"POT-Creation-Date: 2009-06-10 19:09+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Language-Team: LANGUAGE <LL@li.org>\n" @@ -4262,6 +4262,9 @@ msgstr "" msgid "list of filters" msgstr "" +msgid "history of commands" +msgstr "" + msgid "list of hooks" msgstr "" diff --git a/src/gui/gui-history.c b/src/gui/gui-history.c index 6c32626f6..e8e316b25 100644 --- a/src/gui/gui-history.c +++ b/src/gui/gui-history.c @@ -28,6 +28,7 @@ #include "../core/weechat.h" #include "../core/wee-config.h" +#include "../core/wee-infolist.h" #include "../core/wee-string.h" #include "gui-history.h" #include "gui-buffer.h" @@ -185,3 +186,28 @@ gui_history_buffer_free (struct t_gui_buffer *buffer) buffer->ptr_history = NULL; buffer->num_history = 0; } + +/* + * gui_history_add_to_infolist: add history of commands in an infolist + * if buffer is NULL, global history is returned + * return 1 if ok, 0 if error + */ + +int +gui_history_add_to_infolist (struct t_infolist *infolist, + struct t_gui_history *history) +{ + struct t_infolist_item *ptr_item; + + if (!infolist || !history) + return 0; + + ptr_item = infolist_new_item (infolist); + if (!ptr_item) + return 0; + + if (!infolist_new_var_string (ptr_item, "text", history->text)) + return 0; + + return 1; +} diff --git a/src/gui/gui-history.h b/src/gui/gui-history.h index 501c201e2..e51c0072d 100644 --- a/src/gui/gui-history.h +++ b/src/gui/gui-history.h @@ -33,9 +33,12 @@ extern struct t_gui_history *history_global; extern struct t_gui_history *last_history_global; extern struct t_gui_history *history_global_ptr; -extern void gui_history_buffer_add (struct t_gui_buffer *buffer, const char *string); +extern void gui_history_buffer_add (struct t_gui_buffer *buffer, + const char *string); extern void gui_history_global_add (const char *string); extern void gui_history_global_free (); extern void gui_history_buffer_free (struct t_gui_buffer *buffer); +extern int gui_history_add_to_infolist (struct t_infolist *infolist, + struct t_gui_history *history); #endif /* gui-history.h */ diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 754f75ae2..215462426 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -45,6 +45,7 @@ #include "../gui/gui-chat.h" #include "../gui/gui-color.h" #include "../gui/gui-filter.h" +#include "../gui/gui-history.h" #include "../gui/gui-hotlist.h" #include "../gui/gui-keyboard.h" #include "../gui/gui-line.h" @@ -334,6 +335,7 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name, struct t_gui_bar_window *ptr_bar_window; struct t_gui_buffer *ptr_buffer; struct t_gui_line *ptr_line; + struct t_gui_history *ptr_history; struct t_gui_filter *ptr_filter; struct t_gui_window *ptr_window; struct t_gui_hotlist *ptr_hotlist; @@ -567,6 +569,28 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name, return ptr_infolist; } } + else if (string_strcasecmp (infolist_name, "history") == 0) + { + /* invalid buffer pointer ? */ + if (pointer && (!gui_buffer_valid (pointer))) + return NULL; + + ptr_infolist = infolist_new (); + if (ptr_infolist) + { + for (ptr_history = (pointer) ? + ((struct t_gui_buffer *)pointer)->history : history_global; + ptr_history; ptr_history = ptr_history->next_history) + { + if (!gui_history_add_to_infolist (ptr_infolist, ptr_history)) + { + infolist_free (ptr_infolist); + return NULL; + } + } + return ptr_infolist; + } + } else if (string_strcasecmp (infolist_name, "hook") == 0) { ptr_infolist = infolist_new (); @@ -918,6 +942,8 @@ plugin_api_init () &plugin_api_infolist_get_internal, NULL); hook_infolist (NULL, "filter", N_("list of filters"), &plugin_api_infolist_get_internal, NULL); + hook_infolist (NULL, "history", N_("history of commands"), + &plugin_api_infolist_get_internal, NULL); hook_infolist (NULL, "hook", N_("list of hooks"), &plugin_api_infolist_get_internal, NULL); hook_infolist (NULL, "hotlist", N_("list of buffers in hotlist"), |