diff options
author | Sebastien Helleu <flashcode@flashtux.org> | 2008-01-27 10:48:29 +0100 |
---|---|---|
committer | Sebastien Helleu <flashcode@flashtux.org> | 2008-01-27 10:48:29 +0100 |
commit | ad414865430d2d073689f849283a10b06711f1b8 (patch) | |
tree | 46c12eff476081782dc6322068bc7630ba4e94a9 /src/core | |
parent | ed26a0389c06250f02329fa477d2cffe7df59b5e (diff) | |
download | weechat-ad414865430d2d073689f849283a10b06711f1b8.zip |
Added config file functions in plugins API, improved /reload and /save commands (now possible to reload/save some files only), fixed completion bug
Diffstat (limited to 'src/core')
-rw-r--r-- | src/core/wee-command.c | 139 | ||||
-rw-r--r-- | src/core/wee-config-file.c | 121 | ||||
-rw-r--r-- | src/core/wee-config-file.h | 46 | ||||
-rw-r--r-- | src/core/wee-config.c | 693 | ||||
-rw-r--r-- | src/core/wee-config.h | 1 |
5 files changed, 657 insertions, 343 deletions
diff --git a/src/core/wee-command.c b/src/core/wee-command.c index 98bf6697f..1f8bbe1a1 100644 --- a/src/core/wee-command.c +++ b/src/core/wee-command.c @@ -1153,6 +1153,30 @@ command_quit (void *data, struct t_gui_buffer *buffer, } /* + * command_reload_file: reload a configuration file + */ + +void +command_reload_file (struct t_config_file *config_file) +{ + if ((int) (config_file->callback_reload) (config_file->callback_reload_data, + config_file) == 0) + { + gui_chat_printf (NULL, + _("%sOptions reloaded from %s"), + gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + config_file->filename); + } + else + { + gui_chat_printf (NULL, + _("%sError: failed to reload options from %s"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + config_file->filename); + } +} + +/* * command_reload: reload WeeChat and plugins options from disk */ @@ -1161,31 +1185,39 @@ command_reload (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { struct t_config_file *ptr_config_file; + int i; /* make C compiler happy */ (void) data; (void) buffer; - (void) argc; - (void) argv; (void) argv_eol; - for (ptr_config_file = config_files; ptr_config_file; - ptr_config_file = ptr_config_file->next_config) + if (argc > 1) { - if (ptr_config_file->callback_reload) + for (i = 1; i < argc; i++) { - if ((int) (ptr_config_file->callback_reload) (ptr_config_file) == 0) + ptr_config_file = config_file_search (argv[i]); + if (ptr_config_file) { - gui_chat_printf (NULL, _("%sOptions reloaded from %s"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], - ptr_config_file->filename); + command_reload_file (ptr_config_file); } else { gui_chat_printf (NULL, - _("%sError: failed to reload options from %s"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - ptr_config_file->filename); + _("%sUnknown configuration file \"%s\""), + gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + argv[i]); + } + } + } + else + { + for (ptr_config_file = config_files; ptr_config_file; + ptr_config_file = ptr_config_file->next_config) + { + if (ptr_config_file->callback_reload) + { + command_reload_file (ptr_config_file); } } } @@ -1194,6 +1226,29 @@ command_reload (void *data, struct t_gui_buffer *buffer, } /* + * command_save_file: save a configuration file + */ + +void +command_save_file (struct t_config_file *config_file) +{ + if (config_file_write (config_file) == 0) + { + gui_chat_printf (NULL, + _("%sOptions saved to %s"), + gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + config_file->filename); + } + else + { + gui_chat_printf (NULL, + _("%sError: failed to save options to %s"), + gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], + config_file->filename); + } +} + +/* * command_save: save WeeChat and plugins options to disk */ @@ -1202,29 +1257,37 @@ command_save (void *data, struct t_gui_buffer *buffer, int argc, char **argv, char **argv_eol) { struct t_config_file *ptr_config_file; + int i; /* make C compiler happy */ (void) data; (void) buffer; - (void) argc; - (void) argv; (void) argv_eol; - - for (ptr_config_file = config_files; ptr_config_file; - ptr_config_file = ptr_config_file->next_config) + + if (argc > 1) { - if (config_file_write (ptr_config_file) == 0) + for (i = 1; i < argc; i++) { - gui_chat_printf (NULL, _("%sOptions saved to %s"), - gui_chat_prefix[GUI_CHAT_PREFIX_INFO], - ptr_config_file->filename); + ptr_config_file = config_file_search (argv[i]); + if (ptr_config_file) + { + command_save_file (ptr_config_file); + } + else + { + gui_chat_printf (NULL, + _("%sUnknown configuration file \"%s\""), + gui_chat_prefix[GUI_CHAT_PREFIX_INFO], + argv[i]); + } } - else + } + else + { + for (ptr_config_file = config_files; ptr_config_file; + ptr_config_file = ptr_config_file->next_config) { - gui_chat_printf (NULL, - _("%sError: failed to save options to %s"), - gui_chat_prefix[GUI_CHAT_PREFIX_ERROR], - ptr_config_file->filename); + command_save_file (ptr_config_file); } } @@ -1433,7 +1496,10 @@ command_set (void *data, struct t_gui_buffer *buffer, gui_chat_prefix[GUI_CHAT_PREFIX_INFO], _("Option changed: ")); if ((rc == 2) && (ptr_option->callback_change)) - (void) (ptr_option->callback_change) (); + { + (void) (ptr_option->callback_change) + (ptr_option->callback_change_data); + } } else { @@ -1998,15 +2064,20 @@ command_init () "%q", command_quit, NULL); hook_command (NULL, "reload", - N_("reload WeeChat and plugins configuration files from " - "disk"), - "", "", - NULL, + N_("reload configuration files from disk"), + N_("[file [file...]]"), + N_("file: configuration file to reload\n\n" + "Without argument, all files (WeeChat and plugins) are " + "reloaded."), + "%C|%*", command_reload, NULL); hook_command (NULL, "save", - N_("save WeeChat and plugins configuration files to disk"), - "", "", - NULL, + N_("save configuration files to disk"), + N_("[file [file...]]"), + N_("file: configuration file to save\n\n" + "Without argument, all files (WeeChat and plugins) are " + "saved."), + "%C|%*", command_save, NULL); hook_command (NULL, "set", N_("set config options"), diff --git a/src/core/wee-config-file.c b/src/core/wee-config-file.c index 7cc16fe4b..82f94c04c 100644 --- a/src/core/wee-config-file.c +++ b/src/core/wee-config-file.c @@ -52,7 +52,10 @@ struct t_config_file * config_file_search (char *filename) { struct t_config_file *ptr_config; - + + if (!filename) + return NULL; + for (ptr_config = config_files; ptr_config; ptr_config = ptr_config->next_config) { @@ -70,7 +73,9 @@ config_file_search (char *filename) struct t_config_file * config_file_new (struct t_weechat_plugin *plugin, char *filename, - int (*callback_reload)(struct t_config_file *config_file)) + int (*callback_reload)(void *data, + struct t_config_file *config_file), + void *callback_reload_data) { struct t_config_file *new_config_file; @@ -88,6 +93,7 @@ config_file_new (struct t_weechat_plugin *plugin, char *filename, new_config_file->filename = strdup (filename); new_config_file->file = NULL; new_config_file->callback_reload = callback_reload; + new_config_file->callback_reload_data = callback_reload_data; new_config_file->sections = NULL; new_config_file->last_section = NULL; @@ -133,12 +139,18 @@ config_file_valid_for_plugin (struct t_weechat_plugin *plugin, struct t_config_section * config_file_new_section (struct t_config_file *config_file, char *name, - void (*callback_read)(struct t_config_file *config_file, + void (*callback_read)(void *data, + struct t_config_file *config_file, char *option_name, char *value), - void (*callback_write)(struct t_config_file *config_file, + void *callback_read_data, + void (*callback_write)(void *data, + struct t_config_file *config_file, char *section_name), - void (*callback_write_default)(struct t_config_file *, - char *section_name)) + void *callback_write_data, + void (*callback_write_default)(void *data, + struct t_config_file *config_file, + char *section_name), + void *callback_write_default_data) { struct t_config_section *new_section; @@ -150,8 +162,11 @@ config_file_new_section (struct t_config_file *config_file, char *name, { new_section->name = strdup (name); new_section->callback_read = callback_read; + new_section->callback_read_data = callback_read_data; new_section->callback_write = callback_write; + new_section->callback_write_data = callback_write_data; new_section->callback_write_default = callback_write_default; + new_section->callback_write_default_data = callback_write_default_data; new_section->options = NULL; new_section->last_option = NULL; @@ -177,6 +192,9 @@ config_file_search_section (struct t_config_file *config_file, { struct t_config_section *ptr_section; + if (!config_file || !section_name) + return NULL; + for (ptr_section = config_file->sections; ptr_section; ptr_section = ptr_section->next_section) { @@ -224,17 +242,19 @@ config_file_section_valid_for_plugin (struct t_weechat_plugin *plugin, */ struct t_config_option * -config_file_new_option (struct t_config_section *section, char *name, +config_file_new_option (struct t_config_file *config_file, + struct t_config_section *section, char *name, char *type, char *description, char *string_values, int min, int max, char *default_value, - void (*callback_change)()) + void (*callback_change)(), + void *callback_change_data) { struct t_config_option *new_option; int var_type, int_value, argc, i, index_value; long number; char *error; - if (!section || !name) + if (!config_file || !section || !name) return NULL; var_type = -1; @@ -332,6 +352,7 @@ config_file_new_option (struct t_config_section *section, char *name, break; } new_option->callback_change = callback_change; + new_option->callback_change_data = callback_change_data; new_option->loaded = 0; new_option->prev_option = section->last_option; @@ -430,6 +451,9 @@ config_file_string_boolean_is_valid (char *text) { int i; + if (!text) + return 0; + for (i = 0; config_boolean_true[i]; i++) { if (string_strcasecmp (text, config_boolean_true[i]) == 0) @@ -456,6 +480,9 @@ config_file_string_to_boolean (char *text) { int i; + if (!text) + return CONFIG_BOOLEAN_FALSE; + for (i = 0; config_boolean_true[i]; i++) { if (string_strcasecmp (text, config_boolean_true[i]) == 0) @@ -495,7 +522,10 @@ config_file_option_set (struct t_config_option *option, char *new_value, return 1; *((int *)option->value) = new_value_int; if (run_callback && option->callback_change) - (void) (option->callback_change) (); + { + (void) (option->callback_change) + (option->callback_change_data); + } return 2; case CONFIG_OPTION_INTEGER: if (!new_value) @@ -518,7 +548,10 @@ config_file_option_set (struct t_config_option *option, char *new_value, return 1; *((int *)option->value) = new_value_int; if (run_callback && option->callback_change) - (void) (option->callback_change) (); + { + (void) (option->callback_change) + (option->callback_change_data); + } return 2; } else @@ -531,7 +564,10 @@ config_file_option_set (struct t_config_option *option, char *new_value, return 1; *((int *)option->value) = number; if (run_callback && option->callback_change) - (void) (option->callback_change) (); + { + (void) (option->callback_change) + (option->callback_change_data); + } return 2; } } @@ -553,7 +589,10 @@ config_file_option_set (struct t_config_option *option, char *new_value, else option->value = NULL; if (run_callback && (rc == 2) && option->callback_change) - (void) (option->callback_change) (); + { + (void) (option->callback_change) + (option->callback_change_data); + } return rc; case CONFIG_OPTION_COLOR: if (!gui_color_assign (&new_value_int, new_value)) @@ -562,7 +601,10 @@ config_file_option_set (struct t_config_option *option, char *new_value, return 1; *((int *)option->value) = new_value_int; if (run_callback && option->callback_change) - (void) (option->callback_change) (); + { + (void) (option->callback_change) + (option->callback_change_data); + } return 2; } @@ -631,6 +673,9 @@ config_file_option_reset (struct t_config_option *option) int config_file_option_boolean (struct t_config_option *option) { + if (!option) + return 0; + if (option->type == CONFIG_OPTION_BOOLEAN) return CONFIG_BOOLEAN(option); else @@ -644,6 +689,9 @@ config_file_option_boolean (struct t_config_option *option) int config_file_option_integer (struct t_config_option *option) { + if (!option) + return 0; + switch (option->type) { case CONFIG_OPTION_BOOLEAN: @@ -667,6 +715,9 @@ config_file_option_integer (struct t_config_option *option) char * config_file_option_string (struct t_config_option *option) { + if (!option) + return NULL; + switch (option->type) { case CONFIG_OPTION_STRING: @@ -688,6 +739,9 @@ config_file_option_string (struct t_config_option *option) int config_file_option_color (struct t_config_option *option) { + if (!option) + return 0; + if (option->type == CONFIG_OPTION_COLOR) return CONFIG_COLOR(option); else @@ -752,7 +806,10 @@ config_file_write_line (struct t_config_file *config_file, { char buf[4096]; va_list argptr; - + + if (!config_file || !option_name) + return; + va_start (argptr, value); vsnprintf (buf, sizeof (buf) - 1, value, argptr); va_end (argptr); @@ -776,7 +833,8 @@ config_file_write_line (struct t_config_file *config_file, */ int -config_file_write_internal (struct t_config_file *config_file, int default_options) +config_file_write_internal (struct t_config_file *config_file, + int default_options) { int filename_length, rc; char *filename, *filename2; @@ -828,12 +886,14 @@ config_file_write_internal (struct t_config_file *config_file, int default_optio /* call write callback if defined for section */ if (default_options && ptr_section->callback_write_default) { - (void) (ptr_section->callback_write_default) (config_file, + (void) (ptr_section->callback_write_default) (ptr_section->callback_write_default_data, + config_file, ptr_section->name); } else if (!default_options && ptr_section->callback_write) { - (void) (ptr_section->callback_write) (config_file, + (void) (ptr_section->callback_write) (ptr_section->callback_write_data, + config_file, ptr_section->name); } else @@ -959,7 +1019,8 @@ config_file_read (struct t_config_file *config_file) { if (ptr_section->callback_read) { - (void) (ptr_section->callback_read) (config_file, + (void) (ptr_section->callback_read) (ptr_section->callback_read_data, + config_file, NULL, NULL); } } @@ -1036,7 +1097,8 @@ config_file_read (struct t_config_file *config_file) if (ptr_section && ptr_section->callback_read) { ptr_option = NULL; - (void) (ptr_section->callback_read) (config_file, + (void) (ptr_section->callback_read) (ptr_section->callback_read_data, + config_file, line, pos); rc = 1; } @@ -1109,7 +1171,10 @@ config_file_reload (struct t_config_file *config_file) struct t_config_section *ptr_section; struct t_config_option *ptr_option; int rc; - + + if (!config_file) + return -1; + /* init "loaded" flag for all options */ for (ptr_section = config_file->sections; ptr_section; ptr_section = ptr_section->next_section) @@ -1141,7 +1206,10 @@ config_file_reload (struct t_config_file *config_file) if (config_file_option_reset (ptr_option) == 2) { if (ptr_option->callback_change) - (void) (ptr_option->callback_change) (); + { + (void) (ptr_option->callback_change) + (ptr_option->callback_change_data); + } } } } @@ -1161,6 +1229,9 @@ config_file_option_free (struct t_config_section *section, { struct t_config_option *new_options; + if (!section || !option) + return; + /* remove option */ if (section->last_option == option) section->last_option = option->prev_option; @@ -1200,6 +1271,9 @@ config_file_section_free (struct t_config_file *config_file, { struct t_config_section *new_sections; + if (!config_file || !section) + return; + /* remove section */ if (config_file->last_section == section) config_file->last_section = section->prev_section; @@ -1234,6 +1308,9 @@ config_file_free (struct t_config_file *config_file) { struct t_config_file *new_config_files; + if (!config_file) + return; + /* remove config file */ if (last_config_file == config_file) last_config_file = config_file->prev_config; diff --git a/src/core/wee-config-file.h b/src/core/wee-config-file.h index 87e4743f2..df21e2909 100644 --- a/src/core/wee-config-file.h +++ b/src/core/wee-config-file.h @@ -41,7 +41,9 @@ struct t_config_file char *filename; /* config filename (without path)*/ FILE *file; /* file pointer */ int (*callback_reload) /* callback for reloading file */ - (struct t_config_file *config_file); + (void *data, + struct t_config_file *config_file); + void *callback_reload_data; /* data sent to callback */ struct t_config_section *sections; /* config sections */ struct t_config_section *last_section; /* last config section */ struct t_config_file *prev_config; /* link to previous config file */ @@ -52,14 +54,20 @@ struct t_config_section { char *name; /* section name */ void (*callback_read) /* called when unknown option */ - (struct t_config_file *config_file, /* is read from config file */ - char *option_name, char *value); + (void *data, /* is read from config file */ + struct t_config_file *config_file, + char *option_name, char *value); + void *callback_read_data; /* data sent to read callback */ void (*callback_write) /* called to write special */ - (struct t_config_file *config_file, /* options in config file */ + (void *data, /* options in config file */ + struct t_config_file *config_file, char *section_name); + void *callback_write_data; /* data sent to write callback */ void (*callback_write_default) /* called to write default */ - (struct t_config_file *config_file, /* options in config file */ + (void *data, /* options in config file */ + struct t_config_file *config_file, char *section_name); + void *callback_write_default_data; /* data sent to write def. callb.*/ struct t_config_option *options; /* options in section */ struct t_config_option *last_option; /* last option in section */ struct t_config_section *prev_section; /* link to previous section */ @@ -83,7 +91,8 @@ struct t_config_option int min, max; /* min and max for value */ void *default_value; /* default value */ void *value; /* value */ - void (*callback_change)(); /* called when value is changed */ + void (*callback_change)(void *data); /* called when value is changed */ + void *callback_change_data; /* data sent to change callback */ int loaded; /* 1 if opt was found in config */ struct t_config_option *prev_option; /* link to previous option */ struct t_config_option *next_option; /* link to next option */ @@ -92,31 +101,42 @@ struct t_config_option extern struct t_config_file *config_files; extern struct t_config_file *last_config_file; +extern struct t_config_file *config_file_search (char *filename); extern struct t_config_file *config_file_new (struct t_weechat_plugin *plugin, char *filename, - int (*callback_reload)(struct t_config_file *config_file)); + int (*callback_reload)(void *data, + struct t_config_file *config_file), + void *callback_data); extern int config_file_valid_for_plugin (struct t_weechat_plugin *plugin, struct t_config_file *config_file); extern struct t_config_section *config_file_new_section (struct t_config_file *config_file, char *name, - void (*callback_read)(struct t_config_file *config_file, + void (*callback_read)(void *data, + struct t_config_file *config_file, char *option_name, char *value), - void (*callback_write)(struct t_config_file *config_file, + void *callback_read_data, + void (*callback_write)(void *data, + struct t_config_file *config_file, char *section_name), - void (*callback_write_default)(struct t_config_file *config_file, - char *section_name)); + void *callback_write_data, + void (*callback_write_default)(void *data, + struct t_config_file *config_file, + char *section_name), + void *callback_write_default_data); extern struct t_config_section *config_file_search_section (struct t_config_file *config_file, char *section_name); extern int config_file_section_valid_for_plugin (struct t_weechat_plugin *plugin, struct t_config_section *); -extern struct t_config_option *config_file_new_option (struct t_config_section *section, +extern struct t_config_option *config_file_new_option (struct t_config_file *config_file, + struct t_config_section *section, char *name, char *type, char *description, char *string_values, int min, int max, char *default_value, - void (*callback_change)()); + void (*callback_change)(void *data), + void *callback_change_data); extern struct t_config_option *config_file_search_option (struct t_config_file *config_file, struct t_config_section *section, char *option_name); diff --git a/src/core/wee-config.c b/src/core/wee-config.c index 9058774b6..a486f9701 100644 --- a/src/core/wee-config.c +++ b/src/core/wee-config.c @@ -184,6 +184,7 @@ struct t_config_option *config_proxy_password; struct t_config_option *config_plugins_path; struct t_config_option *config_plugins_autoload; struct t_config_option *config_plugins_extension; +struct t_config_option *config_plugins_save_config_on_unload; /* hooks */ @@ -422,9 +423,10 @@ config_change_day_change () */ int -config_weechat_reload (struct t_config_file *config_file) +config_weechat_reload (void *data, struct t_config_file *config_file) { /* make C compiler happy */ + (void) data; (void) config_file; /* remove all keys */ @@ -438,10 +440,11 @@ config_weechat_reload (struct t_config_file *config_file) */ void -config_weechat_read_key (struct t_config_file *config_file, +config_weechat_read_key (void *data, struct t_config_file *config_file, char *option_name, char *value) { /* make C compiler happy */ + (void) data; (void) config_file; if (option_name) @@ -466,12 +469,15 @@ config_weechat_read_key (struct t_config_file *config_file, */ void -config_weechat_write_keys (struct t_config_file *config_file, +config_weechat_write_keys (void *data, struct t_config_file *config_file, char *section_name) { t_gui_key *ptr_key; char *expanded_name, *function_name; + /* make C compiler happy */ + (void) data; + config_file_write_line (config_file, section_name, NULL); for (ptr_key = gui_keys; ptr_key; ptr_key = ptr_key->next_key) @@ -515,13 +521,13 @@ config_weechat_init () struct t_config_section *ptr_section; weechat_config_file = config_file_new (NULL, WEECHAT_CONFIG_FILENAME, - &config_weechat_reload); + &config_weechat_reload, NULL); if (!weechat_config_file) return 0; /* look */ ptr_section = config_file_new_section (weechat_config_file, "look", - NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -529,200 +535,242 @@ config_weechat_init () } config_look_color_real_white = config_file_new_option ( - ptr_section, "look_color_real_white", "boolean", + weechat_config_file, ptr_section, + "look_color_real_white", "boolean", N_("if set, uses real white color, disabled by default " "for terms with white background (if you never use " "white background, you should turn on this option to " "see real white instead of default term foreground " "color)"), - NULL, 0, 0, "off", &config_change_color); + NULL, 0, 0, "off", &config_change_color, NULL); config_look_save_on_exit = config_file_new_option ( - ptr_section, "look_save_on_exit", "boolean", + weechat_config_file, ptr_section, + "look_save_on_exit", "boolean", N_("save configuration file on exit"), - NULL, 0, 0, "on", &config_change_save_on_exit); + NULL, 0, 0, "on", &config_change_save_on_exit, NULL); config_look_set_title = config_file_new_option ( - ptr_section, "look_set_title", "boolean", + weechat_config_file, ptr_section, + "look_set_title", "boolean", N_("set title for window (terminal for Curses GUI) with " "name and version"), - NULL, 0, 0, "on", &config_change_title); + NULL, 0, 0, "on", &config_change_title, NULL); config_look_startup_logo = config_file_new_option ( - ptr_section, "look_startup_logo", "boolean", + weechat_config_file, ptr_section, + "look_startup_logo", "boolean", N_("display WeeChat logo at startup"), - NULL, 0, 0, "on", NULL); + NULL, 0, 0, "on", NULL, NULL); config_look_startup_version = config_file_new_option ( - ptr_section, "look_startup_version", "boolean", + weechat_config_file, ptr_section, + "look_startup_version", "boolean", N_("display WeeChat version at startup"), - NULL, 0, 0, "on", NULL); + NULL, 0, 0, "on", NULL, NULL); config_look_weechat_slogan = config_file_new_option ( - ptr_section, "look_weechat_slogan", "string", + weechat_config_file, ptr_section, + "look_weechat_slogan", "string", N_("WeeChat slogan (if empty, slogan is not used)"), - NULL, 0, 0, "the geekest IRC client!", NULL); + NULL, 0, 0, "the geekest IRC client!", NULL, NULL); config_look_scroll_amount = config_file_new_option ( - ptr_section, "look_scroll_amount", "integer", + weechat_config_file, ptr_section, + "look_scroll_amount", "integer", N_("how many lines to scroll by with scroll_up and " "scroll_down"), - NULL, 1, INT_MAX, "3", &config_change_buffer_content); + NULL, 1, INT_MAX, "3", &config_change_buffer_content, NULL); config_look_buffer_time_format = config_file_new_option ( - ptr_section, "look_buffer_time_format", "string", + weechat_config_file, ptr_section, + "look_buffer_time_format", "string", N_("time format for buffers"), - NULL, 0, 0, "[%H:%M:%S]", &config_change_buffer_time_format); + NULL, 0, 0, "[%H:%M:%S]", &config_change_buffer_time_format, NULL); config_look_color_nicks_number = config_file_new_option ( - ptr_section, "look_color_nicks_number", "integer", + weechat_config_file, ptr_section, + "look_color_nicks_number", "integer", N_("number of colors to use for nicks colors"), - NULL, 1, 10, "10", &config_change_nicks_colors); + NULL, 1, 10, "10", &config_change_nicks_colors, NULL); config_look_nicklist = config_file_new_option ( - ptr_section, "look_nicklist", "boolean", + weechat_config_file, ptr_section, + "look_nicklist", "boolean", N_("display nicklist (on buffers with nicklist enabled)"), - NULL, 0, 0, "on", &config_change_buffers); + NULL, 0, 0, "on", &config_change_buffers, NULL); config_look_nicklist_position = config_file_new_option ( - ptr_section, "look_nicklist_position", "integer", + weechat_config_file, ptr_section, + "look_nicklist_position", "integer", N_("nicklist position (top, left, right (default), " "bottom)"), - "left|right|top|bottom", 0, 0, "right", &config_change_buffers); + "left|right|top|bottom", 0, 0, "right", &config_change_buffers, NULL); config_look_nicklist_min_size = config_file_new_option ( - ptr_section, "look_nicklist_min_size", "integer", + weechat_config_file, ptr_section, + "look_nicklist_min_size", "integer", N_("min size for nicklist (width or height, depending on " "look_nicklist_position (0 = no min size))"), - NULL, 0, 100, "0", &config_change_buffers); + NULL, 0, 100, "0", &config_change_buffers, NULL); config_look_nicklist_max_size = config_file_new_option ( - ptr_section, "look_nicklist_max_size", "integer", + weechat_config_file, ptr_section, + "look_nicklist_max_size", "integer", N_("max size for nicklist (width or height, depending on " "look_nicklist_position (0 = no max size; if min = max " "and > 0, then size is fixed))"), - NULL, 0, 100, "0", &config_change_buffers); + NULL, 0, 100, "0", &config_change_buffers, NULL); config_look_nicklist_separator = config_file_new_option ( - ptr_section, "look_nicklist_separator", "boolean", + weechat_config_file, ptr_section, + "look_nicklist_separator", "boolean", N_("separator between chat and nicklist"), - NULL, 0, 0, "on", &config_change_buffers); + NULL, 0, 0, "on", &config_change_buffers, NULL); config_look_nickmode = config_file_new_option ( - ptr_section, "look_nickmode", "boolean", + weechat_config_file, ptr_section, + "look_nickmode", "boolean", N_("display nick mode ((half)op/voice) before each nick"), - NULL, 0, 0, "on", &config_change_buffers); + NULL, 0, 0, "on", &config_change_buffers, NULL); config_look_nickmode_empty = config_file_new_option ( - ptr_section, "look_nickmode_empty", "boolean", + weechat_config_file, ptr_section, + "look_nickmode_empty", "boolean", N_("display space if nick mode is not (half)op/voice"), - NULL, 0, 0, "off", &config_change_buffers); + NULL, 0, 0, "off", &config_change_buffers, NULL); config_look_prefix[GUI_CHAT_PREFIX_INFO] = config_file_new_option ( - ptr_section, "look_prefix_info", "string", + weechat_config_file, ptr_section, + "look_prefix_info", "string", N_("prefix for info messages"), - NULL, 0, 0, "-=-", &config_change_prefix); + NULL, 0, 0, "-=-", &config_change_prefix, NULL); config_look_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( - ptr_section, "look_prefix_error", "string", + weechat_config_file, ptr_section, + "look_prefix_error", "string", N_("prefix for error messages"), - NULL, 0, 0, "=!=", &config_change_prefix); + NULL, 0, 0, "=!=", &config_change_prefix, NULL); config_look_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( - ptr_section, "look_prefix_network", "string", + weechat_config_file, ptr_section, + "look_prefix_network", "string", N_("prefix for network messages"), - NULL, 0, 0, "-@-", &config_change_prefix); + NULL, 0, 0, "-@-", &config_change_prefix, NULL); config_look_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( - ptr_section, "look_prefix_action", "string", + weechat_config_file, ptr_section, + "look_prefix_action", "string", N_("prefix for action messages"), - NULL, 0, 0, "-*-", &config_change_prefix); + NULL, 0, 0, "-*-", &config_change_prefix, NULL); config_look_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( - ptr_section, "look_prefix_join", "string", + weechat_config_file, ptr_section, + "look_prefix_join", "string", N_("prefix for join messages"), - NULL, 0, 0, "-->", &config_change_prefix); + NULL, 0, 0, "-->", &config_change_prefix, NULL); config_look_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( - ptr_section, "look_prefix_quit", "string", + weechat_config_file, ptr_section, + "look_prefix_quit", "string", N_("prefix for quit messages"), - NULL, 0, 0, "<--", &config_change_prefix); + NULL, 0, 0, "<--", &config_change_prefix, NULL); config_look_prefix_align = config_file_new_option ( - ptr_section, "look_prefix_align", "integer", + weechat_config_file, ptr_section, + "look_prefix_align", "integer", N_("prefix alignment (none, left, right (default))"), - "none|left|right", 0, 0, "right", &config_change_buffers); + "none|left|right", 0, 0, "right", &config_change_buffers, NULL); config_look_prefix_align_max = config_file_new_option ( - ptr_section, "look_prefix_align_max", "integer", + weechat_config_file, ptr_section, + "look_prefix_align_max", "integer", N_("max size for prefix (0 = no max size)"), - NULL, 0, 64, "0", &config_change_buffers); + NULL, 0, 64, "0", &config_change_buffers, NULL); config_look_prefix_suffix = config_file_new_option ( - ptr_section, "look_prefix_suffix", "string", + weechat_config_file, ptr_section, + "look_prefix_suffix", "string", N_("string displayed after prefix"), - NULL, 0, 0, "|", &config_change_buffers); + NULL, 0, 0, "|", &config_change_buffers, NULL); config_look_nick_completor = config_file_new_option ( - ptr_section, "look_nick_completor", "string", + weechat_config_file, ptr_section, + "look_nick_completor", "string", N_("string inserted after nick completion"), - NULL, 0, 0, ":", NULL); + NULL, 0, 0, ":", NULL, NULL); config_look_nick_completion_ignore = config_file_new_option ( - ptr_section, "look_nick_completion_ignore", "string", + weechat_config_file, ptr_section, + "look_nick_completion_ignore", "string", N_("chars ignored for nick completion"), - NULL, 0, 0, "[]-^", NULL); + NULL, 0, 0, "[]-^", NULL, NULL); config_look_nick_complete_first = config_file_new_option ( - ptr_section, "look_nick_complete_first", "boolean", + weechat_config_file, ptr_section, + "look_nick_complete_first", "boolean", N_("complete only with first nick found"), - NULL, 0, 0, "off", NULL); + NULL, 0, 0, "off", NULL, NULL); config_look_infobar = config_file_new_option ( - ptr_section, "look_infobar", "boolean", + weechat_config_file, ptr_section, + "look_infobar", "boolean", N_("enable info bar"), - NULL, 0, 0, "on", &config_change_buffers); + NULL, 0, 0, "on", &config_change_buffers, NULL); config_look_infobar_time_format = config_file_new_option ( - ptr_section, "look_infobar_time_format", "string", + weechat_config_file, ptr_section, + "look_infobar_time_format", "string", N_("time format for time in infobar"), - NULL, 0, 0, "%B, %A %d %Y", &config_change_buffer_content); + NULL, 0, 0, "%B, %A %d %Y", &config_change_buffer_content, NULL); config_look_infobar_seconds = config_file_new_option ( - ptr_section, "look_infobar_seconds", "boolean", + weechat_config_file, ptr_section, + "look_infobar_seconds", "boolean", N_("display seconds in infobar time"), - NULL, 0, 0, "on", &config_change_infobar_seconds); + NULL, 0, 0, "on", &config_change_infobar_seconds, NULL); config_look_infobar_delay_highlight = config_file_new_option ( - ptr_section, "look_infobar_delay_highlight", "integer", + weechat_config_file, ptr_section, + "look_infobar_delay_highlight", "integer", N_("delay (in seconds) for highlight messages in " "infobar (0 = disable highlight notifications in " "infobar)"), - NULL, 0, INT_MAX, "7", NULL); + NULL, 0, INT_MAX, "7", NULL, NULL); config_look_hotlist_names_count = config_file_new_option ( - ptr_section, "look_hotlist_names_count", "integer", + weechat_config_file, ptr_section, + "look_hotlist_names_count", "integer", N_("max number of names in hotlist (0 = no name " "displayed, only buffer numbers)"), - NULL, 0, 32, "3", &config_change_buffer_content); + NULL, 0, 32, "3", &config_change_buffer_content, NULL); config_look_hotlist_names_level = config_file_new_option ( - ptr_section, "look_hotlist_names_level", "integer", + weechat_config_file, ptr_section, + "look_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", &config_change_buffer_content); + NULL, 1, 15, "12", &config_change_buffer_content, NULL); config_look_hotlist_names_length = config_file_new_option ( - ptr_section, "look_hotlist_names_length", "integer", + weechat_config_file, ptr_section, + "look_hotlist_names_length", "integer", N_("max length of names in hotlist (0 = no limit)"), - NULL, 0, 32, "0", &config_change_buffer_content); + NULL, 0, 32, "0", &config_change_buffer_content, NULL); config_look_hotlist_sort = config_file_new_option ( - ptr_section, "look_hotlist_sort", "integer", + weechat_config_file, ptr_section, + "look_hotlist_sort", "integer", N_("hotlist sort type (group_time_asc (default), " "group_time_desc, group_number_asc, group_number_desc, " "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", &config_change_hotlist); + 0, 0, "group_time_asc", &config_change_hotlist, NULL); config_look_day_change = config_file_new_option ( - ptr_section, "look_day_change", "boolean", + weechat_config_file, ptr_section, + "look_day_change", "boolean", N_("display special message when day changes"), - NULL, 0, 0, "on", &config_change_day_change); + NULL, 0, 0, "on", &config_change_day_change, NULL); config_look_day_change_time_format = config_file_new_option ( - ptr_section, "look_day_change_time_format", "string", + weechat_config_file, ptr_section, + "look_day_change_time_format", "string", N_("time format for date displayed when day changed"), - NULL, 0, 0, "%a, %d %b %Y", NULL); + NULL, 0, 0, "%a, %d %b %Y", NULL, NULL); config_look_read_marker = config_file_new_option ( - ptr_section, "look_read_marker", "string", + weechat_config_file, ptr_section, + "look_read_marker", "string", N_("use a marker on servers/channels to show first unread " "line"), - NULL, 0, 1, " ", &config_change_read_marker); + NULL, 0, 1, " ", &config_change_read_marker, NULL); config_look_input_format = config_file_new_option ( - ptr_section, "look_input_format", "string", + weechat_config_file, ptr_section, + "look_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)] ", &config_change_buffer_content); + NULL, 0, 0, "[%n(%m)] ", &config_change_buffer_content, NULL); config_look_paste_max_lines = config_file_new_option ( - ptr_section, "look_paste_max_lines", "integer", + weechat_config_file, ptr_section, + "look_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, 0, INT_MAX, "3", NULL, NULL); config_look_default_msg_quit = config_file_new_option ( - ptr_section, "look_default_msg_quit", "string", + weechat_config_file, ptr_section, + "look_default_msg_quit", "string", N_("default quit message ('%v' will be replaced by WeeChat version in " "string)"), - NULL, 0, 0, "WeeChat %v", NULL); + NULL, 0, 0, "WeeChat %v", NULL, NULL); /* colors */ ptr_section = config_file_new_section (weechat_config_file, "colors", - NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -731,325 +779,401 @@ config_weechat_init () /* general color settings */ config_color_separator = config_file_new_option ( - ptr_section, "color_separator", "color", + weechat_config_file, ptr_section, "color_separator", "color", N_("background color for window separators (when splited)"), - NULL, GUI_COLOR_SEPARATOR, 0, "blue", &config_change_color); + NULL, GUI_COLOR_SEPARATOR, 0, "blue", &config_change_color, NULL); /* title window */ config_color_title = config_file_new_option ( - ptr_section, "color_title", "color", + weechat_config_file, ptr_section, + "color_title", "color", N_("text color for title bar"), - NULL, GUI_COLOR_TITLE, 0, "default", &config_change_color); + NULL, GUI_COLOR_TITLE, 0, "default", &config_change_color, NULL); config_color_title_bg = config_file_new_option ( - ptr_section, "color_title_bg", "color", + weechat_config_file, ptr_section, + "color_title_bg", "color", N_("background color for title bar"), - NULL, -1, 0, "blue", &config_change_color); + NULL, -1, 0, "blue", &config_change_color, NULL); config_color_title_more = config_file_new_option ( - ptr_section, "color_title_more", "color", + weechat_config_file, ptr_section, + "color_title_more", "color", N_("text color for '+' when scrolling title"), - NULL, GUI_COLOR_TITLE_MORE, 0, "lightmagenta", &config_change_color); + NULL, GUI_COLOR_TITLE_MORE, 0, "lightmagenta", &config_change_color, NULL); /* chat window */ config_color_chat = config_file_new_option ( - ptr_section, "color_chat", "color", + weechat_config_file, ptr_section, + "color_chat", "color", N_("text color for chat"), - NULL, GUI_COLOR_CHAT, 0, "default", &config_change_color); + NULL, GUI_COLOR_CHAT, 0, "default", &config_change_color, NULL); config_color_chat_bg = config_file_new_option ( - ptr_section, "color_chat_bg", "color", + weechat_config_file, ptr_section, + "color_chat_bg", "color", N_("background color for chat"), - NULL, -1, 0, "default", &config_change_color); + NULL, -1, 0, "default", &config_change_color, NULL); config_color_chat_time = config_file_new_option ( - ptr_section, "color_chat_time", "color", + weechat_config_file, ptr_section, + "color_chat_time", "color", N_("text color for time in chat window"), - NULL, GUI_COLOR_CHAT_TIME, 0, "default", &config_change_color); + NULL, GUI_COLOR_CHAT_TIME, 0, "default", &config_change_color, NULL); config_color_chat_time_delimiters = config_file_new_option ( - ptr_section, "color_chat_time_delimiters", "color", + weechat_config_file, ptr_section, + "color_chat_time_delimiters", "color", N_("text color for time delimiters"), - NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", &config_change_color); + NULL, GUI_COLOR_CHAT_TIME_DELIMITERS, 0, "brown", &config_change_color, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_INFO] = config_file_new_option ( - ptr_section, "color_chat_prefix_info", "color", + weechat_config_file, ptr_section, + "color_chat_prefix_info", "color", N_("text color for info prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_INFO, 0, "lightcyan", &config_change_color); + NULL, GUI_COLOR_CHAT_PREFIX_INFO, 0, "lightcyan", &config_change_color, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_ERROR] = config_file_new_option ( - ptr_section, "color_chat_prefix_error", "color", + weechat_config_file, ptr_section, + "color_chat_prefix_error", "color", N_("text color for error prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", &config_change_color); + NULL, GUI_COLOR_CHAT_PREFIX_ERROR, 0, "yellow", &config_change_color, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_NETWORK] = config_file_new_option ( - ptr_section, "color_chat_prefix_network", "color", + weechat_config_file, ptr_section, + "color_chat_prefix_network", "color", N_("text color for network prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "lightmagenta", &config_change_color); + NULL, GUI_COLOR_CHAT_PREFIX_NETWORK, 0, "lightmagenta", &config_change_color, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_ACTION] = config_file_new_option ( - ptr_section, "color_chat_prefix_action", "color", + weechat_config_file, ptr_section, + "color_chat_prefix_action", "color", N_("text color for action prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", &config_change_color); + NULL, GUI_COLOR_CHAT_PREFIX_ACTION, 0, "white", &config_change_color, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_JOIN] = config_file_new_option ( - ptr_section, "color_chat_prefix_join", "color", + weechat_config_file, ptr_section, + "color_chat_prefix_join", "color", N_("text color for join prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", &config_change_color); + NULL, GUI_COLOR_CHAT_PREFIX_JOIN, 0, "lightgreen", &config_change_color, NULL); config_color_chat_prefix[GUI_CHAT_PREFIX_QUIT] = config_file_new_option ( - ptr_section, "color_chat_prefix_quit", "color", + weechat_config_file, ptr_section, + "color_chat_prefix_quit", "color", N_("text color for quit prefix"), - NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", &config_change_color); + NULL, GUI_COLOR_CHAT_PREFIX_QUIT, 0, "lightred", &config_change_color, NULL); config_color_chat_prefix_more = config_file_new_option ( - ptr_section, "color_chat_prefix_more", "color", + weechat_config_file, ptr_section, + "color_chat_prefix_more", "color", N_("text color for '+' when prefix is too long"), - NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", &config_change_color); + NULL, GUI_COLOR_CHAT_PREFIX_MORE, 0, "lightmagenta", &config_change_color, NULL); config_color_chat_prefix_suffix = config_file_new_option ( - ptr_section, "color_chat_prefix_suffix", "color", + weechat_config_file, ptr_section, + "color_chat_prefix_suffix", "color", N_("text color for suffix (after prefix)"), - NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", &config_change_color); + NULL, GUI_COLOR_CHAT_PREFIX_SUFFIX, 0, "green", &config_change_color, NULL); config_color_chat_buffer = config_file_new_option ( - ptr_section, "color_chat_buffer", "color", + weechat_config_file, ptr_section, + "color_chat_buffer", "color", N_("text color for buffer names"), - NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", &config_change_color); + NULL, GUI_COLOR_CHAT_BUFFER, 0, "white", &config_change_color, NULL); config_color_chat_server = config_file_new_option ( - ptr_section, "color_chat_server", "color", + weechat_config_file, ptr_section, + "color_chat_server", "color", N_("text color for server names"), - NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", &config_change_color); + NULL, GUI_COLOR_CHAT_SERVER, 0, "brown", &config_change_color, NULL); config_color_chat_channel = config_file_new_option ( - ptr_section, "color_chat_channel", "color", + weechat_config_file, ptr_section, + "color_chat_channel", "color", N_("text color for channel names"), - NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", &config_change_color); + NULL, GUI_COLOR_CHAT_CHANNEL, 0, "white", &config_change_color, NULL); config_color_chat_nick = config_file_new_option ( - ptr_section, "color_chat_nick", "color", + weechat_config_file, ptr_section, + "color_chat_nick", "color", N_("text color for nicks in chat window"), - NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK, 0, "lightcyan", &config_change_color, NULL); config_color_chat_nick_self = config_file_new_option ( - ptr_section, "color_chat_nick_self", "color", + weechat_config_file, ptr_section, + "color_chat_nick_self", "color", N_("text color for local nick in chat window"), - NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK_SELF, 0, "white", &config_change_color, NULL); config_color_chat_nick_other = config_file_new_option ( - ptr_section, "color_chat_nick_other", "color", + weechat_config_file, ptr_section, + "color_chat_nick_other", "color", N_("text color for other nick in private buffer"), - NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "default", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK_OTHER, 0, "default", &config_change_color, NULL); config_color_chat_nick_colors[0] = config_file_new_option ( - ptr_section, "color_chat_nick_color1", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color1", "color", N_("text color #1 for nick"), - NULL, GUI_COLOR_CHAT_NICK1, 0, "cyan", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK1, 0, "cyan", &config_change_color, NULL); config_color_chat_nick_colors[1] = config_file_new_option ( - ptr_section, "color_chat_nick_color2", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color2", "color", N_("text color #2 for nick"), - NULL, GUI_COLOR_CHAT_NICK2, 0, "magenta", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK2, 0, "magenta", &config_change_color, NULL); config_color_chat_nick_colors[2] = config_file_new_option ( - ptr_section, "color_chat_nick_color3", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color3", "color", N_("text color #3 for nick"), - NULL, GUI_COLOR_CHAT_NICK3, 0, "green", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK3, 0, "green", &config_change_color, NULL); config_color_chat_nick_colors[3] = config_file_new_option ( - ptr_section, "color_chat_nick_color4", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color4", "color", N_("text color #4 for nick"), - NULL, GUI_COLOR_CHAT_NICK4, 0, "brown", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK4, 0, "brown", &config_change_color, NULL); config_color_chat_nick_colors[4] = config_file_new_option ( - ptr_section, "color_chat_nick_color5", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color5", "color", N_("text color #5 for nick"), - NULL, GUI_COLOR_CHAT_NICK5, 0, "lightblue", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK5, 0, "lightblue", &config_change_color, NULL); config_color_chat_nick_colors[5] = config_file_new_option ( - ptr_section, "color_chat_nick_color6", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color6", "color", N_("text color #6 for nick"), - NULL, GUI_COLOR_CHAT_NICK6, 0, "default", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK6, 0, "default", &config_change_color, NULL); config_color_chat_nick_colors[6] = config_file_new_option ( - ptr_section, "color_chat_nick_color7", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color7", "color", N_("text color #7 for nick"), - NULL, GUI_COLOR_CHAT_NICK7, 0, "lightcyan", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK7, 0, "lightcyan", &config_change_color, NULL); config_color_chat_nick_colors[7] = config_file_new_option ( - ptr_section, "color_chat_nick_color8", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color8", "color", N_("text color #8 for nick"), - NULL, GUI_COLOR_CHAT_NICK8, 0, "lightmagenta", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK8, 0, "lightmagenta", &config_change_color, NULL); config_color_chat_nick_colors[8] = config_file_new_option ( - ptr_section, "color_chat_nick_color9", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color9", "color", N_("text color #9 for nick"), - NULL, GUI_COLOR_CHAT_NICK9, 0, "lightgreen", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK9, 0, "lightgreen", &config_change_color, NULL); config_color_chat_nick_colors[9] = config_file_new_option ( - ptr_section, "color_chat_nick_color10", "color", + weechat_config_file, ptr_section, + "color_chat_nick_color10", "color", N_("text color #10 for nick"), - NULL, GUI_COLOR_CHAT_NICK10, 0, "blue", &config_change_color); + NULL, GUI_COLOR_CHAT_NICK10, 0, "blue", &config_change_color, NULL); config_color_chat_host = config_file_new_option ( - ptr_section, "color_chat_host", "color", + weechat_config_file, ptr_section, + "color_chat_host", "color", N_("text color for hostnames"), - NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", &config_change_color); + NULL, GUI_COLOR_CHAT_HOST, 0, "cyan", &config_change_color, NULL); config_color_chat_delimiters = config_file_new_option ( - ptr_section, "color_chat_delimiters", "color", + weechat_config_file, ptr_section, + "color_chat_delimiters", "color", N_("text color for delimiters"), - NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", &config_change_color); + NULL, GUI_COLOR_CHAT_DELIMITERS, 0, "green", &config_change_color, NULL); config_color_chat_highlight = config_file_new_option ( - ptr_section, "color_chat_highlight", "color", + weechat_config_file, ptr_section, + "color_chat_highlight", "color", N_("text color for highlighted nick"), - NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", &config_change_color); + NULL, GUI_COLOR_CHAT_HIGHLIGHT, 0, "yellow", &config_change_color, NULL); config_color_chat_read_marker = config_file_new_option ( - ptr_section, "color_chat_read_marker", "color", + weechat_config_file, ptr_section, + "color_chat_read_marker", "color", N_("text color for unread data marker"), - NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "yellow", &config_change_color); + NULL, GUI_COLOR_CHAT_READ_MARKER, 0, "yellow", &config_change_color, NULL); config_color_chat_read_marker_bg = config_file_new_option ( - ptr_section, "color_chat_read_marker_bg", "color", + weechat_config_file, ptr_section, + "color_chat_read_marker_bg", "color", N_("background color for unread data marker"), - NULL, -1, 0, "magenta", &config_change_color); + NULL, -1, 0, "magenta", &config_change_color, NULL); /* status window */ config_color_status = config_file_new_option ( - ptr_section, "color_status", "color", + weechat_config_file, ptr_section, + "color_status", "color", N_("text color for status bar"), - NULL, GUI_COLOR_STATUS, 0, "default", &config_change_color); + NULL, GUI_COLOR_STATUS, 0, "default", &config_change_color, NULL); config_color_status_bg = config_file_new_option ( - ptr_section, "color_status_bg", "color", + weechat_config_file, ptr_section, + "color_status_bg", "color", N_("background color for status bar"), - NULL, -1, 0, "blue", &config_change_color); + NULL, -1, 0, "blue", &config_change_color, NULL); config_color_status_delimiters = config_file_new_option ( - ptr_section, "color_status_delimiters", "color", + weechat_config_file, ptr_section, + "color_status_delimiters", "color", N_("text color for status bar delimiters"), - NULL, GUI_COLOR_STATUS_DELIMITERS, 0, "cyan", &config_change_color); + NULL, GUI_COLOR_STATUS_DELIMITERS, 0, "cyan", &config_change_color, NULL); config_color_status_channel = config_file_new_option ( - ptr_section, "color_status_channel", "color", + weechat_config_file, ptr_section, + "color_status_channel", "color", N_("text color for current channel in status bar"), - NULL, GUI_COLOR_STATUS_CHANNEL, 0, "white", &config_change_color); + NULL, GUI_COLOR_STATUS_CHANNEL, 0, "white", &config_change_color, NULL); config_color_status_data_msg = config_file_new_option ( - ptr_section, "color_status_data_msg", "color", + weechat_config_file, ptr_section, + "color_status_data_msg", "color", N_("text color for buffer with new messages (status bar)"), - NULL, GUI_COLOR_STATUS_DATA_MSG, 0, "yellow", &config_change_color); + NULL, GUI_COLOR_STATUS_DATA_MSG, 0, "yellow", &config_change_color, NULL); config_color_status_data_private = config_file_new_option ( - ptr_section, "color_status_data_private", "color", + weechat_config_file, ptr_section, + "color_status_data_private", "color", N_("text color for buffer with private message (status bar)"), - NULL, GUI_COLOR_STATUS_DATA_PRIVATE, 0, "lightgreen", &config_change_color); + NULL, GUI_COLOR_STATUS_DATA_PRIVATE, 0, "lightgreen", &config_change_color, NULL); config_color_status_data_highlight = config_file_new_option ( - ptr_section, "color_status_data_highlight", "color", + weechat_config_file, ptr_section, + "color_status_data_highlight", "color", N_("text color for buffer with highlight (status bar)"), - NULL, GUI_COLOR_STATUS_DATA_HIGHLIGHT, 0, "lightmagenta", &config_change_color); + NULL, GUI_COLOR_STATUS_DATA_HIGHLIGHT, 0, "lightmagenta", &config_change_color, NULL); config_color_status_data_other = config_file_new_option ( - ptr_section, "color_status_data_other", "color", + weechat_config_file, ptr_section, + "color_status_data_other", "color", N_("text color for buffer with new data (not messages) " "(status bar)"), - NULL, GUI_COLOR_STATUS_DATA_OTHER, 0, "default", &config_change_color); + NULL, GUI_COLOR_STATUS_DATA_OTHER, 0, "default", &config_change_color, NULL); config_color_status_more = config_file_new_option ( - ptr_section, "color_status_more", "color", + weechat_config_file, ptr_section, + "color_status_more", "color", N_("text color for buffer with new data (status bar)"), - NULL, GUI_COLOR_STATUS_MORE, 0, "white", &config_change_color); + NULL, GUI_COLOR_STATUS_MORE, 0, "white", &config_change_color, NULL); /* infobar window */ config_color_infobar = config_file_new_option ( - ptr_section, "color_infobar", "color", + weechat_config_file, ptr_section, + "color_infobar", "color", N_("text color for infobar"), - NULL, GUI_COLOR_INFOBAR, 0, "black", &config_change_color); + NULL, GUI_COLOR_INFOBAR, 0, "black", &config_change_color, NULL); config_color_infobar_bg = config_file_new_option ( - ptr_section, "color_infobar_bg", "color", + weechat_config_file, ptr_section, + "color_infobar_bg", "color", N_("background color for infobar"), - NULL, -1, 0, "cyan", &config_change_color); + NULL, -1, 0, "cyan", &config_change_color, NULL); config_color_infobar_delimiters = config_file_new_option ( - ptr_section, "color_infobar_delimiters", "color", + weechat_config_file, ptr_section, + "color_infobar_delimiters", "color", N_("text color for infobar delimiters"), - NULL, GUI_COLOR_INFOBAR_DELIMITERS, 0, "blue", &config_change_color); + NULL, GUI_COLOR_INFOBAR_DELIMITERS, 0, "blue", &config_change_color, NULL); config_color_infobar_highlight = config_file_new_option ( - ptr_section, "color_infobar_highlight", "color", + weechat_config_file, ptr_section, + "color_infobar_highlight", "color", N_("text color for infobar highlight notification"), - NULL, GUI_COLOR_INFOBAR_HIGHLIGHT, 0, "white", &config_change_color); + NULL, GUI_COLOR_INFOBAR_HIGHLIGHT, 0, "white", &config_change_color, NULL); /* input window */ config_color_input = config_file_new_option ( - ptr_section, "color_input", "color", + weechat_config_file, ptr_section, + "color_input", "color", N_("text color for input line"), - NULL, GUI_COLOR_INPUT, 0, "default", &config_change_color); + NULL, GUI_COLOR_INPUT, 0, "default", &config_change_color, NULL); config_color_input_bg = config_file_new_option ( - ptr_section, "color_input_bg", "color", + weechat_config_file, ptr_section, + "color_input_bg", "color", N_("background color for input line"), - NULL, -1, 0, "default", &config_change_color); + NULL, -1, 0, "default", &config_change_color, NULL); config_color_input_server = config_file_new_option ( - ptr_section, "color_input_server", "color", + weechat_config_file, ptr_section, + "color_input_server", "color", N_("text color for server name in input line"), - NULL, GUI_COLOR_INPUT_SERVER, 0, "brown", &config_change_color); + NULL, GUI_COLOR_INPUT_SERVER, 0, "brown", &config_change_color, NULL); config_color_input_channel = config_file_new_option ( - ptr_section, "color_input_channel", "color", + weechat_config_file, ptr_section, + "color_input_channel", "color", N_("text color for channel name in input line"), - NULL, GUI_COLOR_INPUT_CHANNEL, 0, "white", &config_change_color); + NULL, GUI_COLOR_INPUT_CHANNEL, 0, "white", &config_change_color, NULL); config_color_input_nick = config_file_new_option ( - ptr_section, "color_input_nick", "color", + weechat_config_file, ptr_section, + "color_input_nick", "color", N_("text color for nick name in input line"), - NULL, GUI_COLOR_INPUT_NICK, 0, "lightcyan", &config_change_color); + NULL, GUI_COLOR_INPUT_NICK, 0, "lightcyan", &config_change_color, NULL); config_color_input_delimiters = config_file_new_option ( - ptr_section, "color_input_delimiters", "color", + weechat_config_file, ptr_section, + "color_input_delimiters", "color", N_("text color for delimiters in input line"), - NULL, GUI_COLOR_INPUT_DELIMITERS, 0, "cyan", &config_change_color); + NULL, GUI_COLOR_INPUT_DELIMITERS, 0, "cyan", &config_change_color, NULL); config_color_input_text_not_found = config_file_new_option ( - ptr_section, "color_input_text_not_found", "color", + weechat_config_file, ptr_section, + "color_input_text_not_found", "color", N_("text color for unsucessful text search in input line"), - NULL, GUI_COLOR_INPUT_TEXT_NOT_FOUND, 0, "red", &config_change_color); + NULL, GUI_COLOR_INPUT_TEXT_NOT_FOUND, 0, "red", &config_change_color, NULL); config_color_input_actions = config_file_new_option ( - ptr_section, "color_input_actions", "color", + weechat_config_file, ptr_section, + "color_input_actions", "color", N_("text color for actions in input line"), - NULL, GUI_COLOR_INPUT_ACTIONS, 0, "lightgreen", &config_change_color); + NULL, GUI_COLOR_INPUT_ACTIONS, 0, "lightgreen", &config_change_color, NULL); /* nicklist window */ config_color_nicklist = config_file_new_option ( - ptr_section, "color_nicklist", "color", + weechat_config_file, ptr_section, + "color_nicklist", "color", N_("text color for nicklist"), - NULL, GUI_COLOR_NICKLIST, 0, "default", &config_change_color); + NULL, GUI_COLOR_NICKLIST, 0, "default", &config_change_color, NULL); config_color_nicklist_bg = config_file_new_option ( - ptr_section, "color_nicklist_bg", "color", + weechat_config_file, ptr_section, + "color_nicklist_bg", "color", N_("background color for nicklist"), - NULL, -1, 0, "default", &config_change_color); + NULL, -1, 0, "default", &config_change_color, NULL); config_color_nicklist_group = config_file_new_option ( - ptr_section, "color_nicklist_group", "color", + weechat_config_file, ptr_section, + "color_nicklist_group", "color", N_("text color for groups in nicklist"), - NULL, GUI_COLOR_NICKLIST_GROUP, 0, "green", &config_change_color); + NULL, GUI_COLOR_NICKLIST_GROUP, 0, "green", &config_change_color, NULL); config_color_nicklist_away = config_file_new_option ( - ptr_section, "color_nicklist_away", "color", + weechat_config_file, ptr_section, + "color_nicklist_away", "color", N_("text color for away nicknames"), - NULL, GUI_COLOR_NICKLIST_AWAY, 0, "cyan", &config_change_color); + NULL, GUI_COLOR_NICKLIST_AWAY, 0, "cyan", &config_change_color, NULL); config_color_nicklist_prefix1 = config_file_new_option ( - ptr_section, "color_nicklist_prefix1", "color", + weechat_config_file, ptr_section, + "color_nicklist_prefix1", "color", N_("text color for prefix #1 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX1, 0, "lightgreen", &config_change_color); + NULL, GUI_COLOR_NICKLIST_PREFIX1, 0, "lightgreen", &config_change_color, NULL); config_color_nicklist_prefix2 = config_file_new_option ( - ptr_section, "color_nicklist_prefix2", "color", + weechat_config_file, ptr_section, + "color_nicklist_prefix2", "color", N_("text color for prefix #2 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX2, 0, "lightmagenta", &config_change_color); + NULL, GUI_COLOR_NICKLIST_PREFIX2, 0, "lightmagenta", &config_change_color, NULL); config_color_nicklist_prefix3 = config_file_new_option ( - ptr_section, "color_nicklist_prefix3", "color", + weechat_config_file, ptr_section, + "color_nicklist_prefix3", "color", N_("text color for prefix #3 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX3, 0, "yellow", &config_change_color); + NULL, GUI_COLOR_NICKLIST_PREFIX3, 0, "yellow", &config_change_color, NULL); config_color_nicklist_prefix4 = config_file_new_option ( - ptr_section, "color_nicklist_prefix4", "color", + weechat_config_file, ptr_section, + "color_nicklist_prefix4", "color", N_("text color for prefix #4 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX4, 0, "blue", &config_change_color); + NULL, GUI_COLOR_NICKLIST_PREFIX4, 0, "blue", &config_change_color, NULL); config_color_nicklist_prefix5 = config_file_new_option ( - ptr_section, "color_nicklist_prefix5", "color", + weechat_config_file, ptr_section, + "color_nicklist_prefix5", "color", N_("text color for prefix #5 in nicklist"), - NULL, GUI_COLOR_NICKLIST_PREFIX5, 0, "brown", &config_change_color); + NULL, GUI_COLOR_NICKLIST_PREFIX5, 0, "brown", &config_change_color, NULL); config_color_nicklist_more = config_file_new_option ( - ptr_section, "color_nicklist_more", "color", + weechat_config_file, ptr_section, + "color_nicklist_more", "color", N_("text color for '+' when scrolling nicks in nicklist"), - NULL, GUI_COLOR_NICKLIST_MORE, 0, "lightmagenta", &config_change_color); + NULL, GUI_COLOR_NICKLIST_MORE, 0, "lightmagenta", &config_change_color, NULL); config_color_nicklist_separator = config_file_new_option ( - ptr_section, "color_nicklist_separator", "color", + weechat_config_file, ptr_section, + "color_nicklist_separator", "color", N_("text color for nicklist separator"), - NULL, GUI_COLOR_NICKLIST_SEPARATOR, 0, "blue", &config_change_color); + NULL, GUI_COLOR_NICKLIST_SEPARATOR, 0, "blue", &config_change_color, NULL); /* status info */ config_color_info = config_file_new_option ( - ptr_section, "color_info", "color", + weechat_config_file, ptr_section, + "color_info", "color", N_("text color for status info"), - NULL, GUI_COLOR_INFO, 0, "default", &config_change_color); + NULL, GUI_COLOR_INFO, 0, "default", &config_change_color, NULL); config_color_info_bg = config_file_new_option ( - ptr_section, "color_info_bg", "color", + weechat_config_file, ptr_section, + "color_info_bg", "color", N_("background color for status info"), - NULL, -1, 0, "default", &config_change_color); + NULL, -1, 0, "default", &config_change_color, NULL); config_color_info_waiting = config_file_new_option ( - ptr_section, "color_info_waiting", "color", + weechat_config_file, ptr_section, + "color_info_waiting", "color", N_("text color for \"waiting\" status info"), - NULL, GUI_COLOR_INFO_WAITING, 0, "lightcyan", &config_change_color); + NULL, GUI_COLOR_INFO_WAITING, 0, "lightcyan", &config_change_color, NULL); config_color_info_connecting = config_file_new_option ( - ptr_section, "color_info_connecting", "color", + weechat_config_file, ptr_section, + "color_info_connecting", "color", N_("text color for \"connecting\" status info"), - NULL, GUI_COLOR_INFO_CONNECTING, 0, "yellow", &config_change_color); + NULL, GUI_COLOR_INFO_CONNECTING, 0, "yellow", &config_change_color, NULL); config_color_info_active = config_file_new_option ( - ptr_section, "color_info_active", "color", + weechat_config_file, ptr_section, + "color_info_active", "color", N_("text color for \"active\" status info"), - NULL, GUI_COLOR_INFO_ACTIVE, 0, "lightblue", &config_change_color); + NULL, GUI_COLOR_INFO_ACTIVE, 0, "lightblue", &config_change_color, NULL); config_color_info_done = config_file_new_option ( - ptr_section, "color_info_done", "color", + weechat_config_file, ptr_section, + "color_info_done", "color", N_("text color for \"done\" status info"), - NULL, GUI_COLOR_INFO_DONE, 0, "lightgreen", &config_change_color); + NULL, GUI_COLOR_INFO_DONE, 0, "lightgreen", &config_change_color, NULL); config_color_info_failed = config_file_new_option ( - ptr_section, "color_info_failed", "color", + weechat_config_file, ptr_section, + "color_info_failed", "color", N_("text color for \"failed\" status info"), - NULL, GUI_COLOR_INFO_FAILED, 0, "lightred", &config_change_color); + NULL, GUI_COLOR_INFO_FAILED, 0, "lightred", &config_change_color, NULL); config_color_info_aborted = config_file_new_option ( - ptr_section, "color_info_aborted", "color", + weechat_config_file, ptr_section, + "color_info_aborted", "color", N_("text color for \"aborted\" status info"), - NULL, GUI_COLOR_INFO_ABORTED, 0, "lightred", &config_change_color); + NULL, GUI_COLOR_INFO_ABORTED, 0, "lightred", &config_change_color, NULL); /* history */ ptr_section = config_file_new_section (weechat_config_file, "history", - NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -1057,24 +1181,27 @@ config_weechat_init () } config_history_max_lines = config_file_new_option ( - ptr_section, "history_max_lines", "integer", + weechat_config_file, ptr_section, + "history_max_lines", "integer", N_("maximum number of lines in history per buffer " "(0 = unlimited)"), - NULL, 0, INT_MAX, "4096", NULL); + NULL, 0, INT_MAX, "4096", NULL, NULL); config_history_max_commands = config_file_new_option ( - ptr_section, "history_max_commands", "integer", + weechat_config_file, ptr_section, + "history_max_commands", "integer", N_("maximum number of user commands in history (0 = " "unlimited)"), - NULL, 0, INT_MAX, "100", NULL); + NULL, 0, INT_MAX, "100", NULL, NULL); config_history_display_default = config_file_new_option ( - ptr_section, "history_display_default", "integer", + weechat_config_file, ptr_section, + "history_display_default", "integer", N_("maximum number of commands to display by default in " "history listing (0 = unlimited)"), - NULL, 0, INT_MAX, "5", NULL); + NULL, 0, INT_MAX, "5", NULL, NULL); /* proxy */ ptr_section = config_file_new_section (weechat_config_file, "proxy", - NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -1082,37 +1209,44 @@ config_weechat_init () } config_proxy_use = config_file_new_option ( - ptr_section, "proxy_use", "boolean", + weechat_config_file, ptr_section, + "proxy_use", "boolean", N_("use a proxy server"), - NULL, 0, 0, "off", NULL); + NULL, 0, 0, "off", NULL, NULL); config_proxy_type = config_file_new_option ( - ptr_section, "proxy_type", "integer", + weechat_config_file, ptr_section, + "proxy_type", "integer", N_("proxy type (http (default), socks4, socks5)"), - "http|socks4|socks5", 0, 0, "http", NULL); + "http|socks4|socks5", 0, 0, "http", NULL, NULL); config_proxy_ipv6 = config_file_new_option ( - ptr_section, "proxy_ipv6", "boolean", + weechat_config_file, ptr_section, + "proxy_ipv6", "boolean", N_("connect to proxy using ipv6"), - NULL, 0, 0, "off", NULL); + NULL, 0, 0, "off", NULL, NULL); config_proxy_address = config_file_new_option ( - ptr_section, "proxy_address", "string", + weechat_config_file, ptr_section, + "proxy_address", "string", N_("proxy server address (IP or hostname)"), - NULL, 0, 0, "", NULL); + NULL, 0, 0, "", NULL, NULL); config_proxy_port = config_file_new_option ( - ptr_section, "proxy_port", "integer", + weechat_config_file, ptr_section, + "proxy_port", "integer", N_("port for connecting to proxy server"), - NULL, 0, 65535, "3128", NULL); + NULL, 0, 65535, "3128", NULL, NULL); config_proxy_username = config_file_new_option ( - ptr_section, "proxy_username", "string", + weechat_config_file, ptr_section, + "proxy_username", "string", N_("username for proxy server"), - NULL, 0, 0, "", NULL); + NULL, 0, 0, "", NULL, NULL); config_proxy_password = config_file_new_option ( - ptr_section, "proxy_password", "string", + weechat_config_file, ptr_section, + "proxy_password", "string", N_("password for proxy server"), - NULL, 0, 0, "", NULL); + NULL, 0, 0, "", NULL, NULL); /* plugins */ ptr_section = config_file_new_section (weechat_config_file, "plugins", - NULL, NULL, NULL); + NULL, NULL, NULL, NULL, NULL, NULL); if (!ptr_section) { config_file_free (weechat_config_file); @@ -1120,19 +1254,22 @@ config_weechat_init () } config_plugins_path = config_file_new_option ( - ptr_section, "plugins_path", "string", + weechat_config_file, ptr_section, + "plugins_path", "string", N_("path for searching plugins ('%h' will be replaced by " "WeeChat home, ~/.weechat by default)"), - NULL, 0, 0, "%h/plugins", NULL); + NULL, 0, 0, "%h/plugins", NULL, NULL); config_plugins_autoload = config_file_new_option ( - ptr_section, "plugins_autoload", "string", + weechat_config_file, ptr_section, + "plugins_autoload", "string", N_("comma separated list of plugins to load automatically " "at startup, \"*\" means all plugins found (names may " "be partial, for example \"perl\" is ok for " "\"perl.so\")"), - NULL, 0, 0, "*", NULL); + NULL, 0, 0, "*", NULL, NULL); config_plugins_extension = config_file_new_option ( - ptr_section, "plugins_extension", "string", + weechat_config_file, ptr_section, + "plugins_extension", "string", N_("standard plugins extension in filename (for example " "\".so\" under Linux or \".dll\" under Microsoft Windows)"), NULL, 0, 0, @@ -1141,13 +1278,21 @@ config_weechat_init () #else ".so", #endif - NULL); + NULL, NULL); + config_plugins_save_config_on_unload = config_file_new_option ( + weechat_config_file, ptr_section, + "plugins_save_config_on_unload", "boolean", + N_("save configuration files when unloading plugins"), + NULL, 0, 0, "on", NULL, NULL); /* keys */ ptr_section = config_file_new_section (weechat_config_file, "keys", &config_weechat_read_key, + NULL, + &config_weechat_write_keys, + NULL, &config_weechat_write_keys, - &config_weechat_write_keys); + NULL); if (!ptr_section) { config_file_free (weechat_config_file); diff --git a/src/core/wee-config.h b/src/core/wee-config.h index 5d6476af6..3be894daa 100644 --- a/src/core/wee-config.h +++ b/src/core/wee-config.h @@ -164,6 +164,7 @@ extern struct t_config_option *config_proxy_password; extern struct t_config_option *config_plugins_path; extern struct t_config_option *config_plugins_autoload; extern struct t_config_option *config_plugins_extension; +extern struct t_config_option *config_plugins_save_config_on_unload; extern int config_weechat_init (); extern int config_weechat_read (); |