diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-10-18 19:31:40 +0200 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-10-18 19:31:40 +0200 |
commit | 3b81a4746a4e0b648df1e05c79e077cc93b69459 (patch) | |
tree | 0914480d42a49b709763facafd2706706f3cbc32 | |
parent | 8511f9a77e45307389f54afa8ddfc1e112f0f59c (diff) | |
download | weechat-3b81a4746a4e0b648df1e05c79e077cc93b69459.zip |
Add new argument "value" to function config_new_option
27 files changed, 354 insertions, 374 deletions
diff --git a/doc/de/autogen/aspell_options.xml b/doc/de/autogen/aspell_options.xml index f26722a36..fd9bce47f 100644 --- a/doc/de/autogen/aspell_options.xml +++ b/doc/de/autogen/aspell_options.xml @@ -54,38 +54,6 @@ </listitem> </itemizedlist> -<command>aspell.dict.irc.local.#test</command> -<itemizedlist> - <listitem> - <para>description: liste de dictionnaires (séparés par des virgules) à utiliser sur ce tampon</para> - </listitem> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string</para> - </listitem> - <listitem> - <para>default value: 'fr'</para> - </listitem> -</itemizedlist> - -<command>aspell.dict.irc.local.#test2</command> -<itemizedlist> - <listitem> - <para>description: liste de dictionnaires (séparés par des virgules) à utiliser sur ce tampon</para> - </listitem> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string</para> - </listitem> - <listitem> - <para>default value: 'fr'</para> - </listitem> -</itemizedlist> - <command>aspell.look.color</command> <itemizedlist> <listitem> diff --git a/doc/de/autogen/irc_options.xml b/doc/de/autogen/irc_options.xml index abe8d65d2..4b35c1489 100644 --- a/doc/de/autogen/irc_options.xml +++ b/doc/de/autogen/irc_options.xml @@ -562,7 +562,7 @@ <para>values: any string</para> </listitem> <listitem> - <para>default value: 'flashcode,flashcode1,flashcode2,flashcode3,flashcode4'</para> + <para>default value: ''</para> </listitem> </itemizedlist> @@ -594,7 +594,7 @@ <para>values: any string</para> </listitem> <listitem> - <para>default value: 'flashcode'</para> + <para>default value: ''</para> </listitem> </itemizedlist> @@ -626,7 +626,7 @@ <para>values: any string</para> </listitem> <listitem> - <para>default value: 'flashcode'</para> + <para>default value: ''</para> </listitem> </itemizedlist> diff --git a/doc/docgen.pl b/doc/docgen.pl index 76d8326da..680c544b4 100644 --- a/doc/docgen.pl +++ b/doc/docgen.pl @@ -73,7 +73,8 @@ my %plugin_list = ("weechat" => "co", "alias" => "", # options to ignore my @ignore_options = ("weechat\\.bar\\..*", - "irc\\.server\\..*"); + "irc\\.server\\..*", + "aspell\\.dict\\..*"); # --------------------------------[ init ]-------------------------------------- diff --git a/doc/en/autogen/aspell_options.xml b/doc/en/autogen/aspell_options.xml index f26722a36..fd9bce47f 100644 --- a/doc/en/autogen/aspell_options.xml +++ b/doc/en/autogen/aspell_options.xml @@ -54,38 +54,6 @@ </listitem> </itemizedlist> -<command>aspell.dict.irc.local.#test</command> -<itemizedlist> - <listitem> - <para>description: liste de dictionnaires (séparés par des virgules) à utiliser sur ce tampon</para> - </listitem> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string</para> - </listitem> - <listitem> - <para>default value: 'fr'</para> - </listitem> -</itemizedlist> - -<command>aspell.dict.irc.local.#test2</command> -<itemizedlist> - <listitem> - <para>description: liste de dictionnaires (séparés par des virgules) à utiliser sur ce tampon</para> - </listitem> - <listitem> - <para>type: string</para> - </listitem> - <listitem> - <para>values: any string</para> - </listitem> - <listitem> - <para>default value: 'fr'</para> - </listitem> -</itemizedlist> - <command>aspell.look.color</command> <itemizedlist> <listitem> diff --git a/doc/en/autogen/irc_options.xml b/doc/en/autogen/irc_options.xml index cdbfa1088..2199cf1e1 100644 --- a/doc/en/autogen/irc_options.xml +++ b/doc/en/autogen/irc_options.xml @@ -562,7 +562,7 @@ <para>values: any string</para> </listitem> <listitem> - <para>default value: 'flashcode,flashcode1,flashcode2,flashcode3,flashcode4'</para> + <para>default value: ''</para> </listitem> </itemizedlist> @@ -594,7 +594,7 @@ <para>values: any string</para> </listitem> <listitem> - <para>default value: 'flashcode'</para> + <para>default value: ''</para> </listitem> </itemizedlist> @@ -626,7 +626,7 @@ <para>values: any string</para> </listitem> <listitem> - <para>default value: 'flashcode'</para> + <para>default value: ''</para> </listitem> </itemizedlist> diff --git a/doc/fr/autogen/aspell_options.xml b/doc/fr/autogen/aspell_options.xml index 34a21f6ed..3090faee5 100644 --- a/doc/fr/autogen/aspell_options.xml +++ b/doc/fr/autogen/aspell_options.xml @@ -54,38 +54,6 @@ </listitem> </itemizedlist> -<command>aspell.dict.irc.local.#test</command> -<itemizedlist> - <listitem> - <para>description: liste de dictionnaires (séparés par des virgules) à utiliser sur ce tampon</para> - </listitem> - <listitem> - <para>type: chaîne</para> - </listitem> - <listitem> - <para>valeurs: toute chaîne</para> - </listitem> - <listitem> - <para>valeur par défaut: 'fr'</para> - </listitem> -</itemizedlist> - -<command>aspell.dict.irc.local.#test2</command> -<itemizedlist> - <listitem> - <para>description: liste de dictionnaires (séparés par des virgules) à utiliser sur ce tampon</para> - </listitem> - <listitem> - <para>type: chaîne</para> - </listitem> - <listitem> - <para>valeurs: toute chaîne</para> - </listitem> - <listitem> - <para>valeur par défaut: 'fr'</para> - </listitem> -</itemizedlist> - <command>aspell.look.color</command> <itemizedlist> <listitem> diff --git a/doc/fr/autogen/irc_options.xml b/doc/fr/autogen/irc_options.xml index e40d5e65f..2dca1d342 100644 --- a/doc/fr/autogen/irc_options.xml +++ b/doc/fr/autogen/irc_options.xml @@ -562,7 +562,7 @@ <para>valeurs: toute chaîne</para> </listitem> <listitem> - <para>valeur par défaut: 'flashcode,flashcode1,flashcode2,flashcode3,flashcode4'</para> + <para>valeur par défaut: ''</para> </listitem> </itemizedlist> @@ -594,7 +594,7 @@ <para>valeurs: toute chaîne</para> </listitem> <listitem> - <para>valeur par défaut: 'flashcode'</para> + <para>valeur par défaut: ''</para> </listitem> </itemizedlist> @@ -626,7 +626,7 @@ <para>valeurs: toute chaîne</para> </listitem> <listitem> - <para>valeur par défaut: 'flashcode'</para> + <para>valeur par défaut: ''</para> </listitem> </itemizedlist> diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 637f20150..b819319d6 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -349,6 +349,7 @@ config_file_new_option (struct t_config_file *config_file, const char *type, const char *description, const char *string_values, int min, int max, const char *default_value, + const char *value, int (*callback_check_value)(void *data, struct t_config_option *option, const char *value), @@ -389,6 +390,11 @@ config_file_new_option (struct t_config_file *config_file, return NULL; } + if (default_value && !value) + value = default_value; + else if (!default_value && value) + default_value = value; + new_option = malloc (sizeof (*new_option)); if (new_option) { @@ -407,6 +413,7 @@ config_file_new_option (struct t_config_file *config_file, int_value = config_file_string_to_boolean (default_value); new_option->default_value = malloc (sizeof (int)); *((int *)new_option->default_value) = int_value; + int_value = config_file_string_to_boolean (value); new_option->value = malloc (sizeof (int)); *((int *)new_option->value) = int_value; break; @@ -429,6 +436,16 @@ config_file_new_option (struct t_config_file *config_file, } new_option->default_value = malloc (sizeof (int)); *((int *)new_option->default_value) = index_value; + index_value = 0; + for (i = 0; i < argc; i++) + { + if (string_strcasecmp (new_option->string_values[i], + value) == 0) + { + index_value = i; + break; + } + } new_option->value = malloc (sizeof (int)); *((int *)new_option->value) = index_value; } @@ -443,6 +460,10 @@ config_file_new_option (struct t_config_file *config_file, number = 0; new_option->default_value = malloc (sizeof (int)); *((int *)new_option->default_value) = number; + error = NULL; + number = strtol (value, &error, 10); + if (!error || error[0]) + number = 0; new_option->value = malloc (sizeof (int)); *((int *)new_option->value) = number; } @@ -453,8 +474,8 @@ config_file_new_option (struct t_config_file *config_file, new_option->max = max; new_option->default_value = (default_value) ? strdup (default_value) : NULL; - new_option->value = (default_value) ? - strdup (default_value) : NULL; + new_option->value = (value) ? + strdup (value) : NULL; break; case CONFIG_OPTION_TYPE_COLOR: new_option->string_values = NULL; @@ -464,7 +485,8 @@ config_file_new_option (struct t_config_file *config_file, if (!gui_color_assign (new_option->default_value, default_value)) *((int *)new_option->default_value) = 0; new_option->value = malloc (sizeof (int)); - *((int *)new_option->value) = *((int *)new_option->default_value); + if (!gui_color_assign (new_option->value, value)) + *((int *)new_option->value) = 0; break; case CONFIG_NUM_OPTION_TYPES: break; diff --git a/src/core/wee-config-file.h b/src/core/wee-config-file.h index 25ab005ba..e3be39cc7 100644 --- a/src/core/wee-config-file.h +++ b/src/core/wee-config-file.h @@ -175,6 +175,7 @@ extern struct t_config_option *config_file_new_option (struct t_config_file *con const char *string_values, int min, int max, const char *default_value, + const char *value, int (*callback_check_value)(void *data, struct t_config_option *option, const char *value), diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 730f03549..47488ec0f 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -835,27 +835,27 @@ config_weechat_init () weechat_config_file, ptr_section, "command_after_plugins", "string", N_("command executed when WeeChat starts, after loading plugins"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_startup_command_before_plugins = config_file_new_option ( weechat_config_file, ptr_section, "command_before_plugins", "string", N_("command executed when WeeChat starts, before loading plugins"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_startup_display_logo = config_file_new_option ( weechat_config_file, ptr_section, "display_logo", "boolean", N_("display WeeChat logo at startup"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_startup_display_version = config_file_new_option ( weechat_config_file, ptr_section, "display_version", "boolean", N_("display WeeChat version at startup"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_startup_weechat_slogan = config_file_new_option ( weechat_config_file, ptr_section, "weechat_slogan", "string", N_("WeeChat slogan (if empty, slogan is not used)"), - NULL, 0, 0, _("the geekiest chat client!"), NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, _("the geekiest chat client!"), NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* look */ ptr_section = config_file_new_section (weechat_config_file, "look", @@ -874,18 +874,18 @@ config_weechat_init () N_("default notify level for buffers (used to tell WeeChat if buffer " "must be displayed in hotlist or not, according to importance " "of message)"), - "none|highlight|message|all", 0, 0, "all", + "none|highlight|message|all", 0, 0, "all", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_buffer_time_format = config_file_new_option ( weechat_config_file, ptr_section, "buffer_time_format", "string", N_("time format for buffers"), - NULL, 0, 0, "%H:%M:%S", NULL, NULL, &config_change_buffer_time_format, NULL, NULL, NULL); + NULL, 0, 0, "%H:%M:%S", NULL, NULL, NULL, &config_change_buffer_time_format, NULL, NULL, NULL); config_look_color_nicks_number = config_file_new_option ( weechat_config_file, ptr_section, "color_nicks_number", "integer", N_("number of colors to use for nicks colors"), - NULL, 1, 10, "10", NULL, NULL, &config_change_nicks_colors, NULL, NULL, NULL); + NULL, 1, 10, "10", NULL, NULL, NULL, &config_change_nicks_colors, NULL, NULL, NULL); config_look_color_real_white = config_file_new_option ( weechat_config_file, ptr_section, "color_real_white", "boolean", @@ -894,47 +894,47 @@ config_weechat_init () "white background, you should turn on this option to " "see real white instead of default term foreground " "color)"), - NULL, 0, 0, "off", NULL, NULL, &config_change_color, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_look_day_change = config_file_new_option ( weechat_config_file, ptr_section, "day_change", "boolean", N_("display special message when day changes"), - NULL, 0, 0, "on", NULL, NULL, &config_change_day_change, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_day_change, NULL, NULL, NULL); config_look_day_change_time_format = config_file_new_option ( weechat_config_file, ptr_section, "day_change_time_format", "string", N_("time format for date displayed when day changed"), - NULL, 0, 0, "%a, %d %b %Y", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%a, %d %b %Y", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_highlight = config_file_new_option ( weechat_config_file, ptr_section, "highlight", "string", N_("comma separated list of words to highlight (case insensitive " "comparison, words may begin or end with \"*\" for partial match)"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_hotlist_names_count = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_names_count", "integer", N_("max number of names in hotlist (0 = no name " "displayed, only buffer numbers)"), - NULL, 0, 32, "3", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 32, "3", NULL, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_hotlist_names_length = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_names_length", "integer", N_("max length of names in hotlist (0 = no limit)"), - NULL, 0, 32, "0", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 32, "0", NULL, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_hotlist_names_level = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_names_level", "integer", N_("level for displaying names in hotlist (combination " "of: 1=join/part, 2=message, 4=private, 8=highlight, " "for example: 12=private+highlight)"), - NULL, 1, 15, "12", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 1, 15, "12", NULL, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_hotlist_short_names = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_short_names", "boolean", N_("if set, uses short names to display buffer names in hotlist (start " "after first '.' in name)"), - NULL, 0, 0, "on", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_hotlist_sort = config_file_new_option ( weechat_config_file, ptr_section, "hotlist_sort", "integer", @@ -943,137 +943,137 @@ config_weechat_init () "number_asc, number_desc)"), "group_time_asc|group_time_desc|group_number_asc|" "group_number_desc|number_asc|number_desc", - 0, 0, "group_time_asc", NULL, NULL, &config_change_hotlist, NULL, NULL, NULL); + 0, 0, "group_time_asc", NULL, NULL, NULL, &config_change_hotlist, NULL, NULL, NULL); config_look_input_format = config_file_new_option ( weechat_config_file, ptr_section, "input_format", "string", N_("format for input prompt ('%c' is replaced by channel " "or server, '%n' by nick and '%m' by nick modes)"), - NULL, 0, 0, "[%n(%m)] ", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 0, 0, "[%n(%m)] ", NULL, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_item_time_format = config_file_new_option ( weechat_config_file, ptr_section, "item_time_format", "string", N_("time format for \"time\" bar item"), - NULL, 0, 0, "%H:%M", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%H:%M", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_nicklist = config_file_new_option ( weechat_config_file, ptr_section, "nicklist", "boolean", N_("display nicklist (on buffers with nicklist enabled)"), - NULL, 0, 0, "on", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nicklist_max_size = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_max_size", "integer", N_("max size for nicklist (width or height, depending on " "nicklist_position (0 = no max size; if min = max " "and > 0, then size is fixed))"), - NULL, 0, 100, "0", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 100, "0", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nicklist_min_size = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_min_size", "integer", N_("min size for nicklist (width or height, depending on " "nicklist_position (0 = no min size))"), - NULL, 0, 100, "0", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 100, "0", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nicklist_position = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_position", "integer", N_("nicklist position (top, left, right (default), " "bottom)"), - "left|right|top|bottom", 0, 0, "right", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + "left|right|top|bottom", 0, 0, "right", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nicklist_separator = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_separator", "boolean", N_("separator between chat and nicklist"), - NULL, 0, 0, "on", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nickmode = config_file_new_option ( weechat_config_file, ptr_section, "nickmode", "boolean", N_("display nick mode ((half)op/voice) before each nick"), - NULL, 0, 0, "on", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_nickmode_empty = config_file_new_option ( weechat_config_file, ptr_section, "nickmode_empty", "boolean", N_("display space if nick mode is not (half)op/voice"), - NULL, 0, 0, "off", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_paste_max_lines = config_file_new_option ( weechat_config_file, ptr_section, "paste_max_lines", "integer", N_("max number of lines for paste without asking user " "(0 = disable this feature)"), - NULL, 0, INT_MAX, "3", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "3", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_error", "string", N_("prefix for error messages"), - NULL, 0, 0, "=!=", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, "=!=", NULL, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_network", "string", N_("prefix for network messages"), - NULL, 0, 0, "--", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, "--", NULL, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_action", "string", N_("prefix for action messages"), - NULL, 0, 0, " *", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, " *", NULL, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_join", "string", N_("prefix for join messages"), - NULL, 0, 0, "-->", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, "-->", NULL, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( weechat_config_file, ptr_section, "prefix_quit", "string", N_("prefix for quit messages"), - NULL, 0, 0, "<--", NULL, NULL, &config_change_prefix, NULL, NULL, NULL); + NULL, 0, 0, "<--", NULL, NULL, NULL, &config_change_prefix, NULL, NULL, NULL); config_look_prefix_align = config_file_new_option ( weechat_config_file, ptr_section, "prefix_align", "integer", N_("prefix alignment (none, left, right (default))"), - "none|left|right", 0, 0, "right", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + "none|left|right", 0, 0, "right", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_prefix_align_max = config_file_new_option ( weechat_config_file, ptr_section, "prefix_align_max", "integer", N_("max size for prefix (0 = no max size)"), - NULL, 0, 64, "0", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 64, "0", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_prefix_suffix = config_file_new_option ( weechat_config_file, ptr_section, "prefix_suffix", "string", N_("string displayed after prefix"), - NULL, 0, 0, "|", NULL, NULL, &config_change_buffers, NULL, NULL, NULL); + NULL, 0, 0, "|", NULL, NULL, NULL, &config_change_buffers, NULL, NULL, NULL); config_look_read_marker = config_file_new_option ( weechat_config_file, ptr_section, "read_marker", "integer", N_("use a marker (line or char) on buffers to show first unread line"), "none|line|dotted-line|char", - 0, 0, "dotted-line", NULL, NULL, &config_change_read_marker, NULL, NULL, NULL); + 0, 0, "dotted-line", NULL, NULL, NULL, &config_change_read_marker, NULL, NULL, NULL); config_look_save_config_on_exit = config_file_new_option ( weechat_config_file, ptr_section, "save_config_on_exit", "boolean", N_("save configuration file on exit"), - NULL, 0, 0, "on", NULL, NULL, &config_change_save_config_on_exit, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_save_config_on_exit, NULL, NULL, NULL); config_look_save_layout_on_exit = config_file_new_option ( weechat_config_file, ptr_section, "save_layout_on_exit", "integer", N_("save layout on exit (buffers, windows, or both)"), - "none|buffers|windows|all", 0, 0, "all", NULL, NULL, NULL, NULL, NULL, NULL); + "none|buffers|windows|all", 0, 0, "all", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_scroll_amount = config_file_new_option ( weechat_config_file, ptr_section, "scroll_amount", "integer", N_("how many lines to scroll by with scroll_up and " "scroll_down"), - NULL, 1, INT_MAX, "3", NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); + NULL, 1, INT_MAX, "3", NULL, NULL, NULL, &config_change_buffer_content, NULL, NULL, NULL); config_look_scroll_page_percent = config_file_new_option ( weechat_config_file, ptr_section, "scroll_page_percent", "integer", N_("percent of screen to scroll when scrolling one page up or down " "(for example 100 means one page, 50 half-page)"), - NULL, 1, 100, "100", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 1, 100, "100", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_look_set_title = config_file_new_option ( weechat_config_file, ptr_section, "set_title", "boolean", N_("set title for window (terminal for Curses GUI) with " "name and version"), - NULL, 0, 0, "on", NULL, NULL, &config_change_title, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, &config_change_title, NULL, NULL, NULL); /* colors */ ptr_section = config_file_new_section (weechat_config_file, "color", @@ -1091,416 +1091,416 @@ config_weechat_init () weechat_config_file, ptr_section, "separator", "color", N_("background color for window separators (when splited)"), - NULL, GUI_COLOR_SEPARATOR, 0, "blue", + NULL, GUI_COLOR_SEPARATOR, 0, "blue", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); /* bar colors */ config_color_bar_more = config_file_new_option ( weechat_config_file, ptr_section, "bar_more", "color", N_("text color for '+' when scrolling bars"), - NULL, -1, 0, "lightmagenta", + NULL, -1, 0, "lightmagenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); /* title window */ config_color_title = config_file_new_option ( weechat_config_file, ptr_section, "title", "color", N_("text color for title bar"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_title_bg = config_file_new_option ( weechat_config_file, ptr_section, "title_bg", "color", N_("background color for title bar"), - NULL, -1, 0, "blue", + NULL, -1, 0, "blue", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); /* chat window */ config_color_chat = config_file_new_option ( weechat_config_file, ptr_section, "chat", "color", N_("text color for chat"), - NULL, GUI_COLOR_CHAT, 0, "default", + NULL, GUI_COLOR_CHAT, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_bg", "color", N_("background color for chat"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_time = config_file_new_option ( weechat_config_file, ptr_section, "chat_time", "color", N_("text color for time in chat window"), - NULL, GUI_COLOR_CHAT_TIME, 0, "default", + NULL, GUI_COLOR_CHAT_TIME, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_time_delimiters = config_file_new_option ( weechat_config_file, ptr_section, "chat_time_delimiters", "color", N_("text color for time delimiters"), - NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", + NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_error", "color", N_("text color for error prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", + NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_network", "color", N_("text color for network prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "magenta", + NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "magenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_action", "color", N_("text color for action prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", + NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_join", "color", N_("text color for join prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", + NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_quit", "color", N_("text color for quit prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", + NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix_more = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_more", "color", N_("text color for '+' when prefix is too long"), - NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", + NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_prefix_suffix = config_file_new_option ( weechat_config_file, ptr_section, "chat_prefix_suffix", "color", N_("text color for suffix (after prefix)"), - NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", + NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_buffer = config_file_new_option ( weechat_config_file, ptr_section, "chat_buffer", "color", N_("text color for buffer names"), - NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", + NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_server = config_file_new_option ( weechat_config_file, ptr_section, "chat_server", "color", N_("text color for server names"), - NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", + NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_channel = config_file_new_option ( weechat_config_file, ptr_section, "chat_channel", "color", N_("text color for channel names"), - NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", + NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick", "color", N_("text color for nicks in chat window"), - NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", + NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_self = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_self", "color", N_("text color for local nick in chat window"), - NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", + NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_other = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_other", "color", N_("text color for other nick in private buffer"), - NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "default", + NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[0] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color01", "color", N_("text color #1 for nick"), - NULL, GUI_COLOR_CHAT_NICK1, 0, "cyan", + NULL, GUI_COLOR_CHAT_NICK1, 0, "cyan", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[1] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color02", "color", N_("text color #2 for nick"), - NULL, GUI_COLOR_CHAT_NICK2, 0, "magenta", + NULL, GUI_COLOR_CHAT_NICK2, 0, "magenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[2] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color03", "color", N_("text color #3 for nick"), - NULL, GUI_COLOR_CHAT_NICK3, 0, "green", + NULL, GUI_COLOR_CHAT_NICK3, 0, "green", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[3] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color04", "color", N_("text color #4 for nick"), - NULL, GUI_COLOR_CHAT_NICK4, 0, "brown", + NULL, GUI_COLOR_CHAT_NICK4, 0, "brown", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[4] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color05", "color", N_("text color #5 for nick"), - NULL, GUI_COLOR_CHAT_NICK5, 0, "lightblue", + NULL, GUI_COLOR_CHAT_NICK5, 0, "lightblue", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[5] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color06", "color", N_("text color #6 for nick"), - NULL, GUI_COLOR_CHAT_NICK6, 0, "default", + NULL, GUI_COLOR_CHAT_NICK6, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[6] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color07", "color", N_("text color #7 for nick"), - NULL, GUI_COLOR_CHAT_NICK7, 0, "lightcyan", + NULL, GUI_COLOR_CHAT_NICK7, 0, "lightcyan", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[7] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color08", "color", N_("text color #8 for nick"), - NULL, GUI_COLOR_CHAT_NICK8, 0, "lightmagenta", + NULL, GUI_COLOR_CHAT_NICK8, 0, "lightmagenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[8] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color09", "color", N_("text color #9 for nick"), - NULL, GUI_COLOR_CHAT_NICK9, 0, "lightgreen", + NULL, GUI_COLOR_CHAT_NICK9, 0, "lightgreen", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_nick_colors[9] = config_file_new_option ( weechat_config_file, ptr_section, "chat_nick_color10", "color", N_("text color #10 for nick"), - NULL, GUI_COLOR_CHAT_NICK10, 0, "blue", + NULL, GUI_COLOR_CHAT_NICK10, 0, "blue", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_host = config_file_new_option ( weechat_config_file, ptr_section, "chat_host", "color", N_("text color for hostnames"), - NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", + NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_delimiters = config_file_new_option ( weechat_config_file, ptr_section, "chat_delimiters", "color", N_("text color for delimiters"), - NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", + NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_highlight = config_file_new_option ( weechat_config_file, ptr_section, "chat_highlight", "color", N_("text color for highlighted prefix"), - NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", + NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_highlight_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_highlight_bg", "color", N_("background color for highlighted prefix"), - NULL, -1, 0, "magenta", + NULL, -1, 0, "magenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_read_marker = config_file_new_option ( weechat_config_file, ptr_section, "chat_read_marker", "color", N_("text color for unread data marker"), - NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "magenta", + NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "magenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_read_marker_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_read_marker_bg", "color", N_("background color for unread data marker"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_text_found = config_file_new_option ( weechat_config_file, ptr_section, "chat_text_found", "color", N_("text color for marker on lines where text sought is found"), - NULL, GUI_COLOR_CHAT_TEXT_FOUND, 0, "yellow", + NULL, GUI_COLOR_CHAT_TEXT_FOUND, 0, "yellow", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_chat_text_found_bg = config_file_new_option ( weechat_config_file, ptr_section, "chat_text_found_bg", "color", N_("background color for marker on lines where text sought is found"), - NULL, -1, 0, "lightmagenta", + NULL, -1, 0, "lightmagenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); /* status window */ config_color_status = config_file_new_option ( weechat_config_file, ptr_section, "status", "color", N_("text color for status bar"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_bg = config_file_new_option ( weechat_config_file, ptr_section, "status_bg", "color", N_("background color for status bar"), - NULL, -1, 0, "blue", + NULL, -1, 0, "blue", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_delimiters = config_file_new_option ( weechat_config_file, ptr_section, "status_delimiters", "color", N_("text color for status bar delimiters"), - NULL, -1, 0, "cyan", + NULL, -1, 0, "cyan", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_number = config_file_new_option ( weechat_config_file, ptr_section, "status_number", "color", N_("text color for current buffer number in status bar"), - NULL, -1, 0, "yellow", + NULL, -1, 0, "yellow", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_name = config_file_new_option ( weechat_config_file, ptr_section, "status_name", "color", N_("text color for current buffer name in status bar"), - NULL, -1, 0, "white", + NULL, -1, 0, "white", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_data_msg = config_file_new_option ( weechat_config_file, ptr_section, "status_data_msg", "color", N_("text color for buffer with new messages (status bar)"), - NULL, -1, 0, "yellow", + NULL, -1, 0, "yellow", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_data_private = config_file_new_option ( weechat_config_file, ptr_section, "status_data_private", "color", N_("text color for buffer with private message (status bar)"), - NULL, -1, 0, "lightgreen", + NULL, -1, 0, "lightgreen", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_data_highlight = config_file_new_option ( weechat_config_file, ptr_section, "status_data_highlight", "color", N_("text color for buffer with highlight (status bar)"), - NULL, -1, 0, "lightmagenta", + NULL, -1, 0, "lightmagenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_data_other = config_file_new_option ( weechat_config_file, ptr_section, "status_data_other", "color", N_("text color for buffer with new data (not messages) " "(status bar)"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_status_more = config_file_new_option ( weechat_config_file, ptr_section, "status_more", "color", N_("text color for buffer with new data (status bar)"), - NULL, -1, 0, "yellow", + NULL, -1, 0, "yellow", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); /* input window */ config_color_input = config_file_new_option ( weechat_config_file, ptr_section, "input", "color", N_("text color for input line"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_bg = config_file_new_option ( weechat_config_file, ptr_section, "input_bg", "color", N_("background color for input line"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_server = config_file_new_option ( weechat_config_file, ptr_section, "input_server", "color", N_("text color for server name in input line"), - NULL, -1, 0, "brown", + NULL, -1, 0, "brown", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_channel = config_file_new_option ( weechat_config_file, ptr_section, "input_channel", "color", N_("text color for channel name in input line"), - NULL, -1, 0, "white", + NULL, -1, 0, "white", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_nick = config_file_new_option ( weechat_config_file, ptr_section, "input_nick", "color", N_("text color for nick name in input line"), - NULL, -1, 0, "lightcyan", + NULL, -1, 0, "lightcyan", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_delimiters = config_file_new_option ( weechat_config_file, ptr_section, "input_delimiters", "color", N_("text color for delimiters in input line"), - NULL, -1, 0, "cyan", + NULL, -1, 0, "cyan", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_text_not_found = config_file_new_option ( weechat_config_file, ptr_section, "input_text_not_found", "color", N_("text color for unsucessful text search in input line"), - NULL, -1, 0, "red", + NULL, -1, 0, "red", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_input_actions = config_file_new_option ( weechat_config_file, ptr_section, "input_actions", "color", N_("text color for actions in input line"), - NULL, -1, 0, "lightgreen", + NULL, -1, 0, "lightgreen", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); /* nicklist window */ config_color_nicklist = config_file_new_option ( weechat_config_file, ptr_section, "nicklist", "color", N_("text color for nicklist"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_bg = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_bg", "color", N_("background color for nicklist"), - NULL, -1, 0, "default", + NULL, -1, 0, "default", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_group = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_group", "color", N_("text color for groups in nicklist"), - NULL, -1, 0, "green", + NULL, -1, 0, "green", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_away = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_away", "color", N_("text color for away nicknames"), - NULL, -1, 0, "cyan", + NULL, -1, 0, "cyan", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix1 = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_prefix1", "color", N_("text color for prefix #1 in nicklist"), - NULL, -1, 0, "lightgreen", + NULL, -1, 0, "lightgreen", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix2 = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_prefix2", "color", N_("text color for prefix #2 in nicklist"), - NULL, -1, 0, "lightmagenta", + NULL, -1, 0, "lightmagenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix3 = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_prefix3", "color", N_("text color for prefix #3 in nicklist"), - NULL, -1, 0, "yellow", + NULL, -1, 0, "yellow", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix4 = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_prefix4", "color", N_("text color for prefix #4 in nicklist"), - NULL, -1, 0, "blue", + NULL, -1, 0, "blue", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_prefix5 = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_prefix5", "color", N_("text color for prefix #5 in nicklist"), - NULL, -1, 0, "brown", + NULL, -1, 0, "brown", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_more = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_more", "color", N_("text color for '+' when scrolling nicks in nicklist"), - NULL, -1, 0, "lightmagenta", + NULL, -1, 0, "lightmagenta", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); config_color_nicklist_separator = config_file_new_option ( weechat_config_file, ptr_section, "nicklist_separator", "color", N_("text color for nicklist separator"), - NULL, -1, 0, "blue", + NULL, -1, 0, "blue", NULL, NULL, NULL, &config_change_color, NULL, NULL, NULL); /* completion */ @@ -1518,45 +1518,45 @@ config_weechat_init () weechat_config_file, ptr_section, "nick_completor", "string", N_("string inserted after nick completion"), - NULL, 0, 0, ":", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, ":", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_first_only = config_file_new_option ( weechat_config_file, ptr_section, "nick_first_only", "boolean", N_("complete only with first nick found"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_nick_ignore_chars = config_file_new_option ( weechat_config_file, ptr_section, "nick_ignore_chars", "string", N_("chars ignored for nick completion"), - NULL, 0, 0, "[]-^", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "[]-^", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_alert = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_alert", "boolean", N_("alert user when a partial completion occurs"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_nick = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_nick", "boolean", N_("partially complete nicks (stop when many nicks found begin with " "same letters)"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_command = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_command", "boolean", N_("partially complete command names (stop when many commands found " "begin with same letters)"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_command_arg = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_command_arg", "boolean", N_("partially complete command arguments (stop when many arguments " "found begin with same prefix)"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_completion_partial_completion_count = config_file_new_option ( weechat_config_file, ptr_section, "partial_completion_count", "boolean", N_("display count for each partial completion in bar item"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* history */ ptr_section = config_file_new_section (weechat_config_file, "history", @@ -1574,19 +1574,19 @@ config_weechat_init () "max_lines", "integer", N_("maximum number of lines in history per buffer " "(0 = unlimited)"), - NULL, 0, INT_MAX, "4096", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "4096", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_history_max_commands = config_file_new_option ( weechat_config_file, ptr_section, "max_commands", "integer", N_("maximum number of user commands in history (0 = " "unlimited)"), - NULL, 0, INT_MAX, "100", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "100", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_history_display_default = config_file_new_option ( weechat_config_file, ptr_section, "display_default", "integer", N_("maximum number of commands to display by default in " "history listing (0 = unlimited)"), - NULL, 0, INT_MAX, "5", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "5", NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* proxy */ ptr_section = config_file_new_section (weechat_config_file, "proxy", @@ -1603,37 +1603,37 @@ config_weechat_init () weechat_config_file, ptr_section, "use", "boolean", N_("use a proxy server"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_type = config_file_new_option ( weechat_config_file, ptr_section, "type", "integer", N_("proxy type (http (default), socks4, socks5)"), - "http|socks4|socks5", 0, 0, "http", NULL, NULL, NULL, NULL, NULL, NULL); + "http|socks4|socks5", 0, 0, "http", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_ipv6 = config_file_new_option ( weechat_config_file, ptr_section, "ipv6", "boolean", N_("connect to proxy using ipv6"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_address = config_file_new_option ( weechat_config_file, ptr_section, "address", "string", N_("proxy server address (IP or hostname)"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_port = config_file_new_option ( weechat_config_file, ptr_section, "port", "integer", N_("port for connecting to proxy server"), - NULL, 0, 65535, "3128", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 65535, "3128", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_username = config_file_new_option ( weechat_config_file, ptr_section, "username", "string", N_("username for proxy server"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_proxy_password = config_file_new_option ( weechat_config_file, ptr_section, "password", "string", N_("password for proxy server"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* plugin */ ptr_section = config_file_new_section (weechat_config_file, "plugin", @@ -1653,13 +1653,13 @@ config_weechat_init () "at startup, \"*\" means all plugins found (names may " "be partial, for example \"perl\" is ok for " "\"perl.so\")"), - NULL, 0, 0, "*", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "*", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_plugin_debug = config_file_new_option ( weechat_config_file, ptr_section, "debug", "boolean", N_("enable debug messages by default in all plugins (option disabled " "by default, which is highly recommended)"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_plugin_extension = config_file_new_option ( weechat_config_file, ptr_section, "extension", "string", @@ -1671,18 +1671,18 @@ config_weechat_init () #else ".so", #endif - NULL, NULL, NULL, NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_plugin_path = config_file_new_option ( weechat_config_file, ptr_section, "path", "string", N_("path for searching plugins ('%h' will be replaced by " "WeeChat home, ~/.weechat by default)"), - NULL, 0, 0, "%h/plugins", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%h/plugins", NULL, NULL, NULL, NULL, NULL, NULL, NULL); config_plugin_save_config_on_unload = config_file_new_option ( weechat_config_file, ptr_section, "save_config_on_unload", "boolean", N_("save configuration files when unloading plugins"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* bars */ ptr_section = config_file_new_section (weechat_config_file, "bar", diff --git a/src/gui/gui-bar.c b/src/gui/gui-bar.c index 9580a5b6d..1f151eea0 100644 --- a/src/gui/gui-bar.c +++ b/src/gui/gui-bar.c @@ -997,7 +997,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "boolean", N_("true if bar is hidden, false if it is displayed"), - NULL, 0, 0, value, + NULL, 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_hidden, NULL, NULL, NULL); break; case GUI_BAR_OPTION_PRIORITY: @@ -1005,7 +1005,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "integer", N_("bar priority (high number means bar displayed first)"), - NULL, 0, INT_MAX, value, + NULL, 0, INT_MAX, value, NULL, NULL, NULL, &gui_bar_config_change_priority, NULL, NULL, NULL); break; case GUI_BAR_OPTION_TYPE: @@ -1013,7 +1013,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "integer", N_("bar type (root, window, window_active, window_inactive)"), - "root|window|window_active|window_inactive", 0, 0, value, + "root|window|window_active|window_inactive", 0, 0, value, NULL, &gui_bar_config_check_type, NULL, NULL, NULL, NULL, NULL); break; case GUI_BAR_OPTION_CONDITIONS: @@ -1022,7 +1022,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value option_name, "string", N_("condition(s) for displaying bar (for bars of type " "\"window\")"), - NULL, 0, 0, value, + NULL, 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_conditions, NULL, NULL, NULL); break; case GUI_BAR_OPTION_POSITION: @@ -1030,7 +1030,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "integer", N_("bar position (bottom, top, left, right)"), - "bottom|top|left|right", 0, 0, value, + "bottom|top|left|right", 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_position, NULL, NULL, NULL); break; case GUI_BAR_OPTION_FILLING_TOP_BOTTOM: @@ -1040,7 +1040,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value N_("bar filling direction (\"horizontal\" (from left to " "right) or \"vertical\" (from top to bottom)) when bar " "position is top or bottom"), - "horizontal|vertical", 0, 0, value, + "horizontal|vertical", 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_filling, NULL, NULL, NULL); break; case GUI_BAR_OPTION_FILLING_LEFT_RIGHT: @@ -1050,7 +1050,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value N_("bar filling direction (\"horizontal\" (from left to " "right) or \"vertical\" (from top to bottom)) when bar " "position is left or right"), - "horizontal|vertical", 0, 0, value, + "horizontal|vertical", 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_filling, NULL, NULL, NULL); break; case GUI_BAR_OPTION_SIZE: @@ -1058,7 +1058,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "integer", N_("bar size in chars (0 = auto size)"), - NULL, 0, INT_MAX, value, + NULL, 0, INT_MAX, value, NULL, &gui_bar_config_check_size, NULL, &gui_bar_config_change_size, NULL, NULL, NULL); @@ -1068,7 +1068,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "integer", N_("max bar size in chars (0 = no limit)"), - NULL, 0, INT_MAX, value, + NULL, 0, INT_MAX, value, NULL, NULL, NULL, &gui_bar_config_change_size_max, NULL, NULL, NULL); @@ -1078,7 +1078,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "color", N_("default text color for bar"), - NULL, 0, 0, value, + NULL, 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_color, NULL, NULL, NULL); @@ -1088,7 +1088,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "color", N_("default delimiter color for bar"), - NULL, 0, 0, value, + NULL, 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_color, NULL, NULL, NULL); @@ -1098,7 +1098,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "color", N_("default background color for bar"), - NULL, 0, 0, value, + NULL, 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_color, NULL, NULL, NULL); @@ -1108,7 +1108,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "boolean", N_("separator line between bar and other bars/windows"), - NULL, 0, 0, value, + NULL, 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_separator, NULL, NULL, NULL); break; case GUI_BAR_OPTION_ITEMS: @@ -1116,7 +1116,7 @@ gui_bar_create_option (const char *bar_name, int index_option, const char *value weechat_config_file, weechat_config_section_bar, option_name, "string", N_("items of bar"), - NULL, 0, 0, value, + NULL, 0, 0, value, NULL, NULL, NULL, &gui_bar_config_change_items, NULL, NULL, NULL); break; case GUI_BAR_NUM_OPTIONS: diff --git a/src/plugins/alias/alias.c b/src/plugins/alias/alias.c index 95de45628..1c1a80c56 100644 --- a/src/plugins/alias/alias.c +++ b/src/plugins/alias/alias.c @@ -619,7 +619,7 @@ alias_config_create_option (void *data, struct t_config_file *config_file, weechat_config_new_option ( config_file, section, option_name, "string", NULL, - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, "", value, NULL, NULL, &alias_config_change_cb, NULL, &alias_config_delete_cb, NULL); @@ -731,7 +731,7 @@ alias_command_cb (void *data, struct t_gui_buffer *buffer, int argc, weechat_config_new_option ( alias_config_file, alias_config_section_cmd, alias_name, "string", NULL, - NULL, 0, 0, argv_eol[2], NULL, NULL, + NULL, 0, 0, "", argv_eol[2], NULL, NULL, &alias_config_change_cb, NULL, &alias_config_delete_cb, NULL); diff --git a/src/plugins/aspell/weechat-aspell-config.c b/src/plugins/aspell/weechat-aspell-config.c index 11ad09d92..a286c7268 100644 --- a/src/plugins/aspell/weechat-aspell-config.c +++ b/src/plugins/aspell/weechat-aspell-config.c @@ -154,7 +154,7 @@ weechat_aspell_config_create_option (void *data, config_file, section, option_name, "string", _("comma separated list of dictionaries to use on this buffer"), - NULL, 0, 0, value, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", value, NULL, NULL, NULL, NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } @@ -232,7 +232,7 @@ weechat_aspell_config_init () weechat_aspell_config_file, ptr_section, "color", "color", N_("color used for mispelled words"), - NULL, 0, 0, "lightred", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "lightred", NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* check */ ptr_section = weechat_config_new_section (weechat_aspell_config_file, "check", @@ -252,7 +252,7 @@ weechat_aspell_config_init () "enabled (spell checking is disabled for all other commands)"), NULL, 0, 0, "ame,amsg,away,command,cycle,kick,kickban,me,msg,notice,part,query," - "quit,topic", + "quit,topic", NULL, NULL, NULL, &weechat_aspell_config_change_commands, NULL, NULL, NULL); weechat_aspell_config_check_default_dict = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, @@ -260,14 +260,14 @@ weechat_aspell_config_init () N_("default dictionary (or comma separated list of dictionaries) to " "use when buffer has no dictionary defined (leave blank to disable " "aspell on buffers for which you didn't explicitely enabled it)"), - NULL, 0, 0, "", + NULL, 0, 0, "", NULL, NULL, NULL, &weechat_aspell_config_change_default_dict, NULL, NULL, NULL); weechat_aspell_config_check_word_min_length = weechat_config_new_option ( weechat_aspell_config_file, ptr_section, "word_min_length", "integer", N_("minimum length for a word to be spell checked (use 0 to check all " "words)"), - NULL, 0, INT_MAX, "2", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "2", NULL, NULL, NULL, NULL, NULL, NULL, NULL); ptr_section = weechat_config_new_section (weechat_aspell_config_file, "dict", 1, 1, diff --git a/src/plugins/charset/charset.c b/src/plugins/charset/charset.c index d124d6d10..e4c7a88a1 100644 --- a/src/plugins/charset/charset.c +++ b/src/plugins/charset/charset.c @@ -144,7 +144,7 @@ charset_config_create_option (void *data, struct t_config_file *config_file, ptr_option = weechat_config_new_option ( config_file, section, option_name, "string", NULL, - NULL, 0, 0, value, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", value, NULL, NULL, NULL, NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } @@ -199,13 +199,13 @@ charset_config_init () (charset_terminal && charset_internal && (strcasecmp (charset_terminal, charset_internal) != 0)) ? - charset_terminal : "iso-8859-1", + charset_terminal : "iso-8859-1", NULL, NULL, NULL, NULL, NULL, NULL, NULL); charset_default_encode = weechat_config_new_option ( charset_config_file, ptr_section, "encode", "string", N_("global encoding charset"), - NULL, 0, 0, "", + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); ptr_section = weechat_config_new_section (charset_config_file, "decode", diff --git a/src/plugins/irc/irc-config.c b/src/plugins/irc/irc-config.c index 7a6285bca..385cf856b 100644 --- a/src/plugins/irc/irc-config.c +++ b/src/plugins/irc/irc-config.c @@ -590,7 +590,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "boolean", N_("automatically connect to server when WeeChat is starting"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -599,7 +601,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "boolean", N_("automatically reconnect to server when disconnected"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -608,7 +612,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "integer", N_("delay (in seconds) before trying again to reconnect to server"), - NULL, 0, 65535, value, NULL, NULL, + NULL, 0, 65535, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -617,7 +623,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "string", N_("list of IP/port or hostname/port for server (separated by comma)"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -626,7 +634,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "boolean", N_("use IPv6 protocol for server communication"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -635,7 +645,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "boolean", N_("use SSL for server communication"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -644,7 +656,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "string", N_("password for IRC server"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -653,7 +667,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "string", N_("nicknames to use on IRC server (separated by comma)"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -662,7 +678,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "string", N_("user name to use on IRC server"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -671,7 +689,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "string", N_("real name to use on IRC server"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -681,7 +701,9 @@ irc_config_server_new_option (struct t_config_file *config_file, option_name, "string", N_("custom local hostname/IP for server (optional, if empty " "local hostname is used)"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -692,7 +714,9 @@ irc_config_server_new_option (struct t_config_file *config_file, N_("command(s) to run when connected to server (many commands should " "be separated by ';', use '\\;' for a semicolon, special variables " "$nick, $channel and $server are replaced by their value)"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -702,7 +726,9 @@ irc_config_server_new_option (struct t_config_file *config_file, option_name, "integer", N_("delay (in seconds) after command was executed (example: give some " "time for authentication)"), - NULL, 0, 3600, value, NULL, NULL, + NULL, 0, 3600, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -712,7 +738,9 @@ irc_config_server_new_option (struct t_config_file *config_file, option_name, "string", N_("comma separated list of channels to join when connected to server " "(example: \"#chan1,#chan2,#chan3 key1,key2\")"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -721,7 +749,9 @@ irc_config_server_new_option (struct t_config_file *config_file, config_file, section, option_name, "boolean", N_("automatically rejoin channels when kicked"), - NULL, 0, 0, value, NULL, NULL, + NULL, 0, 0, + irc_config_server_option_default[index_option], value, + NULL, NULL, callback_change, callback_change_data, callback_delete, callback_delete_data); break; @@ -938,49 +968,49 @@ irc_config_init () irc_config_file, ptr_section, "one_server_buffer", "boolean", N_("use same buffer for all servers"), - NULL, 0, 0, "off", NULL, NULL, &irc_config_change_one_server_buffer, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, &irc_config_change_one_server_buffer, NULL, NULL, NULL); irc_config_look_open_near_server = weechat_config_new_option ( irc_config_file, ptr_section, "open_near_server", "boolean", N_("open new channels/privates near server"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_nick_prefix = weechat_config_new_option ( irc_config_file, ptr_section, "nick_prefix", "string", N_("text to display before nick in chat window"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_nick_suffix = weechat_config_new_option ( irc_config_file, ptr_section, "nick_suffix", "string", N_("text to display after nick in chat window"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_nick_completion_smart = weechat_config_new_option ( irc_config_file, ptr_section, "nick_completion_smart", "boolean", N_("smart completion for nicks (completes with last speakers first)"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_display_away = weechat_config_new_option ( irc_config_file, ptr_section, "display_away", "integer", N_("display message when (un)marking as away"), - "off|local|channel", 0, 0, "local", NULL, NULL, NULL, NULL, NULL, NULL); + "off|local|channel", 0, 0, "local", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_highlight_tags = weechat_config_new_option ( irc_config_file, ptr_section, "highlight_tags", "string", N_("comma separated list of tags for messages that may produce " "highlight (usually any message from another user, not server " "messages,..)"), - NULL, 0, 0, "irc_privmsg,irc_notice", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "irc_privmsg,irc_notice", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_show_away_once = weechat_config_new_option ( irc_config_file, ptr_section, "show_away_once", "boolean", N_("show remote away message only once in private"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_look_notice_as_pv = weechat_config_new_option ( irc_config_file, ptr_section, "notice_as_pv", "boolean", N_("display notices as private messages"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* network */ ptr_section = weechat_config_new_section (irc_config_file, "network", @@ -998,65 +1028,65 @@ irc_config_init () "default_msg_part", "string", N_("default part message (leaving channel) ('%v' will be replaced by " "WeeChat version in string)"), - NULL, 0, 0, "WeeChat %v", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "WeeChat %v", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_default_msg_quit = weechat_config_new_option ( irc_config_file, ptr_section, "default_msg_quit", "string", N_("default quit message (disconnecting from server) ('%v' will be " "replaced by WeeChat version in string)"), - NULL, 0, 0, "WeeChat %v", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "WeeChat %v", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_away_check = weechat_config_new_option ( irc_config_file, ptr_section, "away_check", "integer", N_("interval between two checks for away (in minutes, 0 = never " "check)"), - NULL, 0, INT_MAX, "0", NULL, NULL, &irc_config_change_away_check, NULL, NULL, NULL); + NULL, 0, INT_MAX, "0", NULL, NULL, NULL, &irc_config_change_away_check, NULL, NULL, NULL); irc_config_network_away_check_max_nicks = weechat_config_new_option ( irc_config_file, ptr_section, "away_check_max_nicks", "integer", N_("do not check away nicks on channels with high number of nicks " "(0 = unlimited)"), - NULL, 0, INT_MAX, "0", NULL, NULL, &irc_config_change_away_check, NULL, NULL, NULL); + NULL, 0, INT_MAX, "0", NULL, NULL, NULL, &irc_config_change_away_check, NULL, NULL, NULL); irc_config_network_lag_check = weechat_config_new_option ( irc_config_file, ptr_section, "lag_check", "integer", N_("interval between two checks for lag (in seconds, 0 = never " "check)"), - NULL, 0, INT_MAX, "60", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "60", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_lag_min_show = weechat_config_new_option ( irc_config_file, ptr_section, "lag_min_show", "integer", N_("minimum lag to show (in seconds)"), - NULL, 0, INT_MAX, "1", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "1", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_lag_disconnect = weechat_config_new_option ( irc_config_file, ptr_section, "lag_disconnect", "integer", N_("disconnect after important lag (in minutes, 0 = never " "disconnect)"), - NULL, 0, INT_MAX, "5", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "5", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_anti_flood = weechat_config_new_option ( irc_config_file, ptr_section, "anti_flood", "integer", N_("anti-flood: # seconds between two user messages (0 = no " "anti-flood)"), - NULL, 0, 5, "2", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 5, "2", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_colors_receive = weechat_config_new_option ( irc_config_file, ptr_section, "colors_receive", "boolean", N_("when off, colors codes are ignored in incoming messages"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_colors_send = weechat_config_new_option ( irc_config_file, ptr_section, "colors_send", "boolean", N_("allow user to send colors with special codes (^Cb=bold, " "^Ccxx=color, ^Ccxx,yy=color+background, ^Cu=underline, " "^Cr=reverse)"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); irc_config_network_send_unknown_commands = weechat_config_new_option ( irc_config_file, ptr_section, "send_unknown_commands", "boolean", N_("send unknown commands to IRC server"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* log */ ptr_section = weechat_config_new_section (irc_config_file, "log", @@ -1073,22 +1103,22 @@ irc_config_init () irc_config_file, ptr_section, "auto_log_server", "boolean", N_("automatically log server messages"), - NULL, 0, 0, "off", NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); irc_config_log_auto_log_channel = weechat_config_new_option ( irc_config_file, ptr_section, "auto_log_channel", "boolean", N_("automatically log channel chats"), - NULL, 0, 0, "off", NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); irc_config_log_auto_log_private = weechat_config_new_option ( irc_config_file, ptr_section, "auto_log_private", "boolean", N_("automatically log private chats"), - NULL, 0, 0, "off", NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); irc_config_log_hide_nickserv_pwd = weechat_config_new_option ( irc_config_file, ptr_section, "hide_nickserv_pwd", "boolean", N_("hide password displayed by nickserv"), - NULL, 0, 0, "on", NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, &irc_config_change_log, NULL, NULL, NULL); /* filters */ ptr_section = weechat_config_new_section (irc_config_file, "ignore", diff --git a/src/plugins/logger/logger-config.c b/src/plugins/logger/logger-config.c index 507a8a1e7..3569337c4 100644 --- a/src/plugins/logger/logger-config.c +++ b/src/plugins/logger/logger-config.c @@ -73,7 +73,7 @@ logger_config_init () "backlog", "integer", N_("maximum number of lines to display from log file when creating " "new buffer (0 = no backlog)"), - NULL, 0, INT_MAX, "20", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "20", NULL, NULL, NULL, NULL, NULL, NULL, NULL); /* file */ ptr_section = weechat_config_new_section (logger_config_file, "file", @@ -91,30 +91,30 @@ logger_config_init () "auto_log", "boolean", N_("automatically save content of buffers to files (unless a buffer " "disables log)"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); logger_config_file_name_lower_case = weechat_config_new_option ( logger_config_file, ptr_section, "name_lower_case", "boolean", N_("use only lower case for log filenames"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); logger_config_file_path = weechat_config_new_option ( logger_config_file, ptr_section, "path", "string", N_("path for WeeChat log files ('%h' will be replaced by WeeChat " "home, ~/.weechat by default)"), - NULL, 0, 0, "%h/logs/", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%h/logs/", NULL, NULL, NULL, NULL, NULL, NULL, NULL); logger_config_file_info_lines = weechat_config_new_option ( logger_config_file, ptr_section, "info_lines", "boolean", N_("write information line in log file when log starts or ends for a " "buffer"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); logger_config_file_time_format = weechat_config_new_option ( logger_config_file, ptr_section, "time_format", "string", N_("timestamp used in log files (see man strftime for date/time " "specifiers)"), - NULL, 0, 0, "%Y-%m-%d %H:%M:%S", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%Y-%m-%d %H:%M:%S", NULL, NULL, NULL, NULL, NULL, NULL, NULL); return 1; } diff --git a/src/plugins/notify/notify.c b/src/plugins/notify/notify.c index 9c4ed29e4..9c79d07d9 100644 --- a/src/plugins/notify/notify.c +++ b/src/plugins/notify/notify.c @@ -291,7 +291,7 @@ notify_config_create_option (void *data, struct t_config_file *config_file, config_file, section, option_name, "integer", NULL, "none|highlight|message|all", - 0, 0, value, NULL, NULL, NULL, NULL, NULL, NULL); + 0, 0, "", value, NULL, NULL, NULL, NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } diff --git a/src/plugins/plugin-config.c b/src/plugins/plugin-config.c index 064593ad0..57eb8b999 100644 --- a/src/plugins/plugin-config.c +++ b/src/plugins/plugin-config.c @@ -96,7 +96,7 @@ plugin_config_set_internal (const char *option, const char *value) ptr_option = config_file_new_option ( plugin_config_file, plugin_config_section_var, option, "string", NULL, - NULL, 0, 0, value, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", value, NULL, NULL, NULL, NULL, NULL, NULL); rc = (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; } @@ -164,7 +164,7 @@ plugin_config_create_option (void *data, struct t_config_file *config_file, ptr_option = config_file_new_option ( config_file, section, option_name, "string", NULL, - NULL, 0, 0, value, NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", value, NULL, NULL, NULL, NULL, NULL, NULL); return (ptr_option) ? WEECHAT_CONFIG_OPTION_SET_OK_SAME_VALUE : WEECHAT_CONFIG_OPTION_SET_ERROR; diff --git a/src/plugins/scripts/lua/weechat-lua-api.c b/src/plugins/scripts/lua/weechat-lua-api.c index 342ca5e57..a126669f8 100644 --- a/src/plugins/scripts/lua/weechat-lua-api.c +++ b/src/plugins/scripts/lua/weechat-lua-api.c @@ -1369,7 +1369,7 @@ static int weechat_lua_api_config_new_option (lua_State *L) { const char *config_file, *section, *name, *type, *description; - const char *string_values, *default_value; + const char *string_values, *default_value, *value; const char *function_check_value, *function_change, *function_delete; char *result; int n, min, max; @@ -1392,27 +1392,29 @@ weechat_lua_api_config_new_option (lua_State *L) min = 0; max = 0; default_value = NULL; + value = NULL; function_check_value = NULL; function_change = NULL; function_delete = NULL; n = lua_gettop (lua_current_interpreter); - if (n < 12) + if (n < 13) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_option"); LUA_RETURN_EMPTY; } - config_file = lua_tostring (lua_current_interpreter, -12); - section = lua_tostring (lua_current_interpreter, -11); - name = lua_tostring (lua_current_interpreter, -10); - type = lua_tostring (lua_current_interpreter, -9); - description = lua_tostring (lua_current_interpreter, -8); - string_values = lua_tostring (lua_current_interpreter, -7); - min = lua_tonumber (lua_current_interpreter, -6); - max = lua_tonumber (lua_current_interpreter, -5); - default_value = lua_tostring (lua_current_interpreter, -4); + config_file = lua_tostring (lua_current_interpreter, -13); + section = lua_tostring (lua_current_interpreter, -12); + name = lua_tostring (lua_current_interpreter, -11); + type = lua_tostring (lua_current_interpreter, -10); + description = lua_tostring (lua_current_interpreter, -9); + string_values = lua_tostring (lua_current_interpreter, -8); + min = lua_tonumber (lua_current_interpreter, -7); + max = lua_tonumber (lua_current_interpreter, -6); + default_value = lua_tostring (lua_current_interpreter, -5); + value = lua_tostring (lua_current_interpreter, -4); function_check_value = lua_tostring (lua_current_interpreter, -3); function_change = lua_tostring (lua_current_interpreter, -2); function_delete = lua_tostring (lua_current_interpreter, -1); @@ -1428,6 +1430,7 @@ weechat_lua_api_config_new_option (lua_State *L) min, max, default_value, + value, &weechat_lua_api_config_option_check_value_cb, function_check_value, &weechat_lua_api_config_option_change_cb, diff --git a/src/plugins/scripts/perl/weechat-perl-api.c b/src/plugins/scripts/perl/weechat-perl-api.c index 25ffd7dac..f9ac735f9 100644 --- a/src/plugins/scripts/perl/weechat-perl-api.c +++ b/src/plugins/scripts/perl/weechat-perl-api.c @@ -1163,7 +1163,7 @@ weechat_perl_api_config_option_delete_cb (void *data, static XS (XS_weechat_api_config_new_option) { char *result, *config_file, *section, *name, *type; - char *description, *string_values, *default_value; + char *description, *string_values, *default_value, *value; char *function_check_value, *function_change, *function_delete; dXSARGS; @@ -1176,7 +1176,7 @@ static XS (XS_weechat_api_config_new_option) PERL_RETURN_EMPTY; } - if (items < 12) + if (items < 13) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_option"); PERL_RETURN_EMPTY; @@ -1189,8 +1189,9 @@ static XS (XS_weechat_api_config_new_option) description = SvPV (ST (4), PL_na); string_values = SvPV (ST (5), PL_na); default_value = SvPV (ST (8), PL_na); - function_check_value = SvPV (ST (9), PL_na); - function_change = SvPV (ST (10), PL_na); + value = SvPV (ST (9), PL_na); + function_check_value = SvPV (ST (10), PL_na); + function_change = SvPV (ST (11), PL_na); function_delete = SvPV (ST (12), PL_na); result = script_ptr2str (script_api_config_new_option (weechat_perl_plugin, perl_current_script, @@ -1203,6 +1204,7 @@ static XS (XS_weechat_api_config_new_option) SvIV (ST (6)), /* min */ SvIV (ST (7)), /* max */ default_value, + value, &weechat_perl_api_config_option_check_value_cb, function_check_value, &weechat_perl_api_config_option_change_cb, diff --git a/src/plugins/scripts/python/weechat-python-api.c b/src/plugins/scripts/python/weechat-python-api.c index 0311d4bf9..cc854bbf8 100644 --- a/src/plugins/scripts/python/weechat-python-api.c +++ b/src/plugins/scripts/python/weechat-python-api.c @@ -1222,7 +1222,7 @@ static PyObject * weechat_python_api_config_new_option (PyObject *self, PyObject *args) { char *config_file, *section, *name, *type, *description, *string_values; - char *default_value, *result; + char *default_value, *value, *result; char *function_check_value, *function_change, *function_delete; int min, max; PyObject *object; @@ -1243,13 +1243,14 @@ weechat_python_api_config_new_option (PyObject *self, PyObject *args) description = NULL; string_values = NULL; default_value = NULL; + value = NULL; function_check_value = NULL; function_change = NULL; function_delete = NULL; - if (!PyArg_ParseTuple (args, "ssssssiissss", &config_file, §ion, &name, + if (!PyArg_ParseTuple (args, "ssssssiisssss", &config_file, §ion, &name, &type, &description, &string_values, &min, &max, - &default_value, &function_check_value, + &default_value, &value, &function_check_value, &function_change, &function_delete)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_option"); @@ -1267,6 +1268,7 @@ weechat_python_api_config_new_option (PyObject *self, PyObject *args) min, max, default_value, + value, &weechat_python_api_config_option_check_value_cb, function_check_value, &weechat_python_api_config_option_change_cb, diff --git a/src/plugins/scripts/ruby/weechat-ruby-api.c b/src/plugins/scripts/ruby/weechat-ruby-api.c index 0518cfd67..a0068ef6a 100644 --- a/src/plugins/scripts/ruby/weechat-ruby-api.c +++ b/src/plugins/scripts/ruby/weechat-ruby-api.c @@ -1377,12 +1377,13 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file, VALUE section, VALUE name, VALUE type, VALUE description, VALUE string_values, VALUE min, VALUE max, VALUE default_value, + VALUE value, VALUE function_check_value, VALUE function_change, VALUE function_delete) { char *c_config_file, *c_section, *c_name, *c_type, *c_description; - char *c_string_values, *c_default_value, *result; + char *c_string_values, *c_default_value, *c_value, *result; char *c_function_check_value, *c_function_change, *c_function_delete; int c_min, c_max; VALUE return_value; @@ -1405,14 +1406,16 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file, c_min = 0; c_max = 0; c_default_value = NULL; + c_value = NULL; c_function_check_value = NULL; c_function_change = NULL; c_function_delete = NULL; if (NIL_P (config_file) || NIL_P (section) || NIL_P (name) || NIL_P (type) || NIL_P (description) || NIL_P (string_values) - || NIL_P (default_value) || NIL_P (function_check_value) - || NIL_P (function_change) || NIL_P (function_delete)) + || NIL_P (default_value) || NIL_P (value) + || NIL_P (function_check_value) || NIL_P (function_change) + || NIL_P (function_delete)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_option"); RUBY_RETURN_EMPTY; @@ -1427,6 +1430,7 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file, Check_Type (min, T_FIXNUM); Check_Type (max, T_FIXNUM); Check_Type (default_value, T_STRING); + Check_Type (value, T_STRING); Check_Type (function_check_value, T_STRING); Check_Type (function_change, T_STRING); Check_Type (function_delete, T_STRING); @@ -1440,6 +1444,7 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file, c_min = FIX2INT (min); c_max = FIX2INT (max); c_default_value = STR2CSTR (default_value); + c_value = STR2CSTR (value); c_function_check_value = STR2CSTR (function_check_value); c_function_change = STR2CSTR (function_change); c_function_delete = STR2CSTR (function_delete); @@ -1455,6 +1460,7 @@ weechat_ruby_api_config_new_option (VALUE class, VALUE config_file, c_min, c_max, c_default_value, + c_value, &weechat_ruby_api_config_option_check_value_cb, c_function_check_value, &weechat_ruby_api_config_option_change_cb, @@ -5354,7 +5360,7 @@ weechat_ruby_api_init (VALUE ruby_mWeechat) rb_define_module_function (ruby_mWeechat, "config_new", &weechat_ruby_api_config_new, 2); rb_define_module_function (ruby_mWeechat, "config_new_section", &weechat_ruby_api_config_new_section, 8); rb_define_module_function (ruby_mWeechat, "config_search_section", &weechat_ruby_api_config_search_section, 2); - rb_define_module_function (ruby_mWeechat, "config_new_option", &weechat_ruby_api_config_new_option, 12); + rb_define_module_function (ruby_mWeechat, "config_new_option", &weechat_ruby_api_config_new_option, 13); rb_define_module_function (ruby_mWeechat, "config_search_option", &weechat_ruby_api_config_search_option, 3); rb_define_module_function (ruby_mWeechat, "config_string_to_boolean", &weechat_ruby_api_config_string_to_boolean, 1); rb_define_module_function (ruby_mWeechat, "config_option_reset", &weechat_ruby_api_config_option_reset, 2); diff --git a/src/plugins/scripts/script-api.c b/src/plugins/scripts/script-api.c index e2b4c604c..6e2df96f6 100644 --- a/src/plugins/scripts/script-api.c +++ b/src/plugins/scripts/script-api.c @@ -290,7 +290,9 @@ script_api_config_new_option (struct t_weechat_plugin *weechat_plugin, struct t_config_section *section, const char *name, const char *type, const char *description, const char *string_values, - int min, int max, const char *default_value, + int min, int max, + const char *default_value, + const char *value, void (*callback_check_value)(void *data, struct t_config_option *option, const char *value), @@ -359,7 +361,7 @@ script_api_config_new_option (struct t_weechat_plugin *weechat_plugin, new_option = weechat_config_new_option (config_file, section, name, type, description, string_values, min, - max, default_value, + max, default_value, value, callback1, new_script_callback1, callback2, new_script_callback2, callback3, new_script_callback3); diff --git a/src/plugins/scripts/script-api.h b/src/plugins/scripts/script-api.h index 17a4717a9..392d6c7c9 100644 --- a/src/plugins/scripts/script-api.h +++ b/src/plugins/scripts/script-api.h @@ -60,7 +60,9 @@ extern struct t_config_option *script_api_config_new_option (struct t_weechat_pl const char *type, const char *description, const char *string_values, - int min, int max, const char *default_value, + int min, int max, + const char *default_value, + const char *value, void (*callback_check_value)(void *data, struct t_config_option *option, const char *value), diff --git a/src/plugins/scripts/tcl/weechat-tcl-api.c b/src/plugins/scripts/tcl/weechat-tcl-api.c index dd391bd70..8e11e3b84 100644 --- a/src/plugins/scripts/tcl/weechat-tcl-api.c +++ b/src/plugins/scripts/tcl/weechat-tcl-api.c @@ -1375,7 +1375,8 @@ weechat_tcl_api_config_new_option (ClientData clientData, Tcl_Interp *interp, { Tcl_Obj* objp; char *result, *config_file, *section, *name, *type; - char *description, *string_values, *default_value, *function_check_value, *function_change, *function_delete; + char *description, *string_values, *default_value, *value; + char *function_check_value, *function_change, *function_delete; int i,min,max; /* make C compiler happy */ @@ -1387,19 +1388,19 @@ weechat_tcl_api_config_new_option (ClientData clientData, Tcl_Interp *interp, TCL_RETURN_EMPTY; } - if (objc < 13) + if (objc < 14) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_option"); TCL_RETURN_EMPTY; } - + if ((Tcl_GetIntFromObj (interp, objv[7], &min) != TCL_OK) || (Tcl_GetIntFromObj (interp, objv[8], &max) != TCL_OK)) { WEECHAT_SCRIPT_MSG_WRONG_ARGUMENTS("config_new_option"); TCL_RETURN_EMPTY; } - + config_file = Tcl_GetStringFromObj (objv[1], &i); section = Tcl_GetStringFromObj (objv[2], &i); name = Tcl_GetStringFromObj (objv[3], &i); @@ -1407,9 +1408,10 @@ weechat_tcl_api_config_new_option (ClientData clientData, Tcl_Interp *interp, description = Tcl_GetStringFromObj (objv[5], &i); string_values = Tcl_GetStringFromObj (objv[6], &i); default_value = Tcl_GetStringFromObj (objv[9], &i); - function_check_value = Tcl_GetStringFromObj (objv[10], &i); - function_change = Tcl_GetStringFromObj (objv[11], &i); - function_delete = Tcl_GetStringFromObj (objv[12], &i); + value = Tcl_GetStringFromObj (objv[10], &i); + function_check_value = Tcl_GetStringFromObj (objv[11], &i); + function_change = Tcl_GetStringFromObj (objv[12], &i); + function_delete = Tcl_GetStringFromObj (objv[13], &i); result = script_ptr2str (script_api_config_new_option (weechat_tcl_plugin, tcl_current_script, @@ -1419,9 +1421,10 @@ weechat_tcl_api_config_new_option (ClientData clientData, Tcl_Interp *interp, type, description, string_values, - min, /* min */ - max, /* max */ + min, + max, default_value, + value, &weechat_tcl_api_config_option_check_value_cb, function_check_value, &weechat_tcl_api_config_option_change_cb, diff --git a/src/plugins/weechat-plugin.h b/src/plugins/weechat-plugin.h index 9b1242b80..7c1a0efef 100644 --- a/src/plugins/weechat-plugin.h +++ b/src/plugins/weechat-plugin.h @@ -240,6 +240,7 @@ struct t_weechat_plugin const char *string_values, int min, int max, const char *default_value, + const char *value, int (*callback_check_value)(void *data, struct t_config_option *option, const char *value), @@ -721,7 +722,8 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); weechat_plugin->config_search_section(__config, __name) #define weechat_config_new_option(__config, __section, __name, __type, \ __desc, __string_values, __min, \ - __max, __default, __callback_check, \ + __max, __default, __value, \ + __callback_check, \ __callback_check_data, \ __callback_change, \ __callback_change_data, \ @@ -729,7 +731,7 @@ extern int weechat_plugin_end (struct t_weechat_plugin *plugin); __callback_delete_data) \ weechat_plugin->config_new_option(__config, __section, __name, \ __type, __desc, __string_values, \ - __min, __max, __default, \ + __min, __max, __default, __value, \ __callback_check, \ __callback_check_data, \ __callback_change, \ diff --git a/src/plugins/xfer/xfer-config.c b/src/plugins/xfer/xfer-config.c index 3d0f3a7ec..e36a3cc56 100644 --- a/src/plugins/xfer/xfer-config.c +++ b/src/plugins/xfer/xfer-config.c @@ -123,12 +123,12 @@ xfer_config_init () "auto_open_buffer", "boolean", N_("auto open xfer buffer when a new xfer is added " "to list"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_look_progress_bar_size = weechat_config_new_option ( xfer_config_file, ptr_section, "progress_bar_size", "integer", N_("size of progress bar, in chars (if 0, progress bar is disabled)"), - NULL, 0, XFER_CONFIG_PROGRESS_BAR_MAX_SIZE, "20", + NULL, 0, XFER_CONFIG_PROGRESS_BAR_MAX_SIZE, "20", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); ptr_section = weechat_config_new_section (xfer_config_file, "color", @@ -145,55 +145,55 @@ xfer_config_init () xfer_config_file, ptr_section, "text", "color", N_("text color"), - NULL, 0, 0, "default", + NULL, 0, 0, "default", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); xfer_config_color_text_bg = weechat_config_new_option ( xfer_config_file, ptr_section, "text_bg", "color", N_("background color"), - NULL, 0, 0, "default", + NULL, 0, 0, "default", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); xfer_config_color_text_selected = weechat_config_new_option ( xfer_config_file, ptr_section, "text_selected", "color", N_("text color of selected xfer line"), - NULL, 0, 0, "white", + NULL, 0, 0, "white", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); xfer_config_color_status[XFER_STATUS_WAITING] = weechat_config_new_option ( xfer_config_file, ptr_section, "status_waiting", "color", N_("text color for \"waiting\" status"), - NULL, 0, 0, "lightcyan", + NULL, 0, 0, "lightcyan", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); xfer_config_color_status[XFER_STATUS_CONNECTING] = weechat_config_new_option ( xfer_config_file, ptr_section, "status_connecting", "color", N_("text color for \"connecting\" status"), - NULL, 0, 0, "yellow", + NULL, 0, 0, "yellow", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); xfer_config_color_status[XFER_STATUS_ACTIVE] = weechat_config_new_option ( xfer_config_file, ptr_section, "status_active", "color", N_("text color for \"active\" status"), - NULL, 0, 0, "lightblue", + NULL, 0, 0, "lightblue", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); xfer_config_color_status[XFER_STATUS_DONE] = weechat_config_new_option ( xfer_config_file, ptr_section, "status_done", "color", N_("text color for \"done\" status"), - NULL, 0, 0, "lightgreen", + NULL, 0, 0, "lightgreen", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); xfer_config_color_status[XFER_STATUS_FAILED] = weechat_config_new_option ( xfer_config_file, ptr_section, "status_failed", "color", N_("text color for \"failed\" status"), - NULL, 0, 0, "lightred", + NULL, 0, 0, "lightred", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); xfer_config_color_status[XFER_STATUS_ABORTED] = weechat_config_new_option ( xfer_config_file, ptr_section, "status_aborted", "color", N_("text color for \"aborted\" status"), - NULL, 0, 0, "lightred", + NULL, 0, 0, "lightred", NULL, NULL, NULL, &xfer_config_refresh_cb, NULL, NULL, NULL); ptr_section = weechat_config_new_section (xfer_config_file, "network", @@ -210,37 +210,37 @@ xfer_config_init () xfer_config_file, ptr_section, "timeout", "integer", N_("timeout for xfer request (in seconds)"), - NULL, 5, INT_MAX, "300", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 5, INT_MAX, "300", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_network_blocksize = weechat_config_new_option ( xfer_config_file, ptr_section, "blocksize", "integer", N_("block size for sending packets, in bytes"), - NULL, XFER_BLOCKSIZE_MIN, XFER_BLOCKSIZE_MAX, "65536", + NULL, XFER_BLOCKSIZE_MIN, XFER_BLOCKSIZE_MAX, "65536", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_network_fast_send = weechat_config_new_option ( xfer_config_file, ptr_section, "fast_send", "boolean", N_("does not wait for ACK when sending file"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_network_port_range = weechat_config_new_option ( xfer_config_file, ptr_section, "port_range", "string", N_("restricts outgoing files/chats to use only ports in the given " "range (useful for NAT) (syntax: a single port, ie. 5000 or a port " "range, ie. 5000-5015, empty value means any port)"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_network_own_ip = weechat_config_new_option ( xfer_config_file, ptr_section, "own_ip", "string", N_("IP or DNS address used for sending files/chats " "(if empty, local interface IP is used)"), - NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_network_speed_limit = weechat_config_new_option ( xfer_config_file, ptr_section, "speed_limit", "integer", N_("speed limit for sending files, in kilo-bytes by second (0 means " "no limit)"), - NULL, 0, INT_MAX, "0", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, INT_MAX, "0", NULL, NULL, NULL, NULL, NULL, NULL, NULL); ptr_section = weechat_config_new_section (xfer_config_file, "file", 0, 0, @@ -256,44 +256,44 @@ xfer_config_init () xfer_config_file, ptr_section, "download_path", "string", N_("path for writing incoming files"), - NULL, 0, 0, "%h/xfer", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "%h/xfer", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_file_upload_path = weechat_config_new_option ( xfer_config_file, ptr_section, "upload_path", "string", N_("path for reading files when sending (when no path is " "specified by user)"), - NULL, 0, 0, "~", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "~", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_file_use_nick_in_filename = weechat_config_new_option ( xfer_config_file, ptr_section, "use_nick_in_filename", "boolean", N_("use remote nick as prefix in local filename when receiving a file"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_file_convert_spaces = weechat_config_new_option ( xfer_config_file, ptr_section, "convert_spaces", "boolean", N_("convert spaces to underscores when sending files"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_file_auto_rename = weechat_config_new_option ( xfer_config_file, ptr_section, "auto_rename", "boolean", N_("rename incoming files if already exists (add '.1', '.2', ...)"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_file_auto_resume = weechat_config_new_option ( xfer_config_file, ptr_section, "auto_resume", "boolean", N_("automatically resume file transfer if connection with remote host " "is lost"), - NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "on", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_file_auto_accept_files = weechat_config_new_option ( xfer_config_file, ptr_section, "auto_accept_files", "boolean", N_("automatically accept incoming files (use carefully!)"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); xfer_config_file_auto_accept_chats = weechat_config_new_option ( xfer_config_file, ptr_section, "auto_accept_chats", "boolean", N_("automatically accept chat requests (use carefully!)"), - NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL); + NULL, 0, 0, "off", NULL, NULL, NULL, NULL, NULL, NULL, NULL); return 1; } |