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

core: add hdata "hotlist"

This commit is contained in:
Sebastien Helleu
2012-07-21 17:32:41 +02:00
parent 7a3e8cf198
commit f426446521
19 changed files with 124 additions and 12 deletions
+1
View File
@@ -9,6 +9,7 @@ Version 0.3.9 (under dev!)
* core: scroll to bottom of window after reaching first or last highlight with
keys alt+"p" / alt+"n"
* core: add hdata "hotlist"
* core: add support of arrays in hdata variables
* core: add command line option "-r" (or "--run-command") to run command(s)
after startup of WeeChat
+11
View File
@@ -405,6 +405,17 @@
'prev_history' (pointer, hdata: 'history') |
-
| weechat | hotlist | hotlist |
'priority' (integer) +
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
'count' (integer, array_size: '4') +
'prev_hotlist' (pointer, hdata: 'hotlist') +
'next_hotlist' (pointer, hdata: 'hotlist') |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | Struktur der Rücknahmen für die Befehlszeile |
'data' (string) +
'pos' (integer) +
+11
View File
@@ -405,6 +405,17 @@
'prev_history' (pointer, hdata: 'history') |
-
| weechat | hotlist | hotlist |
'priority' (integer) +
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
'count' (integer, array_size: '4') +
'prev_hotlist' (pointer, hdata: 'hotlist') +
'next_hotlist' (pointer, hdata: 'hotlist') |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | structure with undo for input line |
'data' (string) +
'pos' (integer) +
+11
View File
@@ -405,6 +405,17 @@
'prev_history' (pointer, hdata: 'history') |
-
| weechat | hotlist | hotlist |
'priority' (integer) +
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
'count' (integer, array_size: '4') +
'prev_hotlist' (pointer, hdata: 'hotlist') +
'next_hotlist' (pointer, hdata: 'hotlist') |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | structure avec le "undo" pour la ligne de commande |
'data' (string) +
'pos' (integer) +
+11
View File
@@ -405,6 +405,17 @@
'prev_history' (pointer, hdata: 'history') |
-
| weechat | hotlist | hotlist |
'priority' (integer) +
'creation_time.tv_sec' (time) +
'creation_time.tv_usec' (long) +
'buffer' (pointer) +
'count' (integer, array_size: '4') +
'prev_hotlist' (pointer, hdata: 'hotlist') +
'next_hotlist' (pointer, hdata: 'hotlist') |
'gui_hotlist' +
'last_gui_hotlist'
| weechat | input_undo | struttura con "undo"per la riga di input |
'data' (string) +
'pos' (integer) +
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7249,6 +7249,9 @@ msgstr ""
msgid "history of commands in buffer"
msgstr "historie příkazů"
msgid "hotlist"
msgstr ""
#, fuzzy
msgid "structure with undo for input line"
msgstr "funkce pro příkazovou řádku"
+4 -1
View File
@@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-30 14:28+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@@ -7764,6 +7764,9 @@ msgstr "Filter"
msgid "history of commands in buffer"
msgstr "Verlaufspeicher von Befehlen in einem Buffer"
msgid "hotlist"
msgstr ""
msgid "structure with undo for input line"
msgstr "Struktur der Rücknahmen für die Befehlszeile"
+4 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7509,6 +7509,9 @@ msgstr "filtro"
msgid "history of commands in buffer"
msgstr "historial de comandos en el buffer"
msgid "hotlist"
msgstr ""
msgid "structure with undo for input line"
msgstr "estructura con deshacer para la línea de entrada"
+5 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 23:10+0200\n"
"PO-Revision-Date: 2012-07-16 09:30+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-07-21 17:23+0200\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@@ -7563,6 +7563,9 @@ msgstr "filtre"
msgid "history of commands in buffer"
msgstr "historique des commandes dans le tampon"
msgid "hotlist"
msgstr "hotlist"
msgid "structure with undo for input line"
msgstr "structure avec le \"undo\" pour la ligne de commande"
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6769,6 +6769,9 @@ msgstr ""
msgid "history of commands in buffer"
msgstr "%s belső parancsok:\n"
msgid "hotlist"
msgstr ""
#, fuzzy
msgid "structure with undo for input line"
msgstr "szöveg beillesztése a parancssorba"
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7494,6 +7494,9 @@ msgstr "filtro"
msgid "history of commands in buffer"
msgstr "cronologia dei comandi nel buffer"
msgid "hotlist"
msgstr ""
msgid "structure with undo for input line"
msgstr "struttura con \"undo\"per la riga di input"
+4 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@@ -7303,6 +7303,9 @@ msgstr "フィルタ"
msgid "history of commands in buffer"
msgstr "バッファのコマンド履歴"
msgid "hotlist"
msgstr ""
msgid "structure with undo for input line"
msgstr "入力行をアンドゥする構造"
+4 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -7438,6 +7438,9 @@ msgstr "filtr"
msgid "history of commands in buffer"
msgstr "historia komend w buforze"
msgid "hotlist"
msgstr ""
msgid "structure with undo for input line"
msgstr "struktura z cofnięciem dla linii komend"
+4 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6917,6 +6917,9 @@ msgstr "filtro"
msgid "history of commands in buffer"
msgstr "histórico de comandos no buffer"
msgid "hotlist"
msgstr ""
msgid "structure with undo for input line"
msgstr "estrutura com desfazer para linha de entrada"
+4 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.9-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+0200\n"
"PO-Revision-Date: 2012-06-03 09:49+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -6793,6 +6793,9 @@ msgstr ""
msgid "history of commands in buffer"
msgstr "Внутренние команды %s:\n"
msgid "hotlist"
msgstr ""
#, fuzzy
msgid "structure with undo for input line"
msgstr "вставить строку в поле ввода"
+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: 2012-07-15 09:18+0200\n"
"POT-Creation-Date: 2012-07-21 17:23+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"
@@ -5923,6 +5923,9 @@ msgstr ""
msgid "history of commands in buffer"
msgstr ""
msgid "hotlist"
msgstr ""
msgid "structure with undo for input line"
msgstr ""
+29
View File
@@ -32,6 +32,7 @@
#include "../core/weechat.h"
#include "../core/wee-config.h"
#include "../core/wee-hashtable.h"
#include "../core/wee-hdata.h"
#include "../core/wee-hook.h"
#include "../core/wee-infolist.h"
#include "../core/wee-log.h"
@@ -460,6 +461,34 @@ gui_hotlist_remove_buffer (struct t_gui_buffer *buffer)
gui_hotlist_changed_signal ();
}
/*
* gui_hotlist_hdata_hotlist_cb: return hdata for hotlist
*/
struct t_hdata *
gui_hotlist_hdata_hotlist_cb (void *data, const char *hdata_name)
{
struct t_hdata *hdata;
/* make C compiler happy */
(void) data;
hdata = hdata_new (NULL, hdata_name, "prev_hotlist", "next_hotlist");
if (hdata)
{
HDATA_VAR(struct t_gui_hotlist, priority, INTEGER, NULL, NULL);
HDATA_VAR(struct t_gui_hotlist, creation_time.tv_sec, TIME, NULL, NULL);
HDATA_VAR(struct t_gui_hotlist, creation_time.tv_usec, LONG, NULL, NULL);
HDATA_VAR(struct t_gui_hotlist, buffer, POINTER, NULL, NULL);
HDATA_VAR(struct t_gui_hotlist, count, INTEGER, GUI_HOTLIST_NUM_PRIORITIES_STR, NULL);
HDATA_VAR(struct t_gui_hotlist, prev_hotlist, POINTER, NULL, hdata_name);
HDATA_VAR(struct t_gui_hotlist, next_hotlist, POINTER, NULL, hdata_name);
HDATA_LIST(gui_hotlist);
HDATA_LIST(last_gui_hotlist);
}
return hdata;
}
/*
* gui_hotlist_add_to_infolist: add a hotlist in an infolist
* return 1 if ok, 0 if error
+3
View File
@@ -29,6 +29,7 @@ enum t_gui_hotlist_priority
/* number of priorities */
GUI_HOTLIST_NUM_PRIORITIES,
};
#define GUI_HOTLIST_NUM_PRIORITIES_STR "4"
#define GUI_HOTLIST_MIN 0
#define GUI_HOTLIST_MAX (GUI_HOTLIST_NUM_PRIORITIES - 1)
@@ -59,6 +60,8 @@ extern struct t_gui_hotlist *gui_hotlist_add (struct t_gui_buffer *buffer,
extern void gui_hotlist_resort ();
extern void gui_hotlist_clear ();
extern void gui_hotlist_remove_buffer (struct t_gui_buffer *buffer);
extern struct t_hdata *gui_hotlist_hdata_hotlist_cb (void *data,
const char *hdata_name);
extern int gui_hotlist_add_to_infolist (struct t_infolist *infolist,
struct t_gui_hotlist *hotlist);
extern void gui_hotlist_print_log ();
+2
View File
@@ -1129,6 +1129,8 @@ plugin_api_init ()
&gui_filter_hdata_filter_cb, NULL);
hook_hdata (NULL, "history", N_("history of commands in buffer"),
&gui_history_hdata_history_cb, NULL);
hook_hdata (NULL, "hotlist", N_("hotlist"),
&gui_hotlist_hdata_hotlist_cb, NULL);
hook_hdata (NULL, "input_undo", N_("structure with undo for input line"),
&gui_buffer_hdata_input_undo_cb, NULL);
hook_hdata (NULL, "key", N_("a key (keyboard shortcut)"),