1
0
mirror of https://github.com/weechat/weechat.git synced 2026-07-06 01:33:12 +02:00

Add infolist with commands history

This commit is contained in:
Sebastien Helleu
2009-06-10 19:13:38 +02:00
parent b67da8860c
commit d7ad1780ad
13 changed files with 99 additions and 10 deletions
+2
View File
@@ -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
+2
View File
@@ -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
+5 -1
View File
@@ -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"
@@ -4972,6 +4972,10 @@ msgstr "nevalidní délka pro buffer"
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"
+5 -1
View File
@@ -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"
@@ -4922,6 +4922,10 @@ msgstr "konnte den Puffer nicht laden"
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"
+5 -1
View File
@@ -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"
@@ -4911,6 +4911,10 @@ msgstr "falló al cargar el búfer"
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"
+5 -2
View File
@@ -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"
+5 -1
View File
@@ -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"
@@ -4982,6 +4982,10 @@ msgstr "puffer betöltése sikertelen"
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"
+5 -1
View File
@@ -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 ""
+5 -1
View File
@@ -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"
@@ -4955,6 +4955,10 @@ msgstr "загрузка буфера не удалась"
msgid "list of filters"
msgstr "Список сокращений:\n"
#, fuzzy
msgid "history of commands"
msgstr "Внутренние команды %s:\n"
#, fuzzy
msgid "list of hooks"
msgstr "Список сокращений:\n"
+4 -1
View File
@@ -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 ""
+26
View File
@@ -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;
}
+4 -1
View File
@@ -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 */
+26
View File
@@ -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"),