From 12b8ebe4e487ba12642e83d2d29d260b7ca14c0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?S=C3=A9bastien=20Helleu?= Date: Sun, 9 Jun 2024 09:09:09 +0200 Subject: [PATCH] core: add completion "bars_items" --- CHANGELOG.md | 1 + po/cs.po | 7 ++++++- po/de.po | 7 ++++++- po/es.po | 7 ++++++- po/fr.po | 7 +++++-- po/hu.po | 6 +++++- po/it.po | 7 ++++++- po/ja.po | 7 ++++++- po/pl.po | 7 ++++++- po/pt.po | 7 ++++++- po/pt_BR.po | 7 ++++++- po/ru.po | 6 +++++- po/sr.po | 7 ++++++- po/tr.po | 7 ++++++- po/weechat.pot | 5 ++++- src/core/core-completion.c | 31 +++++++++++++++++++++++++++++++ 16 files changed, 111 insertions(+), 15 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index cee4a2c9e..cae195274 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ - relay: add option relay.network.websocket_permessage_deflate ([#1549](https://github.com/weechat/weechat/issues/1549)) - relay: add option relay.look.raw_messages_max_length ([#2122](https://github.com/weechat/weechat/issues/2122)) - relay: add infos "relay_api_version" and "relay_api_version_number" +- core: add completion "bars_items" ### Fixed diff --git a/po/cs.po b/po/cs.po index 90da5f7ca..882f25e3e 100644 --- a/po/cs.po +++ b/po/cs.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Ondřej Súkup \n" "Language-Team: weechat-dev \n" @@ -4028,6 +4028,11 @@ msgstr "" msgid "names of bars" msgstr "jména polí" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "jména polí" + #, fuzzy #| msgid "names of bars" msgid "names of custom bar items" diff --git a/po/de.po b/po/de.po index c66c62ee4..8100d9a76 100644 --- a/po/de.po +++ b/po/de.po @@ -26,7 +26,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-05-31 20:32+0200\n" "Last-Translator: Nils Görs \n" "Language-Team: German \n" @@ -4489,6 +4489,11 @@ msgstr "" msgid "names of bars" msgstr "Namen der Infobars" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "Namen der Infobars" + msgid "names of custom bar items" msgstr "Namen der benutzerdefinierten Bar-Items" diff --git a/po/es.po b/po/es.po index bada0760d..bdbe775f1 100644 --- a/po/es.po +++ b/po/es.po @@ -22,7 +22,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Santiago Forero \n" "Language-Team: weechat-dev \n" @@ -4134,6 +4134,11 @@ msgstr "" msgid "names of bars" msgstr "nombres de barras" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "nombres de barras" + #, fuzzy #| msgid "names of bars" msgid "names of custom bar items" diff --git a/po/fr.po b/po/fr.po index be1f953f8..cb232aa2b 100644 --- a/po/fr.po +++ b/po/fr.po @@ -21,8 +21,8 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" -"PO-Revision-Date: 2024-06-09 09:06+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" +"PO-Revision-Date: 2024-06-09 09:08+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" "Language: fr\n" @@ -4396,6 +4396,9 @@ msgstr "" msgid "names of bars" msgstr "noms des barres" +msgid "names of bar items" +msgstr "noms des objets de barre" + msgid "names of custom bar items" msgstr "noms des objets de barre personnalisés" diff --git a/po/hu.po b/po/hu.po index 558f8b2a1..0da86c713 100644 --- a/po/hu.po +++ b/po/hu.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Andras Voroskoi \n" "Language-Team: weechat-dev \n" @@ -3836,6 +3836,10 @@ msgstr "" msgid "names of bars" msgstr "Aliaszok listája:\n" +#, fuzzy +msgid "names of bar items" +msgstr "Aliaszok listája:\n" + #, fuzzy msgid "names of custom bar items" msgstr "Aliaszok listája:\n" diff --git a/po/it.po b/po/it.po index c28e86744..aa2c965a7 100644 --- a/po/it.po +++ b/po/it.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Esteban I. Ruiz Moreno \n" "Language-Team: weechat-dev \n" @@ -4033,6 +4033,11 @@ msgstr "" msgid "names of bars" msgstr "nomi delle barre" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "nomi delle barre" + #, fuzzy #| msgid "names of bars" msgid "names of custom bar items" diff --git a/po/ja.po b/po/ja.po index c519dc760..7a6605204 100644 --- a/po/ja.po +++ b/po/ja.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: AYANOKOUZI, Ryuunosuke \n" "Language-Team: Japanese \n" "Language-Team: weechat-dev \n" @@ -4276,6 +4276,11 @@ msgstr "" msgid "names of bars" msgstr "nazwy pasków" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "nazwy pasków" + msgid "names of custom bar items" msgstr "nazwy niestandardowych elementów paska" diff --git a/po/pt.po b/po/pt.po index 76f4af118..3ae3b5890 100644 --- a/po/pt.po +++ b/po/pt.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Vasco Almeida \n" "Language-Team: Portuguese <>\n" @@ -4168,6 +4168,11 @@ msgstr "" msgid "names of bars" msgstr "nomes das barras" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "nomes das barras" + #, fuzzy #| msgid "names of bars" msgid "names of custom bar items" diff --git a/po/pt_BR.po b/po/pt_BR.po index 72edc5a11..a0c9fd688 100644 --- a/po/pt_BR.po +++ b/po/pt_BR.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Érico Nogueira \n" "Language-Team: weechat-dev \n" @@ -4069,6 +4069,11 @@ msgstr "" msgid "names of bars" msgstr "nomes das barras" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "nomes das barras" + #, fuzzy #| msgid "names of bars" msgid "names of custom bar items" diff --git a/po/ru.po b/po/ru.po index ca4c20917..edeff6b76 100644 --- a/po/ru.po +++ b/po/ru.po @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Aleksey V Zapparov AKA ixti \n" "Language-Team: weechat-dev \n" @@ -3861,6 +3861,10 @@ msgstr "" msgid "names of bars" msgstr "Список сокращений:\n" +#, fuzzy +msgid "names of bar items" +msgstr "Список сокращений:\n" + #, fuzzy msgid "names of custom bar items" msgstr "Список сокращений:\n" diff --git a/po/sr.po b/po/sr.po index 5aa8b57c4..58af46e04 100644 --- a/po/sr.po +++ b/po/sr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-05-07 14:00+0400\n" "Last-Translator: Ivan Pešić \n" "Language-Team: weechat-dev \n" @@ -4271,6 +4271,11 @@ msgstr "" msgid "names of bars" msgstr "имена трака" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "имена трака" + msgid "names of custom bar items" msgstr "имена прилагођених ставки траке" diff --git a/po/tr.po b/po/tr.po index ca04e9954..3d8155533 100644 --- a/po/tr.po +++ b/po/tr.po @@ -20,7 +20,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2024-04-07 14:50+0200\n" "Last-Translator: Emir SARI \n" "Language-Team: weechat-dev \n" @@ -4192,6 +4192,11 @@ msgstr "" msgid "names of bars" msgstr "çubukların adları" +#, fuzzy +#| msgid "names of bars" +msgid "names of bar items" +msgstr "çubukların adları" + msgid "names of custom bar items" msgstr "özel çubuk ögelerinin adları" diff --git a/po/weechat.pot b/po/weechat.pot index 1ea7893c0..496f567e8 100644 --- a/po/weechat.pot +++ b/po/weechat.pot @@ -21,7 +21,7 @@ msgid "" msgstr "" "Project-Id-Version: WeeChat\n" "Report-Msgid-Bugs-To: flashcode@flashtux.org\n" -"POT-Creation-Date: 2024-06-02 09:01+0200\n" +"POT-Creation-Date: 2024-06-09 09:07+0200\n" "PO-Revision-Date: 2014-08-16 10:27+0200\n" "Last-Translator: Sébastien Helleu \n" "Language-Team: weechat-dev \n" @@ -3601,6 +3601,9 @@ msgstr "" msgid "names of bars" msgstr "" +msgid "names of bar items" +msgstr "" + msgid "names of custom bar items" msgstr "" diff --git a/src/core/core-completion.c b/src/core/core-completion.c index 21cb25e60..3c2b7a2d8 100644 --- a/src/core/core-completion.c +++ b/src/core/core-completion.c @@ -111,6 +111,34 @@ completion_list_add_bars_names_cb (const void *pointer, void *data, return WEECHAT_RC_OK; } +/* + * Adds bar items to completion list. + */ + +int +completion_list_add_bars_items_cb (const void *pointer, void *data, + const char *completion_item, + struct t_gui_buffer *buffer, + struct t_gui_completion *completion) +{ + struct t_gui_bar_item *ptr_bar_item; + + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) completion_item; + (void) buffer; + + for (ptr_bar_item = gui_bar_items; ptr_bar_item; + ptr_bar_item = ptr_bar_item->next_item) + { + gui_completion_list_add (completion, ptr_bar_item->name, + 0, WEECHAT_LIST_POS_SORT); + } + + return WEECHAT_RC_OK; +} + /* * Adds custom bar items names to completion list. */ @@ -2275,6 +2303,9 @@ completion_init () hook_completion (NULL, "bars_names", /* formerly "%r" */ N_("names of bars"), &completion_list_add_bars_names_cb, NULL, NULL); + hook_completion (NULL, "bars_items", + N_("names of bar items"), + &completion_list_add_bars_items_cb, NULL, NULL); hook_completion (NULL, "custom_bar_items_names", N_("names of custom bar items"), &completion_list_add_custom_bar_items_names_cb, NULL, NULL);