diff --git a/ChangeLog b/ChangeLog index 1c468dbdd..cd3ae03b4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -47,6 +47,7 @@ Version 0.3.6 (under dev!) * core: add options "infolists", "hdata" and "tags" for command /debug * core: add horizontal scrolling for buffers with free content (command /window scroll_horiz) (task #11112) +* api: use arguments for infolist "window" to return only one window by number * api: add info "cursor_mode" * api: add new functions hook_focus, hdata_new, hdata_new_var, hdata_new_list, hdata_get, hdata_get_var_offset, hdata_get_var_type, diff --git a/doc/de/autogen/plugin_api/infolists.txt b/doc/de/autogen/plugin_api/infolists.txt index 18e7b7965..c1ff09d08 100644 --- a/doc/de/autogen/plugin_api/infolists.txt +++ b/doc/de/autogen/plugin_api/infolists.txt @@ -56,7 +56,7 @@ | weechat | plugin | Auflistung der Erweiterungen | Pointer der Erweiterung (optional) | Name einer Erweiterung (darf mit einem "*" als Platzhalter beginnen oder enden) (optional) -| weechat | window | Auflistung der Windows | Fenster Pointer (optional) | Fenstername (darf mit einem "*" als Platzhalter beginnen oder enden) (optional) +| weechat | window | Auflistung der Windows | Fenster Pointer (optional) | "current" for current window or a window number (optional) | xfer | xfer | Transfer-Liste | Transfer-Pointer (optional) | - diff --git a/doc/en/autogen/plugin_api/infolists.txt b/doc/en/autogen/plugin_api/infolists.txt index 90f17b1dc..88534c235 100644 --- a/doc/en/autogen/plugin_api/infolists.txt +++ b/doc/en/autogen/plugin_api/infolists.txt @@ -56,7 +56,7 @@ | weechat | plugin | list of plugins | plugin pointer (optional) | plugin name (can start or end with "*" as wildcard) (optional) -| weechat | window | list of windows | window pointer (optional) | window name (can start or end with "*" as wildcard) (optional) +| weechat | window | list of windows | window pointer (optional) | "current" for current window or a window number (optional) | xfer | xfer | list of xfer | xfer pointer (optional) | - diff --git a/doc/fr/autogen/plugin_api/infolists.txt b/doc/fr/autogen/plugin_api/infolists.txt index f65d8c737..fca6e7ea1 100644 --- a/doc/fr/autogen/plugin_api/infolists.txt +++ b/doc/fr/autogen/plugin_api/infolists.txt @@ -56,7 +56,7 @@ | weechat | plugin | liste des extensions | pointeur vers l'extension (optionnel) | nom d'extension (peut démarrer ou se terminer par "*" comme joker) (optionnel) -| weechat | window | liste des fenêtres | pointeur vers la fenêtre (optionnel) | nom de fenêtre (peut démarrer ou se terminer par "*" comme joker) (optionnel) +| weechat | window | liste des fenêtres | pointeur vers la fenêtre (optionnel) | "current" pour la fenêtre courante ou un numéro de fenêtre (optionnel) | xfer | xfer | liste des xfer | pointeur vers le xfer (optionnel) | - diff --git a/doc/it/autogen/plugin_api/infolists.txt b/doc/it/autogen/plugin_api/infolists.txt index cff831ebb..4b6700509 100644 --- a/doc/it/autogen/plugin_api/infolists.txt +++ b/doc/it/autogen/plugin_api/infolists.txt @@ -56,7 +56,7 @@ | weechat | plugin | elenco dei plugin | puntatore al plugin (opzionale) | nome plugin (può iniziare o terminare con "*" come carattere jolly) (opzionale) -| weechat | window | elenco delle finestre | puntatore alla finestra (opzionale) | nome finestra (può iniziare o terminare con "*" come carattere jolly) (opzionale) +| weechat | window | elenco delle finestre | puntatore alla finestra (opzionale) | "current" for current window or a window number (optional) | xfer | xfer | lista di xfer | puntatore a xfer (opzionale) | - diff --git a/po/cs.po b/po/cs.po index 1555f80b4..bab167c90 100644 --- a/po/cs.po +++ b/po/cs.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: 2011-07-05 15:37+0200\n" "Last-Translator: Jiri Golembiovsky \n" "Language-Team: weechat-dev \n" @@ -6790,9 +6790,8 @@ msgstr "seznam oken" msgid "window pointer (optional)" msgstr "ukazatel okna (volitelné)" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" -"jméno okna (může začínat nebo končit \"*\" jako zástupným znakem) (volitelné)" msgid "bar" msgstr "" @@ -7951,6 +7950,11 @@ msgstr "" msgid "Lists" msgstr "" +#~ msgid "window name (can start or end with \"*\" as wildcard) (optional)" +#~ msgstr "" +#~ "jméno okna (může začínat nebo končit \"*\" jako zástupným znakem) " +#~ "(volitelné)" + #~ msgid "" #~ "channel: channel for ban\n" #~ " nick: user or host to ban" diff --git a/po/de.po b/po/de.po index e4630979d..fde717bd7 100644 --- a/po/de.po +++ b/po/de.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: 2011-07-14 20:53+0100\n" "Last-Translator: Nils Görs\n" "Language-Team: weechat-dev \n" @@ -7099,10 +7099,8 @@ msgstr "Auflistung der Windows" msgid "window pointer (optional)" msgstr "Fenster Pointer (optional)" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" -"Fenstername (darf mit einem \"*\" als Platzhalter beginnen oder enden) " -"(optional)" msgid "bar" msgstr "Bar" @@ -8280,6 +8278,11 @@ msgstr "Variablen" msgid "Lists" msgstr "Listen" +#~ msgid "window name (can start or end with \"*\" as wildcard) (optional)" +#~ msgstr "" +#~ "Fenstername (darf mit einem \"*\" als Platzhalter beginnen oder enden) " +#~ "(optional)" + #~ msgid "" #~ "channel: channel for ban\n" #~ " nick: user or host to ban" diff --git a/po/es.po b/po/es.po index bc02a4bee..2c875ed9d 100644 --- a/po/es.po +++ b/po/es.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: 2011-07-05 15:37+0200\n" "Last-Translator: Elián Hanisch \n" "Language-Team: weechat-dev \n" @@ -6896,10 +6896,8 @@ msgstr "lista de ventanas" msgid "window pointer (optional)" msgstr "puntero de la ventana (opcional)" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" -"nombre de la ventana (puede empezar o terminar con \"*\" como comodín) " -"(opcional)" msgid "bar" msgstr "" @@ -8081,6 +8079,11 @@ msgstr "" msgid "Lists" msgstr "" +#~ msgid "window name (can start or end with \"*\" as wildcard) (optional)" +#~ msgstr "" +#~ "nombre de la ventana (puede empezar o terminar con \"*\" como comodín) " +#~ "(opcional)" + #~ msgid "" #~ "channel: channel for ban\n" #~ " nick: user or host to ban" diff --git a/po/fr.po b/po/fr.po index 32c5c5881..0e7f6d75a 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" -"PO-Revision-Date: 2011-08-08 11:20+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" +"PO-Revision-Date: 2011-08-08 11:28+0200\n" "Last-Translator: Sebastien Helleu \n" "Language-Team: weechat-dev \n" "Language: French\n" @@ -7004,10 +7004,9 @@ msgstr "liste des fenêtres" msgid "window pointer (optional)" msgstr "pointeur vers la fenêtre (optionnel)" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" -"nom de fenêtre (peut démarrer ou se terminer par \"*\" comme joker) " -"(optionnel)" +"\"current\" pour la fenêtre courante ou un numéro de fenêtre (optionnel)" msgid "bar" msgstr "barre" @@ -8178,6 +8177,11 @@ msgstr "Variables" msgid "Lists" msgstr "Listes" +#~ msgid "window name (can start or end with \"*\" as wildcard) (optional)" +#~ msgstr "" +#~ "nom de fenêtre (peut démarrer ou se terminer par \"*\" comme joker) " +#~ "(optionnel)" + #~ msgid "" #~ "channel: channel for ban\n" #~ " nick: user or host to ban" diff --git a/po/hu.po b/po/hu.po index 6a9012ac2..227489194 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: 2011-05-15 10:51+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -6349,7 +6349,7 @@ msgstr "Mellőzések listája:\n" msgid "window pointer (optional)" msgstr "" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" msgid "bar" diff --git a/po/it.po b/po/it.po index e4b19b658..eec263f89 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: 2011-07-16 11:32+0200\n" "Last-Translator: Marco Paolone \n" "Language-Team: weechat-dev \n" @@ -6909,10 +6909,8 @@ msgstr "elenco delle finestre" msgid "window pointer (optional)" msgstr "puntatore alla finestra (opzionale)" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" -"nome finestra (può iniziare o terminare con \"*\" come carattere jolly) " -"(opzionale)" msgid "bar" msgstr "barra" @@ -8066,6 +8064,11 @@ msgstr "Variabili" msgid "Lists" msgstr "Liste" +#~ msgid "window name (can start or end with \"*\" as wildcard) (optional)" +#~ msgstr "" +#~ "nome finestra (può iniziare o terminare con \"*\" come carattere jolly) " +#~ "(opzionale)" + #~ msgid "" #~ "channel: channel for ban\n" #~ " nick: user or host to ban" diff --git a/po/pl.po b/po/pl.po index b81681ff7..f7434e2ee 100644 --- a/po/pl.po +++ b/po/pl.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: 2011-07-05 15:38+0200\n" "Last-Translator: Krzysztof Koroscik \n" "Language-Team: weechat-dev \n" @@ -6824,8 +6824,8 @@ msgstr "lista okien" msgid "window pointer (optional)" msgstr "wskaźnik okna (opcjonalne)" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" -msgstr "nazwa okna (może się zaczynać lub kończyć \"*\") (opcjonalne)" +msgid "\"current\" for current window or a window number (optional)" +msgstr "" msgid "bar" msgstr "" @@ -7985,6 +7985,9 @@ msgstr "" msgid "Lists" msgstr "" +#~ msgid "window name (can start or end with \"*\" as wildcard) (optional)" +#~ msgstr "nazwa okna (może się zaczynać lub kończyć \"*\") (opcjonalne)" + #~ msgid "" #~ "channel: channel for ban\n" #~ " nick: user or host to ban" diff --git a/po/pt_BR.po b/po/pt_BR.po index 248654878..0ce34258d 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: 2011-05-15 10:52+0200\n" "Last-Translator: Ivan Sichmann Freitas \n" "Language-Team: weechat-dev \n" @@ -6163,7 +6163,7 @@ msgstr "" msgid "window pointer (optional)" msgstr "" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" msgid "bar" diff --git a/po/ru.po b/po/ru.po index 630000276..9c7a4f3e2 100644 --- a/po/ru.po +++ b/po/ru.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat 0.3.6-dev\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: 2011-05-15 10:52+0200\n" "Last-Translator: Pavel Shevchuk \n" "Language-Team: weechat-dev \n" @@ -6364,7 +6364,7 @@ msgstr "Список игнорирования:\n" msgid "window pointer (optional)" msgstr "" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" msgid "bar" diff --git a/po/weechat.pot b/po/weechat.pot index b9ad20b39..809eaac3e 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: 2011-08-08 11:19+0200\n" +"POT-Creation-Date: 2011-08-08 11:27+0200\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "Last-Translator: FULL NAME \n" "Language-Team: LANGUAGE \n" @@ -5538,7 +5538,7 @@ msgstr "" msgid "window pointer (optional)" msgstr "" -msgid "window name (can start or end with \"*\" as wildcard) (optional)" +msgid "\"current\" for current window or a window number (optional)" msgstr "" msgid "bar" diff --git a/src/plugins/plugin-api.c b/src/plugins/plugin-api.c index 0dd8cbc9b..7ac39977e 100644 --- a/src/plugins/plugin-api.c +++ b/src/plugins/plugin-api.c @@ -400,7 +400,8 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name, struct t_gui_key *ptr_key; struct t_weechat_plugin *ptr_plugin; char buffer_full_name[1024]; - int context; + int context, number; + char *error; /* make C compiler happy */ (void) data; @@ -796,16 +797,36 @@ plugin_api_infolist_get_internal (void *data, const char *infolist_name, { if (arguments && arguments[0]) { - if ((string_strcasecmp (arguments, "current") == 0) - && gui_current_window) + if ((string_strcasecmp (arguments, "current") == 0)) { - if (!gui_window_add_to_infolist (ptr_infolist, - gui_current_window)) + if (gui_current_window) { - infolist_free (ptr_infolist); - return NULL; + if (!gui_window_add_to_infolist (ptr_infolist, + gui_current_window)) + { + infolist_free (ptr_infolist); + return NULL; + } + return ptr_infolist; + } + return NULL; + } + /* check if argument is a window number */ + error = NULL; + number = (int)strtol (arguments, &error, 10); + if (error && !error[0]) + { + ptr_window = gui_window_search_by_number (number); + if (ptr_window) + { + if (!gui_window_add_to_infolist (ptr_infolist, + ptr_window)) + { + infolist_free (ptr_infolist); + return NULL; + } + return ptr_infolist; } - return ptr_infolist; } return NULL; } @@ -1065,7 +1086,7 @@ plugin_api_init () &plugin_api_infolist_get_internal, NULL); hook_infolist (NULL, "window", N_("list of windows"), N_("window pointer (optional)"), - N_("window name (can start or end with \"*\" as wildcard) (optional)"), + N_("\"current\" for current window or a window number (optional)"), &plugin_api_infolist_get_internal, NULL); /* WeeChat core hdata */