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

core: add completions "filters_names_disabled" and "filters_names_enabled"

They are used in completion of commands `/filter disable` and
`/filter enable`.
This commit is contained in:
Sébastien Helleu
2023-06-10 22:38:54 +02:00
parent 1145d9f188
commit fc91ee59c9
17 changed files with 214 additions and 17 deletions
+1
View File
@@ -36,6 +36,7 @@ New features::
* core, plugins: make many identifiers case sensitive (issue #1872, issue #398, bug #32213)
* core: add item "mouse_status" in default status bar, change default color to lightgreen
* core, trigger: add options weechat.color.chat_status_disabled and weechat.color.chat_status_enabled, remove options trigger.color.trigger and trigger.color.trigger_disabled, add enabled/disabled status color in output of `/filter list` (issue #1820)
* core: add completions "filters_names_disabled" and "filters_names_enabled", used in completion of `/filter disable` and `/filter enable`
* api: add function config_set_version (issue #1238)
* api: don't split on newline by default in functions `command` and `command_options` when `input_multiline` is set to 0
* api: add optional argument with version in info "version_number"
+11 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3014,6 +3014,16 @@ msgstr ""
msgid "names of filters"
msgstr "jména filtrů"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "jména filtrů"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "jména filtrů"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -26,7 +26,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-06-04 11:12+0200\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <kde-i18n-de@kde.org>\n"
@@ -3881,6 +3881,16 @@ msgstr ""
msgid "names of filters"
msgstr "Liste der Filter"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "Liste der Filter"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "Liste der Filter"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Santiago Forero <santiago@forero.xyz>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3565,6 +3565,16 @@ msgstr ""
msgid "names of filters"
msgstr "nombre de los filtros"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "nombre de los filtros"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "nombre de los filtros"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+8 -2
View File
@@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"PO-Revision-Date: 2023-06-10 20:30+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-06-10 22:37+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@@ -3791,6 +3791,12 @@ msgstr ""
msgid "names of filters"
msgstr "noms des filtres"
msgid "names of disabled filters"
msgstr "noms des filtres désactivés"
msgid "names of enabled filters"
msgstr "noms des filtres activés"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+9 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2657,6 +2657,14 @@ msgstr ""
msgid "names of filters"
msgstr "Aliaszok listája:\n"
#, fuzzy
msgid "names of disabled filters"
msgstr "Aliaszok listája:\n"
#, fuzzy
msgid "names of enabled filters"
msgstr "Aliaszok listája:\n"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3170,6 +3170,16 @@ msgstr ""
msgid "names of filters"
msgstr "nomi dei filtri"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "nomi dei filtri"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "nomi dei filtri"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/master/"
@@ -3739,6 +3739,16 @@ msgstr ""
msgid "names of filters"
msgstr "フィルタ名"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "フィルタ名"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "フィルタ名"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@soltys.info>\n"
"Language-Team: Polish <kde-i18n-doc@kde.org>\n"
@@ -4115,6 +4115,16 @@ msgstr ""
msgid "names of filters"
msgstr "nazwy filtrów"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "nazwy filtrów"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "nazwy filtrów"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Vasco Almeida <vascomalmeida@sapo.pt>\n"
"Language-Team: Portuguese <>\n"
@@ -3723,6 +3723,16 @@ msgstr ""
msgid "names of filters"
msgstr "nomes dos filtros"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "nomes dos filtros"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "nomes dos filtros"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Érico Nogueira <ericonr@disroot.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3258,6 +3258,16 @@ msgstr ""
msgid "names of filters"
msgstr "nomes dos filtros"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "nomes dos filtros"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "nomes dos filtros"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+9 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2679,6 +2679,14 @@ msgstr ""
msgid "names of filters"
msgstr "Список сокращений:\n"
#, fuzzy
msgid "names of disabled filters"
msgstr "Список сокращений:\n"
#, fuzzy
msgid "names of enabled filters"
msgstr "Список сокращений:\n"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-14 15:29+0200\n"
"Last-Translator: Ivan Pešić <ivan.pesic@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3723,6 +3723,16 @@ msgstr ""
msgid "names of filters"
msgstr "имена филтера"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "имена филтера"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "имена филтера"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+11 -1
View File
@@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2023-05-01 20:23+0200\n"
"Last-Translator: Emir SARI <emir_sari@icloud.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -3792,6 +3792,16 @@ msgstr ""
msgid "names of filters"
msgstr "süzgeçlerin adları"
#, fuzzy
#| msgid "names of filters"
msgid "names of disabled filters"
msgstr "süzgeçlerin adları"
#, fuzzy
#| msgid "names of filters"
msgid "names of enabled filters"
msgstr "süzgeçlerin adları"
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+7 -1
View File
@@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2023-06-10 20:29+0200\n"
"POT-Creation-Date: 2023-06-10 22:36+0200\n"
"PO-Revision-Date: 2014-08-16 10:27+0200\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@@ -2449,6 +2449,12 @@ msgstr ""
msgid "names of filters"
msgstr ""
msgid "names of disabled filters"
msgstr ""
msgid "names of enabled filters"
msgstr ""
msgid ""
"commands (weechat and plugins); optional argument: prefix to add before the "
"commands"
+2 -2
View File
@@ -8294,8 +8294,8 @@ command_init ()
"all buffers:\n"
" /filter add sucks2 * * (?-i)^WeeChat sucks$"),
"list"
" || enable %(filters_names)|@"
" || disable %(filters_names)|@"
" || enable %(filters_names_disabled)|@"
" || disable %(filters_names_enabled)|@"
" || toggle %(filters_names)|@"
" || add|addreplace %(filters_names) %(buffers_plugins_names)|*"
" || rename %(filters_names) %(filters_names)"
+68
View File
@@ -861,6 +861,68 @@ completion_list_add_filters_cb (const void *pointer, void *data,
return WEECHAT_RC_OK;
}
/*
* Adds disabled filter names to completion list.
*/
int
completion_list_add_filters_disabled_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_gui_filter *ptr_filter;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
for (ptr_filter = gui_filters; ptr_filter;
ptr_filter = ptr_filter->next_filter)
{
if (!ptr_filter->enabled)
{
gui_completion_list_add (completion, ptr_filter->name,
0, WEECHAT_LIST_POS_SORT);
}
}
return WEECHAT_RC_OK;
}
/*
* Adds enabled filter names to completion list.
*/
int
completion_list_add_filters_enabled_cb (const void *pointer, void *data,
const char *completion_item,
struct t_gui_buffer *buffer,
struct t_gui_completion *completion)
{
struct t_gui_filter *ptr_filter;
/* make C compiler happy */
(void) pointer;
(void) data;
(void) completion_item;
(void) buffer;
for (ptr_filter = gui_filters; ptr_filter;
ptr_filter = ptr_filter->next_filter)
{
if (ptr_filter->enabled)
{
gui_completion_list_add (completion, ptr_filter->name,
0, WEECHAT_LIST_POS_SORT);
}
}
return WEECHAT_RC_OK;
}
/*
* Adds command hooks to completion list.
*/
@@ -1991,6 +2053,12 @@ completion_init ()
hook_completion (NULL, "filters_names", /* formerly "%F" */
N_("names of filters"),
&completion_list_add_filters_cb, NULL, NULL);
hook_completion (NULL, "filters_names_disabled",
N_("names of disabled filters"),
&completion_list_add_filters_disabled_cb, NULL, NULL);
hook_completion (NULL, "filters_names_enabled",
N_("names of enabled filters"),
&completion_list_add_filters_enabled_cb, NULL, NULL);
hook_completion (NULL, "commands", /* formerly "%h" */
N_("commands (weechat and plugins); "
"optional argument: prefix to add before the commands"),