diff options
author | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-19 17:05:26 +0100 |
---|---|---|
committer | Sébastien Helleu <flashcode@flashtux.org> | 2023-03-19 17:05:26 +0100 |
commit | e385eec1d6116b8c87889fc1d829aa1c5192156f (patch) | |
tree | 748e7342f9e38c52439365656d094e334292e5fb /doc | |
parent | 3ebfe3e11720d8a43d82235004de5e94c58d6240 (diff) | |
download | weechat-e385eec1d6116b8c87889fc1d829aa1c5192156f.zip |
core: fix default value of options for bars added by plugins
When the bar name already exists, the function `bar_new` returns the pointer to
the bar (instead of NULL) and sets the default value for all options with the
values received.
Diffstat (limited to 'doc')
-rw-r--r-- | doc/en/weechat_plugin_api.en.adoc | 26 | ||||
-rw-r--r-- | doc/fr/weechat_plugin_api.fr.adoc | 27 | ||||
-rw-r--r-- | doc/it/weechat_plugin_api.it.adoc | 27 | ||||
-rw-r--r-- | doc/ja/weechat_plugin_api.ja.adoc | 27 | ||||
-rw-r--r-- | doc/sr/weechat_plugin_api.sr.adoc | 27 |
5 files changed, 49 insertions, 85 deletions
diff --git a/doc/en/weechat_plugin_api.en.adoc b/doc/en/weechat_plugin_api.en.adoc index 4a315fbb6..f071b9027 100644 --- a/doc/en/weechat_plugin_api.en.adoc +++ b/doc/en/weechat_plugin_api.en.adoc @@ -15614,7 +15614,7 @@ bar = weechat.bar_search("mybar") ==== bar_new -_Updated in 2.9._ +_Updated in 2.9, 4.0.0._ Create a new bar. @@ -15684,26 +15684,18 @@ Return value: * pointer to new bar, NULL if an error occurred +[NOTE] +Since version 4.0.0, if the bar already exists, WeeChat sets the values received +as default values for bar options and return the bar pointer instead of NULL. + C example: [source,c] ---- -struct t_gui_bar *my_bar = weechat_bar_new ("mybar", - "off", - "100", - "window", - "", - "top", - "horizontal", - "vertical", - "0", - "5", - "default", - "cyan", - "blue", - "darkgray", - "off", - "time,buffer_number+buffer_name"); +struct t_gui_bar *my_bar = weechat_bar_new ( + "mybar", "off", "100", "window", "", "top", "horizontal", "vertical", + "0", "5", "default", "cyan", "blue", "darkgray", "off", + "time,buffer_number+buffer_name"); ---- Script (Python): diff --git a/doc/fr/weechat_plugin_api.fr.adoc b/doc/fr/weechat_plugin_api.fr.adoc index 7ee11fac0..e55ad3907 100644 --- a/doc/fr/weechat_plugin_api.fr.adoc +++ b/doc/fr/weechat_plugin_api.fr.adoc @@ -15952,7 +15952,7 @@ bar = weechat.bar_search("mybar") ==== bar_new -_Mis à jour dans la 2.9._ +_Mis à jour dans la 2.9, 4.0.0._ Créer une nouvelle barre. @@ -16032,26 +16032,19 @@ Valeur de retour : * pointeur vers la nouvelle barre, NULL en cas d'erreur +[NOTE] +Depuis la version 4.0.0, si la barre existe déjà, WeeChat définit les valeurs +reçues comme valeurs par défaut des options de la barre et retourne le pointeur +vers la barre au lieu de NULL. + Exemple en C : [source,c] ---- -struct t_gui_bar *my_bar = weechat_bar_new ("mybar", - "off", - "100", - "window", - "", - "top", - "horizontal", - "vertical", - "0", - "5", - "default", - "cyan", - "blue", - "darkgray", - "off", - "time,buffer_number+buffer_name"); +struct t_gui_bar *my_bar = weechat_bar_new ( + "mybar", "off", "100", "window", "", "top", "horizontal", "vertical", + "0", "5", "default", "cyan", "blue", "darkgray", "off", + "time,buffer_number+buffer_name"); ---- Script (Python) : diff --git a/doc/it/weechat_plugin_api.it.adoc b/doc/it/weechat_plugin_api.it.adoc index f782509c3..2e8588d74 100644 --- a/doc/it/weechat_plugin_api.it.adoc +++ b/doc/it/weechat_plugin_api.it.adoc @@ -16309,7 +16309,7 @@ bar = weechat.bar_search("mybar") ==== bar_new // TRANSLATION MISSING -_Updated in 2.9._ +_Updated in 2.9, 4.0.0._ Crea una nuova barra. @@ -16391,26 +16391,19 @@ Valore restituito: * puntatore alla nuova barra, NULL in caso di errore +// TRANSLATION MISSING +[NOTE] +Since version 4.0.0, if the bar already exists, WeeChat sets the values received +as default values for bar options and return the bar pointer instead of NULL. + Esempio in C: [source,c] ---- -struct t_gui_bar *my_bar = weechat_bar_new ("mybar", - "off", - "100", - "window", - "", - "top", - "horizontal", - "vertical", - "0", - "5", - "default", - "cyan", - "blue", - "darkgray", - "off", - "time,buffer_number+buffer_name"); +struct t_gui_bar *my_bar = weechat_bar_new ( + "mybar", "off", "100", "window", "", "top", "horizontal", "vertical", + "0", "5", "default", "cyan", "blue", "darkgray", "off", + "time,buffer_number+buffer_name"); ---- Script (Python): diff --git a/doc/ja/weechat_plugin_api.ja.adoc b/doc/ja/weechat_plugin_api.ja.adoc index 52182a43c..596844461 100644 --- a/doc/ja/weechat_plugin_api.ja.adoc +++ b/doc/ja/weechat_plugin_api.ja.adoc @@ -15773,7 +15773,7 @@ bar = weechat.bar_search("mybar") ==== bar_new -_WeeChat バージョン 2.9 で更新。_ +_WeeChat バージョン 2.9, 4.0.0 で更新。_ 新しいバーを作成。 @@ -15844,26 +15844,19 @@ struct t_gui_bar *weechat_bar_new (const char *name, * 新しいバーへのポインタ、エラーが起きた場合は NULL +// TRANSLATION MISSING +[NOTE] +Since version 4.0.0, if the bar already exists, WeeChat sets the values received +as default values for bar options and return the bar pointer instead of NULL. + C 言語での使用例: [source,c] ---- -struct t_gui_bar *my_bar = weechat_bar_new ("mybar", - "off", - "100", - "window", - "", - "top", - "horizontal", - "vertical", - "0", - "5", - "default", - "cyan", - "blue", - "darkgray", - "off", - "time,buffer_number+buffer_name"); +struct t_gui_bar *my_bar = weechat_bar_new ( + "mybar", "off", "100", "window", "", "top", "horizontal", "vertical", + "0", "5", "default", "cyan", "blue", "darkgray", "off", + "time,buffer_number+buffer_name"); ---- スクリプト (Python) での使用例: diff --git a/doc/sr/weechat_plugin_api.sr.adoc b/doc/sr/weechat_plugin_api.sr.adoc index 42d9a4cbd..84cb709fc 100644 --- a/doc/sr/weechat_plugin_api.sr.adoc +++ b/doc/sr/weechat_plugin_api.sr.adoc @@ -15109,7 +15109,7 @@ bar = weechat.bar_search("mybar") ==== bar_new -_Ажурирано у верзији 2.9._ +_Ажурирано у верзији 2.9, 4.0.0._ Креира нову траку. @@ -15176,26 +15176,19 @@ struct t_gui_bar *weechat_bar_new (const char *name, * показивач на нову траку, NULL у случају грешке +// TRANSLATION MISSING +[NOTE] +Since version 4.0.0, if the bar already exists, WeeChat sets the values received +as default values for bar options and return the bar pointer instead of NULL. + C пример: [source,c] ---- -struct t_gui_bar *my_bar = weechat_bar_new ("mybar", - "off", - "100", - "window", - "", - "top", - "horizontal", - "vertical", - "0", - "5", - "default", - "cyan", - "blue", - "darkgray", - "off", - "time,buffer_number+buffer_name"); +struct t_gui_bar *my_bar = weechat_bar_new ( + "mybar", "off", "100", "window", "", "top", "horizontal", "vertical", + "0", "5", "default", "cyan", "blue", "darkgray", "off", + "time,buffer_number+buffer_name"); ---- Скрипта (Python): |