core: display default values for changed config options in output of /set

This commit is contained in:
Peter Boström 2012-11-27 12:30:57 +01:00 committed by Sebastien Helleu
parent dbff3de7e5
commit 1585593bda
13 changed files with 153 additions and 24 deletions

View File

@ -1,12 +1,13 @@
WeeChat ChangeLog
=================
Sébastien Helleu <flashcode@flashtux.org>
v0.4.0-dev, 2012-11-23
v0.4.0-dev, 2012-11-27
Version 0.4.0 (under dev!)
--------------------------
* core: display default values for changed config options in output of /set
* core: stop cmake if gcrypt lib is not found (bug #37671)
* core: add incomplete mouse events "event-down" and "event-drag" (task #11840)
* core: add command /eval, use expression in conditions for bars

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Jiri Golembiovsky <golemj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -684,6 +684,10 @@ msgstr "Volby uloženy do %s"
msgid "%sError: failed to save options to %s"
msgstr "%sChyba: selhalo uložení voleb do %s"
#, fuzzy
msgid "default: "
msgstr "výchozí hodnota"
msgid "(unknown)"
msgstr "(neznámý)"

View File

@ -23,7 +23,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.3.7-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-11-04 15:41+0100\n"
"Last-Translator: Nils Görs <weechatter@arcor.de>\n"
"Language-Team: German <weechatter@arcor.de>\n"
@ -704,6 +704,10 @@ msgstr "Optionen gesichert unter: %s"
msgid "%sError: failed to save options to %s"
msgstr "%sFehler: Optionen konnten nicht unter %s gesichert werden"
#, fuzzy
msgid "default: "
msgstr "Standardwert"
msgid "(unknown)"
msgstr "(unbekannt)"

View File

@ -22,7 +22,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Elián Hanisch <lambdae2@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -687,6 +687,10 @@ msgstr "Opciones guardadas en %s"
msgid "%sError: failed to save options to %s"
msgstr "%sError: no se pudo guardar las opciones en %s"
#, fuzzy
msgid "default: "
msgstr "valor por defecto"
msgid "(unknown)"
msgstr "(desconocido)"

View File

@ -21,8 +21,8 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"PO-Revision-Date: 2012-11-23 20:20+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-11-26 15:08+0100\n"
"Last-Translator: Sebastien Helleu <flashcode@flashtux.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
"Language: French\n"
@ -691,6 +691,9 @@ msgstr "Options sauvegardées dans %s"
msgid "%sError: failed to save options to %s"
msgstr "%sErreur: impossible de sauvegarder les options dans %s"
msgid "default: "
msgstr "défaut: "
msgid "(unknown)"
msgstr "(inconnu)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Andras Voroskoi <voroskoi@frugalware.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -722,6 +722,10 @@ msgstr "Modul beállítások elmentve\n"
msgid "%sError: failed to save options to %s"
msgstr "%s nem sikerült a modul opciókat elmenteni\n"
#, fuzzy
msgid "default: "
msgstr " . alapérték: %d\n"
msgid "(unknown)"
msgstr "(ismeretlen)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Marco Paolone <marcopaolone@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -684,6 +684,10 @@ msgstr "Opzioni salvate in %s"
msgid "%sError: failed to save options to %s"
msgstr "%sErrore: impossibile salvare le opzioni in %s"
#, fuzzy
msgid "default: "
msgstr "valore predefinito"
msgid "(unknown)"
msgstr "(sconosciuto)"

View File

@ -20,7 +20,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: AYANOKOUZI, Ryuunosuke <i38w7i3@yahoo.co.jp>\n"
"Language-Team: Japanese <https://github.com/l/WeeChat>\n"
@ -683,6 +683,10 @@ msgstr "%s にオプションを保存しました"
msgid "%sError: failed to save options to %s"
msgstr "%sエラー: %s へのオプションの保存に失敗しました"
#, fuzzy
msgid "default: "
msgstr "デフォルト値"
msgid "(unknown)"
msgstr "(未定義)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-09-29 11:42+0200\n"
"Last-Translator: Krzysztof Korościk <soltys@szluug.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -690,6 +690,10 @@ msgstr "Ustawienia zapisano do %s"
msgid "%sError: failed to save options to %s"
msgstr "%sBłąd: nie udało się zapisać ustawień do %s"
#, fuzzy
msgid "default: "
msgstr "domyślna wartość"
msgid "(unknown)"
msgstr "(nieznane)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-09-29 11:43+0200\n"
"Last-Translator: Sergio Durigan Junior <sergiosdj@gmail.com>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -720,6 +720,10 @@ msgstr "Opções salvas para %s"
msgid "%sError: failed to save options to %s"
msgstr "%sErro: falhou ao salvar as opções para %s"
#, fuzzy
msgid "default: "
msgstr "valor padrão"
msgid "(unknown)"
msgstr "(desconhecido)"

View File

@ -21,7 +21,7 @@ msgid ""
msgstr ""
"Project-Id-Version: WeeChat 0.4.0-dev\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: 2012-09-29 11:43+0200\n"
"Last-Translator: Aleksey V Zapparov AKA ixti <ixti@member.fsf.org>\n"
"Language-Team: weechat-dev <weechat-dev@nongnu.org>\n"
@ -735,6 +735,10 @@ msgstr "Настройки pluginов сохранены\n"
msgid "%sError: failed to save options to %s"
msgstr "%s не могу сохранить конфигурационный файл pluginов\n"
#, fuzzy
msgid "default: "
msgstr " . значение по умолчанию: %d\n"
msgid "(unknown)"
msgstr "(неизвестен)"

View File

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: flashcode@flashtux.org\n"
"POT-Creation-Date: 2012-11-23 20:19+0100\n"
"POT-Creation-Date: 2012-11-26 17:35+0100\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
@ -635,6 +635,9 @@ msgstr ""
msgid "%sError: failed to save options to %s"
msgstr ""
msgid "default: "
msgstr ""
msgid "(unknown)"
msgstr ""

View File

@ -4348,52 +4348,110 @@ command_set_display_option (struct t_config_option *option,
const char *message)
{
const char *color_name;
char str_default[128];
const char *display_undefined = _("(undefined)");
const char *display_default;
display_default = NULL;
if (option->value)
{
if (!option->default_value)
{
display_default = display_undefined;
}
switch (option->type)
{
case CONFIG_OPTION_TYPE_BOOLEAN:
if (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, GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%s",
"%s%s.%s.%s%s = %s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
option->config_file->name,
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");
(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 (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, GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%s",
"%s%s.%s.%s%s = %s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
option->config_file->name,
option->section->name,
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
option->string_values[CONFIG_INTEGER(option)]);
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, GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%d",
"%s%s.%s.%s%s = %s%d%s%s%s%s%s%s%s%s",
(message) ? message : " ",
option->config_file->name,
option->section->name,
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
CONFIG_INTEGER(option));
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 (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, GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = \"%s%s%s\"",
"%s%s.%s.%s%s = \"%s%s%s\"%s%s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
option->config_file->name,
option->section->name,
@ -4401,19 +4459,47 @@ command_set_display_option (struct t_config_option *option,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
CONFIG_STRING(option),
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS));
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 (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, GUI_CHAT_TAG_NO_HIGHLIGHT,
"%s%s.%s.%s%s = %s%s",
"%s%s.%s.%s%s = %s%s%s%s%s%s%s%s%s%s",
(message) ? message : " ",
option->config_file->name,
option->section->name,
option->name,
GUI_COLOR(GUI_COLOR_CHAT_DELIMITERS),
GUI_COLOR(GUI_COLOR_CHAT_VALUE),
(color_name) ? color_name : _("(unknown)"));
(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 */