core: add a parent name in options (closes #629)

Inherited values are now displayed in /set output when the value is
null, if a parent option name is defined in option.

New option: weechat.color.chat_value_null
v2.8-utf8proc
Sébastien Helleu 2015-12-24 07:53:37 +01:00
parent 2e5489b389
commit c4e3d66ba5
40 changed files with 652 additions and 518 deletions

View File

@ -21,6 +21,8 @@ https://weechat.org/files/releasenotes/ReleaseNotes-devel.html[release notes]
[[1.4_features]]
=== New features
* core: add a parent name in options, display inherited values if null in
/set output, add option weechat.color.chat_value_null (issue #629)
* core: add tag "term_warning" in warnings about wrong $TERM on startup
* core: add option weechat.look.paste_auto_add_newline (issue #543)
* core: display a more explicit error when a filter fails to be added

View File

@ -658,6 +658,7 @@
*** 'config_file' (pointer, hdata: "config_file")
*** 'section' (pointer, hdata: "config_section")
*** 'name' (string)
*** 'parent_name' (string)
*** 'type' (integer)
*** 'description' (string)
*** 'string_values' (string, array_size: "*")

View File

@ -197,6 +197,11 @@
** Typ: Farbe
** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `cyan`)
* [[option_weechat.color.chat_value_null]] *weechat.color.chat_value_null*
** Beschreibung: `text color for null values (undefined)`
** Typ: Farbe
** Werte: ein Farbname für WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), eine Terminal-Farbnummer oder ein Alias; Attribute können vor eine Farbe gesetzt werden (gilt ausschließlich für die Textfarbe und nicht für den Hintergrund): "*" für fett, "!" für invertiert, "/" für kursiv, "_" für unterstrichen (Standardwert: `blue`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** Beschreibung: `Textfarbe um Text hervorzuheben (zum Beispiel bei der Textsuche); wird ausschließlich dann genutzt, falls die Einstellung weechat.look.emphasized_attributes keinen Eintrag besitzt (Standardwert)`
** Typ: Farbe

View File

@ -658,6 +658,7 @@
*** 'config_file' (pointer, hdata: "config_file")
*** 'section' (pointer, hdata: "config_section")
*** 'name' (string)
*** 'parent_name' (string)
*** 'type' (integer)
*** 'description' (string)
*** 'string_values' (string, array_size: "*")

View File

@ -197,6 +197,11 @@
** type: color
** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline (default value: `cyan`)
* [[option_weechat.color.chat_value_null]] *weechat.color.chat_value_null*
** description: `text color for null values (undefined)`
** type: color
** values: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline (default value: `blue`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** description: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** type: color

View File

@ -873,6 +873,7 @@ Color codes using options (see 't_gui_color_enum', in file
| 41 | weechat.color.chat_nick_suffix _(WeeChat ≥ 0.4.1)_
| 42 | weechat.color.emphasized _(WeeChat ≥ 0.4.2)_
| 43 | weechat.color.chat_day_change _(WeeChat ≥ 0.4.2)_
| 44 | weechat.color.chat_value_null _(WeeChat ≥ 1.4)_
|===
WeeChat colors are:

View File

@ -4632,7 +4632,10 @@ Arguments:
* 'config_file': configuration file pointer
* 'section': section pointer
* 'name': name of option
* 'name': name of option; with WeeChat ≥ 1.4, the name can include a parent
option name (the value of parent option will be displayed in `/set` command
output if this option is "null"), the syntax is then:
"name << file.section.option"
* 'type': type of option:
** 'boolean': boolean value (on/off)
** 'integer': integer value (with optional strings for values)
@ -5300,6 +5303,7 @@ Arguments:
** 'config_file': configuration file pointer ('struct t_config_file *')
** 'section': section pointer ('struct t_config_section *')
** 'name': option name ('char *')
** 'parent_name': name of parent option ('char *') _(WeeChat ≥ 1.4)_
** 'type': option type ('int *')
** 'description': option description ('char *')
** 'string_values': string values ('char *')

View File

@ -658,6 +658,7 @@
*** 'config_file' (pointer, hdata: "config_file")
*** 'section' (pointer, hdata: "config_section")
*** 'name' (string)
*** 'parent_name' (string)
*** 'type' (integer)
*** 'description' (string)
*** 'string_values' (string, array_size: "*")

View File

@ -197,6 +197,11 @@
** type: couleur
** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné (valeur par défaut: `cyan`)
* [[option_weechat.color.chat_value_null]] *weechat.color.chat_value_null*
** description: `couleur du texte pour les valeurs "null" (non définies)`
** type: couleur
** valeurs: un nom de couleur WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), un numéro de couleur du terminal ou un alias ; des attributs sont autorisés avant la couleur (seulement pour la couleur du texte, pas le fond) : "*" pour le gras, "!" pour la vidéo inverse, "/" pour l'italique, "_" pour le souligné (valeur par défaut: `blue`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** description: `couleur du texte pour le texte mis en valeur (par exemple lors de la recherche de texte) ; cette option est utilisée seulement si l'option weechat.look.emphasized_attributes est une chaîne vide (valeur par défaut)`
** type: couleur

View File

@ -888,6 +888,7 @@ fichier 'src/gui/gui-color.h') :
| 41 | weechat.color.chat_nick_suffix _(WeeChat ≥ 0.4.1)_
| 42 | weechat.color.emphasized _(WeeChat ≥ 0.4.2)_
| 43 | weechat.color.chat_day_change _(WeeChat ≥ 0.4.2)_
| 44 | weechat.color.chat_value_null _(WeeChat ≥ 1.4)_
|===
Les couleurs WeeChat sont :

View File

@ -4708,7 +4708,10 @@ Paramètres :
* 'config_file' : pointeur vers le fichier de configuration
* 'section' : pointeur vers la section
* 'name' : nom de l'option
* 'name' : nom de l'option ; avec WeeChat ≥ 1.4, le nom peut inclure le nom
d'une option parente (la valeur de l'option parente sera affichée dans la
sortie de `/set` si cette option est "null"), la syntaxe est alors :
"name << file.section.option"
* 'type' : type de l'option :
** 'boolean' : valeur booléenne (on/off)
** 'integer' : valeur entière (avec en option une chaîne pour chaque valeur)
@ -5386,6 +5389,7 @@ Paramètres :
('struct t_config_file *')
** 'section' : pointeur vers la section ('struct t_config_section *')
** 'name' : nom de l'option ('char *')
** 'parent_name' : nom de l'option parente ('char *') _(WeeChat ≥ 1.4)_
** 'type' : type de l'option ('int *')
** 'description' : description de l'option ('char *')
** 'string_values' : valeurs sous forme de chaîne ('char *')

View File

@ -658,6 +658,7 @@
*** 'config_file' (pointer, hdata: "config_file")
*** 'section' (pointer, hdata: "config_section")
*** 'name' (string)
*** 'parent_name' (string)
*** 'type' (integer)
*** 'description' (string)
*** 'string_values' (string, array_size: "*")

View File

@ -197,6 +197,11 @@
** tipo: colore
** valori: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline (valore predefinito: `cyan`)
* [[option_weechat.color.chat_value_null]] *weechat.color.chat_value_null*
** descrizione: `text color for null values (undefined)`
** tipo: colore
** valori: a WeeChat color name (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), a terminal color number or an alias; attributes are allowed before color (for text color only, not background): "*" for bold, "!" for reverse, "/" for italic, "_" for underline (valore predefinito: `blue`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** descrizione: `text color for emphasized text (for example when searching text); this option is used only if option weechat.look.emphasized_attributes is an empty string (default value)`
** tipo: colore

View File

@ -4758,7 +4758,11 @@ Argomenti:
* 'config_file': puntatore al file di configurazione
* 'section': puntatore alla sezione
* 'name': nome dell'opzione
// TRANSLATION MISSING
* 'name': nome dell'opzione; with WeeChat ≥ 1.4, the name can include a parent
option name (the value of parent option will be displayed in `/set` command
output if this option is "null"), the syntax is then:
"name << file.section.option"
* 'type': tipo dell'opzione:
** 'boolean': valore booleano (on/off)
** 'integer': valore intero (con stringhe opzionali per i valori)
@ -5435,6 +5439,8 @@ Argomenti:
** 'config_file': puntatore al file di configurazione ('struct t_config_file *')
** 'section': puntatore alla sezione ('struct t_config_section *')
** 'name': nome dell'opzione ('char *')
// TRANSLATION MISSING
** 'parent_name': name of parent option ('char *') _(WeeChat ≥ 1.4)_
** 'type': tipo dell'opzione ('int *')
** 'description': descrizione dell'opzione ('char *')
** 'string_values': valori stringa ('char *')

View File

@ -658,6 +658,7 @@
*** 'config_file' (pointer, hdata: "config_file")
*** 'section' (pointer, hdata: "config_section")
*** 'name' (string)
*** 'parent_name' (string)
*** 'type' (integer)
*** 'description' (string)
*** 'string_values' (string, array_size: "*")

View File

@ -197,6 +197,11 @@
** タイプ: 色
** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" (デフォルト値: `cyan`)
* [[option_weechat.color.chat_value_null]] *weechat.color.chat_value_null*
** 説明: `text color for null values (undefined)`
** タイプ: 色
** 値: WeeChat の色名 (default、black、(dark)gray、white、(light)red、(light)green、brown、yellow、(light)blue、(light)magenta、(light)cyan) 、ターミナル色番号またはその別名; 色の前に属性を置くことができます (テキスト前景色のみ、背景色は出来ません): 太字は "*"、反転は "!"、イタリックは "/"、下線は "_" (デフォルト値: `blue`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** 説明: `強調テキストの色 (テキスト検索する際など); このオプションは weechat.look.emphasized_attributes オプションが空文字列 (デフォルト値) の場合のみ使われます`
** タイプ: 色

View File

@ -873,6 +873,7 @@ WeeChat は文字列中に独自の色コードを使うことで、属性
| 41 | weechat.color.chat_nick_suffix _(WeeChat ≥ 0.4.1)_
| 42 | weechat.color.emphasized _(WeeChat ≥ 0.4.2)_
| 43 | weechat.color.chat_day_change _(WeeChat ≥ 0.4.2)_
| 44 | weechat.color.chat_value_null _(WeeChat ≥ 1.4)_
|===
WeeChat 色は:

View File

@ -4633,7 +4633,11 @@ struct t_config_option *weechat_config_new_option (
* 'config_file': 設定ファイルへのポインタ
* 'section': セクションへのポインタ
* 'name': オプションの名前
// TRANSLATION MISSING
* 'name': オプションの名前; with WeeChat ≥ 1.4, the name can include a parent
option name (the value of parent option will be displayed in `/set` command
output if this option is "null"), the syntax is then:
"name << file.section.option"
* 'type': オプションの型:
** 'boolean': ブール値 (on/off)
** 'integer': 整数値 (任意で文字列を受けるようにすることも可)
@ -5301,6 +5305,8 @@ void *weechat_config_option_get_pointer (struct t_config_option *option,
** 'config_file': 設定ファイルへのポインタ ('struct t_config_file *')
** 'section': セクションへのポインタ ('struct t_config_section *')
** 'name': オプション名 ('char *')
// TRANSLATION MISSING
** 'parent_name': name of parent option ('char *') _(WeeChat ≥ 1.4)_
** 'type': オプションの型 ('int *')
** 'description': オプションの説明 ('char *')
** 'string_values': 文字列値 ('char *')

View File

@ -658,6 +658,7 @@
*** 'config_file' (pointer, hdata: "config_file")
*** 'section' (pointer, hdata: "config_section")
*** 'name' (string)
*** 'parent_name' (string)
*** 'type' (integer)
*** 'description' (string)
*** 'string_values' (string, array_size: "*")

View File

@ -197,6 +197,11 @@
** typ: kolor
** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie (domyślna wartość: `cyan`)
* [[option_weechat.color.chat_value_null]] *weechat.color.chat_value_null*
** opis: `text color for null values (undefined)`
** typ: kolor
** wartości: nazwa koloru WeeChat (default, black, (dark)gray, white, (light)red, (light)green, brown, yellow, (light)blue, (light)magenta, (light)cyan), numer koloru terminala albo alias; atrybuty dozwolone przed kolorem (tylko dla kolorów testu, nie tła): "*" pogrubienie, "!" odwrócenie, "/" pochylenie, "_" podkreślenie (domyślna wartość: `blue`)
* [[option_weechat.color.emphasized]] *weechat.color.emphasized*
** opis: `kolor dla wyróżnionego tekstu (na przykład podczas wyszukiwania); opcja używana tylko jeśli opcja weechat.look.emphasized_attributes jest pustym ciągiem (wartość domyślna)`
** typ: kolor

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 17:29+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-20 17:33+0100\n"
"Last-Translator: Ondřej Súkup <mimi.vx@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -841,11 +841,12 @@ msgstr "Chráněná data \"%s\" nastavena"
msgid "%sSecured data \"%s\" not found"
msgstr "%s%s: skript \"%s\" nenalezen"
msgid "default: "
#, fuzzy
msgid "default if null: "
msgstr "výchozí: "
msgid "(unknown)"
msgstr "(neznámý)"
msgid "default: "
msgstr "výchozí: "
#, fuzzy, c-format
msgid ""
@ -3597,6 +3598,10 @@ msgstr "barva textu děličů času"
msgid "text color for values"
msgstr "barva textu pro hodnoty"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "barva textu pro hodnoty"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -11258,3 +11263,6 @@ msgstr "%s%s: vypršel časový limit \"%s\" pro %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: nemohu se připojit\" neočekávaná chyba (%d)"
#~ msgid "(unknown)"
#~ msgstr "(neznámý)"

View File

@ -19,7 +19,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-20 09:49+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <>\n"
@ -869,11 +869,12 @@ msgstr "schutzwürdige Information \"%s\" gelöscht"
msgid "%sSecured data \"%s\" not found"
msgstr "%sschutzwürdige Information \"%s\" nicht gefunden"
msgid "default: "
#, fuzzy
msgid "default if null: "
msgstr "Standardwert: "
msgid "(unknown)"
msgstr "(unbekannt)"
msgid "default: "
msgstr "Standardwert: "
#, c-format
msgid ""
@ -4265,6 +4266,10 @@ msgstr "Farbe in der das Trennzeichen für die Uhrzeit dargestellt werden soll"
msgid "text color for values"
msgstr "Farbe für Werte"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "Farbe für Werte"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -12798,3 +12803,6 @@ msgstr "%s%s: Zeitüberschreitung für \"%s\" mit %s"
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr ""
"%s%s: Verbindung konnte nicht hergestellt werden: unerwarteter Fehler (%d)"
#~ msgid "(unknown)"
#~ msgstr "(unbekannt)"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-02 19:26+0100\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -840,11 +840,12 @@ msgstr "Barra eliminada"
msgid "%sSecured data \"%s\" not found"
msgstr "%s: script \"%s\" no encontrado"
msgid "default: "
#, fuzzy
msgid "default if null: "
msgstr "predeterminado: "
msgid "(unknown)"
msgstr "(desconocido)"
msgid "default: "
msgstr "predeterminado: "
#, fuzzy, c-format
msgid ""
@ -3779,6 +3780,10 @@ msgstr "color para los delimitadores de la hora"
msgid "text color for values"
msgstr "color para los valores"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "color para los valores"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -11527,3 +11532,6 @@ msgstr "%s%s: tiempo de espera máximo para \"%s\" con %s"
#, fuzzy, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: no es posible conectarse al transmisor"
#~ msgid "(unknown)"
#~ msgstr "(desconocido)"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"PO-Revision-Date: 2015-12-20 08:17+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-24 07:52+0100\n"
"Last-Translator: Sébastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: fr\n"
@ -857,12 +857,12 @@ msgstr "Donnée sécurise \"%s\" supprimée"
msgid "%sSecured data \"%s\" not found"
msgstr "%sDonnée sécurisée \"%s\" non trouvée"
msgid "default if null: "
msgstr "défaut si nul : "
msgid "default: "
msgstr "défaut : "
msgid "(unknown)"
msgstr "(inconnu)"
#, c-format
msgid ""
"%sOption \"%s\" not found (tip: you can use wildcard \"*\" in option to see "
@ -4158,6 +4158,9 @@ msgstr "couleur du texte pour les délimiteurs de l'heure"
msgid "text color for values"
msgstr "couleur du texte pour les valeurs"
msgid "text color for null values (undefined)"
msgstr "couleur du texte pour les valeurs \"null\" (non définies)"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -12536,3 +12539,6 @@ msgstr "%s%s : délai d'attente dépassé pour \"%s\" avec %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s : impossible de se connecter : erreur inattendue (%d)"
#~ msgid "(unknown)"
#~ msgstr "(inconnu)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-02 19:26+0100\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -871,11 +871,12 @@ msgid "%sSecured data \"%s\" not found"
msgstr "%s a \"%s\" szerver nem található\n"
#, fuzzy
msgid "default: "
msgid "default if null: "
msgstr " . alapérték: %d\n"
msgid "(unknown)"
msgstr "(ismeretlen)"
#, fuzzy
msgid "default: "
msgstr " . alapérték: %d\n"
#, c-format
msgid ""
@ -3182,6 +3183,10 @@ msgstr "információs pult határolóinak színe"
msgid "text color for values"
msgstr "üzenetek színe"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "üzenetek színe"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -10580,3 +10585,6 @@ msgstr "%s hiányzó argumentum a(z) \"%s\" opciónak\n"
#, fuzzy, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s DCC: nem sikerült kapcsolódni a küldőhöz\n"
#~ msgid "(unknown)"
#~ msgstr "(ismeretlen)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-02 19:26+0100\n"
"Last-Translator: Esteban I. Ruiz Moreno <exio4.com@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -827,11 +827,12 @@ msgstr "Dati sicuri \"%s\" eliminati"
msgid "%sSecured data \"%s\" not found"
msgstr "%sDati sicuri \"%s\" non trovati"
msgid "default: "
#, fuzzy
msgid "default if null: "
msgstr "predefinito: "
msgid "(unknown)"
msgstr "(sconosciuto)"
msgid "default: "
msgstr "predefinito: "
#, fuzzy, c-format
msgid ""
@ -3890,6 +3891,10 @@ msgstr "colore del testo per i delimitator dell'orario"
msgid "text color for values"
msgstr "colore del testo per i valori"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "colore del testo per i valori"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -11710,3 +11715,6 @@ msgstr "%s%s: timeout per \"%s\" con %s"
#, fuzzy, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: impossibile connettersi al mittente"
#~ msgid "(unknown)"
#~ msgstr "(sconosciuto)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-02 19:26+0100\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/weechat/tree/translation_ja>\n"
@ -846,11 +846,12 @@ msgstr "保護データ \"%s\" を削除しました"
msgid "%sSecured data \"%s\" not found"
msgstr "%s保護データ \"%s\" が見つかりません"
msgid "default: "
#, fuzzy
msgid "default if null: "
msgstr "デフォルト: "
msgid "(unknown)"
msgstr "(未定義)"
msgid "default: "
msgstr "デフォルト: "
#, c-format
msgid ""
@ -3998,6 +3999,10 @@ msgstr "時間区切りのテキスト色"
msgid "text color for values"
msgstr "値のテキスト色"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "値のテキスト色"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -12038,3 +12043,6 @@ msgstr "%s%s: \"%s\" のタイムアウト %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: 接続できません: 未定義のエラー (%d)"
#~ msgid "(unknown)"
#~ msgstr "(未定義)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-02 19:26+0100\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -856,11 +856,12 @@ msgstr "Usunięto zabezpieczone dane \"%s\""
msgid "%sSecured data \"%s\" not found"
msgstr "%sNie znaleziono zabezpieczonych danych \"%s\""
msgid "default: "
#, fuzzy
msgid "default if null: "
msgstr "domyślnie: "
msgid "(unknown)"
msgstr "(nieznane)"
msgid "default: "
msgstr "domyślnie: "
#, c-format
msgid ""
@ -4094,6 +4095,10 @@ msgstr "kolor separatora czasu"
msgid "text color for values"
msgstr "kolor wyświetlania wartości"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "kolor wyświetlania wartości"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -12237,3 +12242,6 @@ msgstr "%s%s: przekroczono czas na \"%s\" z %s"
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: nie można połączyć: niespodziewany błąd (%d)"
#~ msgid "(unknown)"
#~ msgstr "(nieznane)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-09-30 20:56+0200\n"
"Last-Translator: Eduardo Elias <camponez@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -861,11 +861,12 @@ msgstr "Dados seguros \"%s\" deletados"
msgid "%sSecured data \"%s\" not found"
msgstr "%sDados seguros \"%s\" não encontrados"
msgid "default: "
#, fuzzy
msgid "default if null: "
msgstr "padrão: "
msgid "(unknown)"
msgstr "(desconhecido)"
msgid "default: "
msgstr "padrão: "
#, fuzzy, c-format
msgid ""
@ -3776,6 +3777,10 @@ msgstr "cor do texto para delimitadores de tempo"
msgid "text color for values"
msgstr "cor de texto para valores"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "cor de texto para valores"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -11011,3 +11016,6 @@ msgstr "%s%s: tempo esgotado para \"%s\" com %s"
#, fuzzy, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s%s: não foi possível conectar ao remetente"
#~ msgid "(unknown)"
#~ msgstr "(desconhecido)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-12-02 19:26+0100\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -886,11 +886,12 @@ msgid "%sSecured data \"%s\" not found"
msgstr "%s сервер \"%s\" не найден\n"
#, fuzzy
msgid "default: "
msgid "default if null: "
msgstr " . значение по умолчанию: %d\n"
msgid "(unknown)"
msgstr "(неизвестен)"
#, fuzzy
msgid "default: "
msgstr " . значение по умолчанию: %d\n"
#, fuzzy, c-format
msgid ""
@ -3215,6 +3216,10 @@ msgstr "цвет разделителей информационной пане
msgid "text color for values"
msgstr "цвет чата"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "цвет чата"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -10607,3 +10612,6 @@ msgstr "%s нет аргумента для параметра \"%s\"\n"
#, fuzzy, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr "%s DCC: не могу соединиться с отправителем\n"
#~ msgid "(unknown)"
#~ msgstr "(неизвестен)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\n"
"PO-Revision-Date: 2015-03-10 21:33+0100\n"
"Last-Translator: Hasan Kiran <sunder67@hotmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -788,11 +788,12 @@ msgstr "Filtre \"%s\" silindi"
msgid "%sSecured data \"%s\" not found"
msgstr "%s: \"%s\" betiği bulunamadı"
msgid "default: "
#, fuzzy
msgid "default if null: "
msgstr "öntanımlı: "
msgid "(unknown)"
msgstr "(bilinmiyor)"
msgid "default: "
msgstr "öntanımlı: "
#, c-format
msgid ""
@ -2877,6 +2878,10 @@ msgstr ""
msgid "text color for values"
msgstr "değerler için metin rengi"
#, fuzzy
msgid "text color for null values (undefined)"
msgstr "değerler için metin rengi"
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "
@ -9608,3 +9613,6 @@ msgstr ""
#, c-format
msgid "%s%s: unable to connect: unexpected error (%d)"
msgstr ""
#~ msgid "(unknown)"
#~ msgstr "(bilinmiyor)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2015-12-20 08:08+0100\n"
"POT-Creation-Date: 2015-12-24 07:51+0100\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"
@ -786,10 +786,10 @@ msgstr ""
msgid "%sSecured data \"%s\" not found"
msgstr ""
msgid "default: "
msgid "default if null: "
msgstr ""
msgid "(unknown)"
msgid "default: "
msgstr ""
#, c-format
@ -2873,6 +2873,9 @@ msgstr ""
msgid "text color for values"
msgstr ""
msgid "text color for null values (undefined)"
msgstr ""
msgid ""
"text color for emphasized text (for example when searching text); this "
"option is used only if option weechat.look.emphasized_attributes is an empty "

View File

@ -5328,183 +5328,85 @@ void
command_set_display_option (struct t_config_option *option,
const char *message)
{
const char *color_name;
const char *display_undefined = _("(undefined)");
const char *display_default;
char str_default[128];
int is_file_plugins_conf;
struct t_config_option *ptr_parent_option;
char *value, *inherited_value, *default_value;
int is_file_plugins_conf, is_value_inherited, is_default_value_inherited;
ptr_parent_option = NULL;
value = NULL;
inherited_value = NULL;
default_value = NULL;
display_default = NULL;
is_file_plugins_conf = (option->config_file && option->config_file->name
&& (strcmp (option->config_file->name, "plugins") == 0));
is_value_inherited = 0;
is_default_value_inherited = 0;
/* check if option has a parent option */
if (option->parent_name)
{
config_file_search_with_string (option->parent_name, NULL, NULL,
&ptr_parent_option, NULL);
if (ptr_parent_option && (ptr_parent_option->type != option->type))
ptr_parent_option = NULL;
}
/* check if the value is inherited from parent option */
if (!option->value && ptr_parent_option && ptr_parent_option->value)
is_value_inherited = 1;
value = config_file_option_value_to_string (option, 0, 1, 1);
if (is_value_inherited)
{
inherited_value = config_file_option_value_to_string (
ptr_parent_option, 0, 1, 1);
}
if (option->value)
{
if (!is_file_plugins_conf && !option->default_value)
if (ptr_parent_option)
{
display_default = display_undefined;
is_default_value_inherited = 1;
default_value = config_file_option_value_to_string (
ptr_parent_option, 0, 1, 1);
}
switch (option->type)
else if (!is_file_plugins_conf
&& config_file_option_has_changed (option))
{
case CONFIG_OPTION_TYPE_BOOLEAN:
if (!is_file_plugins_conf && option->default_value
&& (CONFIG_BOOLEAN(option) != CONFIG_BOOLEAN_DEFAULT(option)))
{
snprintf (str_default, sizeof (str_default), "%s",
(CONFIG_BOOLEAN_DEFAULT(option)) ? "on" : "off");
display_default = str_default;
}
gui_chat_printf_date_tags (NULL, 0,
"no_trigger," GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
(option->config_file) ? option->config_file->name : "",
(option->section) ? option->section->name : "",
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
(CONFIG_BOOLEAN(option) == CONFIG_BOOLEAN_TRUE) ? "on" : "off",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? " (" : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT) : "",
(display_default) ? _("default: ") : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(display_default) ? display_default : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? ")" : "");
break;
case CONFIG_OPTION_TYPE_INTEGER:
if (!is_file_plugins_conf && option->default_value
&& (CONFIG_INTEGER(option) != CONFIG_INTEGER_DEFAULT(option)))
{
if (option->string_values)
{
display_default = option->string_values[CONFIG_INTEGER_DEFAULT(option)];
}
else
{
snprintf (str_default, sizeof (str_default),
"%d", CONFIG_INTEGER_DEFAULT(option));
display_default = str_default;
}
}
if (option->string_values)
{
gui_chat_printf_date_tags (NULL, 0,
"no_trigger," GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
(option->config_file) ? option->config_file->name : "",
(option->section) ? option->section->name : "",
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
option->string_values[CONFIG_INTEGER(option)],
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? " (" : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT) : "",
(display_default) ? _("default: ") : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(display_default) ? display_default : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? ")" : "");
}
else
{
gui_chat_printf_date_tags (NULL, 0,
"no_trigger," GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%d%s%s%s%s%s%s%s%s",
(message) ? message : " ",
(option->config_file) ? option->config_file->name : "",
(option->section) ? option->section->name : "",
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
CONFIG_INTEGER(option),
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? " (" : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT) : "",
(display_default) ? _("default: ") : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(display_default) ? display_default : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? ")" : "");
}
break;
case CONFIG_OPTION_TYPE_STRING:
if (!is_file_plugins_conf && option->default_value
&& (strcmp (CONFIG_STRING(option), CONFIG_STRING_DEFAULT(option)) != 0))
{
display_default = CONFIG_STRING_DEFAULT(option);
}
gui_chat_printf_date_tags (NULL, 0,
"no_trigger," GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = \"%s%s%s\"%s%s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
(option->config_file) ? option->config_file->name : "",
(option->section) ? option->section->name : "",
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
CONFIG_STRING(option),
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? " (" : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT) : "",
(display_default) ? _("default: ") : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) && display_default != display_undefined ? "\"" : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(display_default) ? display_default : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) && display_default != display_undefined ? "\"" : "",
(display_default) ? ")" : "");
break;
case CONFIG_OPTION_TYPE_COLOR:
if (!is_file_plugins_conf && option->default_value
&& (CONFIG_COLOR(option) != CONFIG_COLOR_DEFAULT(option)))
{
display_default = gui_color_get_name (CONFIG_COLOR_DEFAULT(option));
if (display_default == NULL)
{
display_default = _("(unknown)");
}
}
color_name = gui_color_get_name (CONFIG_COLOR(option));
gui_chat_printf_date_tags (NULL, 0,
"no_trigger," GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
(option->config_file) ? option->config_file->name : "",
(option->section) ? option->section->name : "",
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
(color_name) ? color_name : _("(unknown)"),
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? " (" : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT) : "",
(display_default) ? _("default: ") : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(display_default) ? display_default : "",
(display_default) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(display_default) ? ")" : "");
break;
case CONFIG_NUM_OPTION_TYPES:
/* make C compiler happy */
break;
default_value = config_file_option_value_to_string (
option, 1, 1, 1);
}
}
else
{
gui_chat_printf_date_tags (NULL, 0,
"no_trigger," GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s",
(message) ? message : " ",
(option->config_file) ? option->config_file->name : "",
(option->section) ? option->section->name : "",
option->name);
}
gui_chat_printf_date_tags (
NULL, 0,
"no_trigger," GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
(option->config_file) ? option->config_file->name : "",
(option->section) ? option->section->name : "",
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
(value) ? value : "?",
(inherited_value) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(inherited_value) ? " -> " : "",
(inherited_value) ? inherited_value : "",
(default_value) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(default_value) ? " (" : "",
(default_value) ? GUI_COLOR(GUI_COLOR_CHAT) : "",
(default_value) ? ((is_default_value_inherited) ? _("default if null: ") : _("default: ")) : "",
(default_value) ? default_value : "",
(default_value) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(default_value) ? ")" : "");
if (value)
free (value);
if (inherited_value)
free (inherited_value);
if (default_value)
free (default_value);
}
/*

View File

@ -565,6 +565,7 @@ config_file_option_malloc ()
new_option->config_file = NULL;
new_option->section = NULL;
new_option->name = NULL;
new_option->parent_name = NULL;
new_option->type = 0;
new_option->description = NULL;
new_option->string_values = NULL;
@ -615,14 +616,31 @@ config_file_new_option (struct t_config_file *config_file,
struct t_config_option *new_option;
int var_type, int_value, argc, i, index_value;
long number;
char *error;
char *error, *pos, *option_name, *parent_name;
new_option = NULL;
option_name = NULL;
parent_name = NULL;
if (!name)
return NULL;
goto error;
pos = strstr (name, " << ");
if (pos)
{
option_name = string_strndup (name, pos - name);
parent_name = strdup (pos + 4);
}
else
{
option_name = strdup (name);
}
if (config_file && section
&& config_file_search_option (config_file, section, name))
return NULL;
&& config_file_search_option (config_file, section, option_name))
{
goto error;
}
var_type = -1;
for (i = 0; i < CONFIG_NUM_OPTION_TYPES; i++)
@ -638,7 +656,7 @@ config_file_new_option (struct t_config_file *config_file,
gui_chat_printf (NULL, "%sError: unknown option type \"%s\"",
gui_chat_prefix[GUI_CHAT_PREFIX_ERROR],
type);
return NULL;
goto error;
}
if (!null_value_allowed)
@ -648,7 +666,7 @@ config_file_new_option (struct t_config_file *config_file,
else if (!default_value && value)
default_value = value;
if (!default_value || !value)
return NULL;
goto error;
}
new_option = config_file_option_malloc ();
@ -656,9 +674,10 @@ config_file_new_option (struct t_config_file *config_file,
{
new_option->config_file = config_file;
new_option->section = section;
new_option->name = strdup (name);
new_option->name = strdup (option_name);
if (!new_option->name)
goto error;
new_option->parent_name = (parent_name) ? strdup (parent_name) : NULL;
new_option->type = var_type;
if (description)
{
@ -838,15 +857,22 @@ config_file_new_option (struct t_config_file *config_file,
}
}
return new_option;
goto end;
error:
if (new_option)
{
config_file_option_free_data (new_option);
free (new_option);
new_option = NULL;
}
return NULL;
end:
if (option_name)
free (option_name);
if (parent_name)
free (parent_name);
return new_option;
}
/*
@ -1648,12 +1674,17 @@ void
config_file_option_rename (struct t_config_option *option,
const char *new_name)
{
char *str_new_name;
char *str_new_name, *full_old_name, *full_new_name;
struct t_config_file *ptr_config;
struct t_config_section *ptr_section;
struct t_config_option *ptr_option;
if (!option || !new_name || !new_name[0]
|| config_file_search_option (option->config_file, option->section, new_name))
return;
full_old_name = config_file_option_full_name (option);
str_new_name = strdup (new_name);
if (str_new_name)
{
@ -1679,6 +1710,155 @@ config_file_option_rename (struct t_config_option *option,
if (option->section)
config_file_option_insert_in_section (option);
}
full_new_name = config_file_option_full_name (option);
/* rename "parent_name" in any option using the old option name */
if (full_old_name && full_new_name)
{
for (ptr_config = config_files; ptr_config;
ptr_config = ptr_config->next_config)
{
for (ptr_section = ptr_config->sections; ptr_section;
ptr_section = ptr_section->next_section)
{
for (ptr_option = ptr_section->options; ptr_option;
ptr_option = ptr_option->next_option)
{
if (ptr_option->parent_name
&& (strcmp (ptr_option->parent_name, full_old_name) == 0))
{
free (ptr_option->parent_name);
ptr_option->parent_name = strdup (full_new_name);
}
}
}
}
}
if (full_old_name)
free (full_old_name);
if (full_new_name)
free (full_new_name);
}
/*
* Builds a string with the value or default value of option,
* depending on the type of option.
*
* According to default_value:
* 0: value of option is returned
* 1: default value of option is returned
*
* Note: result must be freed after use.
*/
char *
config_file_option_value_to_string (struct t_config_option *option,
int default_value,
int use_colors,
int use_delimiters)
{
char *value;
const char *ptr_value;
int enabled, length;
if ((default_value && !option->default_value)
|| (!default_value && !option->value))
{
length = 7 + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE_NULL) : "",
"null");
return value;
}
switch (option->type)
{
case CONFIG_OPTION_TYPE_BOOLEAN:
enabled = (default_value) ?
CONFIG_BOOLEAN_DEFAULT(option) : CONFIG_BOOLEAN(option);
length = 7 + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(enabled) ? "on" : "off");
return value;
break;
case CONFIG_OPTION_TYPE_INTEGER:
if (option->string_values)
{
ptr_value = (default_value) ?
option->string_values[CONFIG_INTEGER_DEFAULT(option)] :
option->string_values[CONFIG_INTEGER(option)];
length = strlen (ptr_value) + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value);
return value;
}
else
{
length = 31 + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%d",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
(default_value) ? CONFIG_INTEGER_DEFAULT(option) : CONFIG_INTEGER(option));
return value;
}
break;
case CONFIG_OPTION_TYPE_STRING:
ptr_value = (default_value) ? CONFIG_STRING_DEFAULT(option) : CONFIG_STRING(option);
length = strlen (ptr_value) + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s%s%s%s%s",
(use_colors && use_delimiters) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(use_delimiters) ? "\"" : "",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value,
(use_colors && use_delimiters) ? GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS) : "",
(use_delimiters) ? "\"" : "");
return value;
break;
case CONFIG_OPTION_TYPE_COLOR:
ptr_value = gui_color_get_name (
(default_value) ? CONFIG_COLOR_DEFAULT(option) : CONFIG_COLOR(option));
if (!ptr_value)
return NULL;
length = strlen (ptr_value) + ((use_colors) ? 64 : 0) + 1;
value = malloc (length);
if (!value)
return NULL;
snprintf (value, length,
"%s%s",
(use_colors) ? GUI_COLOR(GUI_COLOR_CHAT_VALUE) : "",
ptr_value);
return value;
break;
case CONFIG_NUM_OPTION_TYPES:
/* make C compiler happy */
break;
}
/* make C static analyzer happy (never executed) */
return NULL;
}
/*
@ -1698,6 +1878,8 @@ config_file_option_get_pointer (struct t_config_option *option,
return option->section;
else if (string_strcasecmp (property, "name") == 0)
return option->name;
else if (string_strcasecmp (property, "parent_name") == 0)
return option->parent_name;
else if (string_strcasecmp (property, "type") == 0)
return &option->type;
else if (string_strcasecmp (property, "description") == 0)
@ -2667,6 +2849,8 @@ config_file_option_free_data (struct t_config_option *option)
{
if (option->name)
free (option->name);
if (option->parent_name)
free (option->parent_name);
if (option->description)
free (option->description);
if (option->string_values)
@ -2934,6 +3118,7 @@ config_file_hdata_config_option_cb (void *data, const char *hdata_name)
HDATA_VAR(struct t_config_option, config_file, POINTER, 0, NULL, "config_file");
HDATA_VAR(struct t_config_option, section, POINTER, 0, NULL, "config_section");
HDATA_VAR(struct t_config_option, name, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, parent_name, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, type, INTEGER, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, description, STRING, 0, NULL, NULL);
HDATA_VAR(struct t_config_option, string_values, STRING, 0, "*", NULL);
@ -2955,6 +3140,150 @@ config_file_hdata_config_option_cb (void *data, const char *hdata_name)
return hdata;
}
/*
* Adds a configuration option in an infolist.
*
* Returns:
* 1: OK
* 0: error
*/
int
config_file_add_option_to_infolist(struct t_infolist *infolist,
struct t_config_file *config_file,
struct t_config_section *section,
struct t_config_option *option,
const char *option_name)
{
char *option_full_name, *value, *string_values;
struct t_config_option *ptr_parent_option;
struct t_infolist_item *ptr_item;
int rc;
rc = 1;
option_full_name = config_file_option_full_name (option);
if (!option_full_name)
goto error;
if (option_name && option_name[0]
&& (!string_match (option_full_name, option_name, 0)))
{
goto end;
}
ptr_item = infolist_new_item (infolist);
if (!ptr_item)
goto error;
if (!infolist_new_var_string (ptr_item, "full_name", option_full_name))
goto error;
if (!infolist_new_var_string (ptr_item, "config_name", config_file->name))
goto error;
if (!infolist_new_var_string (ptr_item, "section_name", section->name))
goto error;
if (!infolist_new_var_string (ptr_item, "option_name", option->name))
goto error;
if (!infolist_new_var_string (ptr_item, "parent_name", option->parent_name))
goto error;
if (!infolist_new_var_string (ptr_item, "description", option->description))
goto error;
if (!infolist_new_var_string (ptr_item, "description_nls",
(option->description
&& option->description[0]) ?
_(option->description) : ""))
{
goto error;
}
string_values = string_build_with_split_string (
(const char **)option->string_values, "|");
if (!infolist_new_var_string (ptr_item, "string_values", string_values))
{
if (string_values)
free (string_values);
goto error;
}
if (string_values)
free (string_values);
if (!infolist_new_var_integer (ptr_item, "min", option->min))
goto error;
if (!infolist_new_var_integer (ptr_item, "max", option->max))
goto error;
if (!infolist_new_var_integer (ptr_item, "null_value_allowed",
option->null_value_allowed))
{
goto error;
}
if (!infolist_new_var_integer (ptr_item, "value_is_null",
(option->value) ? 0 : 1))
{
goto error;
}
if (!infolist_new_var_integer (ptr_item,
"default_value_is_null",
(option->default_value) ?
0 : 1))
{
goto error;
}
if (!infolist_new_var_string (ptr_item, "type",
config_option_type_string[option->type]))
{
goto error;
}
if (option->value)
{
value = config_file_option_value_to_string (option, 0, 0, 0);
if (!value)
goto error;
if (!infolist_new_var_string (ptr_item, "value", value))
{
free (value);
goto error;
}
free (value);
}
if (option->default_value)
{
value = config_file_option_value_to_string (option, 1, 0, 0);
if (!value)
goto error;
if (!infolist_new_var_string (ptr_item, "default_value", value))
{
free (value);
goto error;
}
free (value);
}
if (option->parent_name)
{
config_file_search_with_string (option->parent_name,
NULL, NULL, &ptr_parent_option, NULL);
if (ptr_parent_option && ptr_parent_option->value)
{
value = config_file_option_value_to_string (ptr_parent_option,
0, 0, 0);
if (!value)
goto error;
if (!infolist_new_var_string (ptr_item, "parent_value", value))
{
free (value);
goto error;
}
free (value);
}
}
goto end;
error:
rc = 0;
end:
free (option_full_name);
return rc;
}
/*
* Adds configuration options in an infolist.
*
@ -2970,9 +3299,6 @@ config_file_add_to_infolist (struct t_infolist *infolist,
struct t_config_file *ptr_config;
struct t_config_section *ptr_section;
struct t_config_option *ptr_option;
struct t_infolist_item *ptr_item;
int length;
char *option_full_name, value[128], *string_values;
if (!infolist)
return 0;
@ -2986,280 +3312,13 @@ config_file_add_to_infolist (struct t_infolist *infolist,
for (ptr_option = ptr_section->options; ptr_option;
ptr_option = ptr_option->next_option)
{
length = strlen (ptr_config->name) + 1 +
strlen (ptr_section->name) + 1 +
strlen (ptr_option->name) + 1;
option_full_name = malloc (length);
if (option_full_name)
if (!config_file_add_option_to_infolist (infolist,
ptr_config,
ptr_section,
ptr_option,
option_name))
{
snprintf (option_full_name, length, "%s.%s.%s",
ptr_config->name,
ptr_section->name,
ptr_option->name);
if (!option_name || !option_name[0]
|| string_match (option_full_name, option_name, 0))
{
ptr_item = infolist_new_item (infolist);
if (!ptr_item)
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_string (ptr_item,
"full_name",
option_full_name))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_string (ptr_item,
"config_name",
ptr_config->name))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_string (ptr_item,
"section_name",
ptr_section->name))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_string (ptr_item,
"option_name",
ptr_option->name))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_string (ptr_item,
"description",
ptr_option->description))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_string (ptr_item,
"description_nls",
(ptr_option->description
&& ptr_option->description[0]) ?
_(ptr_option->description) : ""))
{
free (option_full_name);
return 0;
}
string_values = string_build_with_split_string ((const char **)ptr_option->string_values,
"|");
if (!infolist_new_var_string (ptr_item,
"string_values",
string_values))
{
if (string_values)
free (string_values);
free (option_full_name);
return 0;
}
if (string_values)
free (string_values);
if (!infolist_new_var_integer (ptr_item,
"min",
ptr_option->min))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_integer (ptr_item,
"max",
ptr_option->max))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_integer (ptr_item,
"null_value_allowed",
ptr_option->null_value_allowed))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_integer (ptr_item,
"value_is_null",
(ptr_option->value) ?
0 : 1))
{
free (option_full_name);
return 0;
}
if (!infolist_new_var_integer (ptr_item,
"default_value_is_null",
(ptr_option->default_value) ?
0 : 1))
{
free (option_full_name);
return 0;
}
switch (ptr_option->type)
{
case CONFIG_OPTION_TYPE_BOOLEAN:
if (!infolist_new_var_string (ptr_item,
"type",
"boolean"))
{
free (option_full_name);
return 0;
}
if (ptr_option->value)
{
if (CONFIG_BOOLEAN(ptr_option) == CONFIG_BOOLEAN_TRUE)
snprintf (value, sizeof (value), "on");
else
snprintf (value, sizeof (value), "off");
if (!infolist_new_var_string (ptr_item,
"value",
value))
{
free (option_full_name);
return 0;
}
}
if (ptr_option->default_value)
{
if (CONFIG_BOOLEAN_DEFAULT(ptr_option) == CONFIG_BOOLEAN_TRUE)
snprintf (value, sizeof (value), "on");
else
snprintf (value, sizeof (value), "off");
if (!infolist_new_var_string (ptr_item,
"default_value",
value))
{
free (option_full_name);
return 0;
}
}
break;
case CONFIG_OPTION_TYPE_INTEGER:
if (!infolist_new_var_string (ptr_item,
"type",
"integer"))
{
free (option_full_name);
return 0;
}
if (ptr_option->string_values)
{
if (ptr_option->value)
{
if (!infolist_new_var_string (ptr_item,
"value",
ptr_option->string_values[CONFIG_INTEGER(ptr_option)]))
{
free (option_full_name);
return 0;
}
}
if (ptr_option->default_value)
{
if (!infolist_new_var_string (ptr_item,
"default_value",
ptr_option->string_values[CONFIG_INTEGER_DEFAULT(ptr_option)]))
{
free (option_full_name);
return 0;
}
}
}
else
{
if (ptr_option->value)
{
snprintf (value, sizeof (value), "%d",
CONFIG_INTEGER(ptr_option));
if (!infolist_new_var_string (ptr_item,
"value",
value))
{
free (option_full_name);
return 0;
}
}
if (ptr_option->default_value)
{
snprintf (value, sizeof (value), "%d",
CONFIG_INTEGER_DEFAULT(ptr_option));
if (!infolist_new_var_string (ptr_item,
"default_value",
value))
{
free (option_full_name);
return 0;
}
}
}
break;
case CONFIG_OPTION_TYPE_STRING:
if (!infolist_new_var_string (ptr_item,
"type",
"string"))
{
free (option_full_name);
return 0;
}
if (ptr_option->value)
{
if (!infolist_new_var_string (ptr_item,
"value",
CONFIG_STRING(ptr_option)))
{
free (option_full_name);
return 0;
}
}
if (ptr_option->default_value)
{
if (!infolist_new_var_string (ptr_item,
"default_value",
CONFIG_STRING_DEFAULT(ptr_option)))
{
free (option_full_name);
return 0;
}
}
break;
case CONFIG_OPTION_TYPE_COLOR:
if (!infolist_new_var_string (ptr_item,
"type",
"color"))
{
free (option_full_name);
return 0;
}
if (ptr_option->value)
{
if (!infolist_new_var_string (ptr_item,
"value",
gui_color_get_name (CONFIG_COLOR(ptr_option))))
{
free (option_full_name);
return 0;
}
}
if (ptr_option->default_value)
{
if (!infolist_new_var_string (ptr_item,
"default_value",
gui_color_get_name (CONFIG_COLOR_DEFAULT(ptr_option))))
{
free (option_full_name);
return 0;
}
}
break;
case CONFIG_NUM_OPTION_TYPES:
break;
}
}
free (option_full_name);
return 0;
}
}
}
@ -3327,6 +3386,7 @@ config_file_print_log ()
log_printf (" config_file. . . . . : 0x%lx", ptr_option->config_file);
log_printf (" section. . . . . . . : 0x%lx", ptr_option->section);
log_printf (" name . . . . . . . . : '%s'", ptr_option->name);
log_printf (" parent_name. . . . . : '%s'", ptr_option->parent_name);
log_printf (" type . . . . . . . . : %d", ptr_option->type);
log_printf (" description. . . . . : '%s'", ptr_option->description);
log_printf (" string_values. . . . : 0x%lx", ptr_option->string_values);

View File

@ -115,6 +115,8 @@ struct t_config_option
struct t_config_file *config_file; /* configuration file */
struct t_config_section *section; /* section */
char *name; /* name */
char *parent_name; /* parent name (to inherit the */
/* value from another option) */
enum t_config_option_type type; /* type */
char *description; /* description */
char **string_values; /* allowed string values */
@ -222,6 +224,10 @@ extern int config_file_option_set_null (struct t_config_option *option,
extern int config_file_option_unset (struct t_config_option *option);
extern void config_file_option_rename (struct t_config_option *option,
const char *new_name);
extern char *config_file_option_value_to_string (struct t_config_option *option,
int default_value,
int add_delimiters,
int use_colors);
extern void *config_file_option_get_pointer (struct t_config_option *option,
const char *property);
extern int config_file_option_is_null (struct t_config_option *option);

View File

@ -224,6 +224,7 @@ struct t_config_option *config_color_chat_text_found_bg;
struct t_config_option *config_color_chat_time;
struct t_config_option *config_color_chat_time_delimiters;
struct t_config_option *config_color_chat_value;
struct t_config_option *config_color_chat_value_null;
struct t_config_option *config_color_emphasized;
struct t_config_option *config_color_emphasized_bg;
struct t_config_option *config_color_input_actions;
@ -3220,6 +3221,12 @@ config_weechat_init_options ()
N_("text color for values"),
NULL, GUI_COLOR_CHAT_VALUE, 0, "cyan", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
config_color_chat_value_null = config_file_new_option (
weechat_config_file, ptr_section,
"chat_value_null", "color",
N_("text color for null values (undefined)"),
NULL, GUI_COLOR_CHAT_VALUE_NULL, 0, "blue", NULL, 0,
NULL, NULL, &config_change_color, NULL, NULL, NULL);
/* emphasis (chat/bars) */
config_color_emphasized = config_file_new_option (
weechat_config_file, ptr_section,

View File

@ -268,6 +268,7 @@ extern struct t_config_option *config_color_chat_text_found_bg;
extern struct t_config_option *config_color_chat_time;
extern struct t_config_option *config_color_chat_time_delimiters;
extern struct t_config_option *config_color_chat_value;
extern struct t_config_option *config_color_chat_value_null;
extern struct t_config_option *config_color_emphasized;
extern struct t_config_option *config_color_emphasized_bg;
extern struct t_config_option *config_color_input_actions;

View File

@ -1462,6 +1462,7 @@ gui_color_init_weechat ()
gui_color_build (GUI_COLOR_CHAT_NICK_SUFFIX, CONFIG_COLOR(config_color_chat_nick_suffix), CONFIG_COLOR(config_color_chat_bg));
gui_color_build (GUI_COLOR_EMPHASIS, CONFIG_COLOR(config_color_emphasized), CONFIG_COLOR(config_color_emphasized_bg));
gui_color_build (GUI_COLOR_CHAT_DAY_CHANGE, CONFIG_COLOR(config_color_chat_day_change), CONFIG_COLOR(config_color_chat_bg));
gui_color_build (GUI_COLOR_CHAT_VALUE_NULL, CONFIG_COLOR(config_color_chat_value_null), CONFIG_COLOR(config_color_chat_bg));
/*
* define old nick colors for compatibility on /upgrade with previous

View File

@ -26,10 +26,13 @@ struct t_config_option;
/*
* Color from configuration options.
*
* When changing some colors below:
* - always add to the end
* - never remove a color (mark it as obsolete if needed)
* - do not re-use an obsolete color
* - add build of color in file src/gui/curses/gui-curses-color.c,
* function gui_color_init_weechat ()
* - update the Developer's guide
*/
@ -84,6 +87,7 @@ enum t_gui_color_enum
GUI_COLOR_CHAT_NICK_SUFFIX,
GUI_COLOR_EMPHASIS,
GUI_COLOR_CHAT_DAY_CHANGE,
GUI_COLOR_CHAT_VALUE_NULL,
/* number of colors */
GUI_COLOR_NUM_COLORS,

View File

@ -1074,25 +1074,28 @@ irc_server_alloc (const char *name)
for (i = 0; i < IRC_SERVER_NUM_OPTIONS; i++)
{
length = strlen (new_server->name) + 1 +
strlen (irc_server_options[i][0]) + 1;
strlen (irc_server_options[i][0]) +
512 + /* inherited option name (irc.server_default.xxx) */
1;
option_name = malloc (length);
if (option_name)
{
snprintf (option_name, length, "%s.%s",
snprintf (option_name, length, "%s.%s << irc.server_default.%s",
new_server->name,
irc_server_options[i][0],
irc_server_options[i][0]);
new_server->options[i] =
irc_config_server_new_option (irc_config_file,
irc_config_section_server,
i,
option_name,
NULL,
NULL,
1,
&irc_config_server_check_value_cb,
irc_server_options[i][0],
&irc_config_server_change_cb,
irc_server_options[i][0]);
new_server->options[i] = irc_config_server_new_option (
irc_config_file,
irc_config_section_server,
i,
option_name,
NULL,
NULL,
1,
&irc_config_server_check_value_cb,
irc_server_options[i][0],
&irc_config_server_change_cb,
irc_server_options[i][0]);
irc_config_server_change_cb (irc_server_options[i][0],
new_server->options[i]);
free (option_name);