diff options
-rw-r--r-- | src/plugins/fset/fset-config.c | 26 | ||||
-rw-r--r-- | src/plugins/fset/fset-config.h | 1 | ||||
-rw-r--r-- | src/plugins/fset/fset-option.c | 7 |
3 files changed, 34 insertions, 0 deletions
diff --git a/src/plugins/fset/fset-config.c b/src/plugins/fset/fset-config.c index ccc76b607..1bbe884eb 100644 --- a/src/plugins/fset/fset-config.c +++ b/src/plugins/fset/fset-config.c @@ -35,6 +35,7 @@ struct t_config_file *fset_config_file = NULL; struct t_config_option *fset_config_look_condition_catch_set; struct t_config_option *fset_config_look_help_bar; +struct t_config_option *fset_config_look_show_plugin_description; struct t_config_option *fset_config_look_use_keys; struct t_config_option *fset_config_look_use_mute; @@ -84,6 +85,23 @@ fset_config_change_help_bar_cb (const void *pointer, void *data, } /* + * Callback for changes on option "fset.look.show_plugin_description". + */ + +void +fset_config_change_show_plugin_description_cb (const void *pointer, void *data, + struct t_config_option *option) +{ + /* make C compiler happy */ + (void) pointer; + (void) data; + (void) option; + + if (fset_buffer) + fset_buffer_refresh (1); +} + +/* * Callback for changes on option "fset.look.use_keys". */ @@ -212,6 +230,14 @@ fset_config_init () NULL, NULL, NULL, &fset_config_change_help_bar_cb, NULL, NULL, NULL, NULL, NULL); + fset_config_look_show_plugin_description = weechat_config_new_option ( + fset_config_file, ptr_section, + "show_plugin_description", "boolean", + N_("show the plugin description options (plugins.desc.*)"), + NULL, 0, 0, "off", NULL, 0, + NULL, NULL, NULL, + &fset_config_change_show_plugin_description_cb, NULL, NULL, + NULL, NULL, NULL); fset_config_look_use_keys = weechat_config_new_option ( fset_config_file, ptr_section, "use_keys", "boolean", diff --git a/src/plugins/fset/fset-config.h b/src/plugins/fset/fset-config.h index 86bdfd67c..a66407fd8 100644 --- a/src/plugins/fset/fset-config.h +++ b/src/plugins/fset/fset-config.h @@ -26,6 +26,7 @@ extern struct t_config_file *fset_config_file; extern struct t_config_option *fset_config_look_condition_catch_set; extern struct t_config_option *fset_config_look_help_bar; +extern struct t_config_option *fset_config_look_show_plugin_description; extern struct t_config_option *fset_config_look_use_keys; extern struct t_config_option *fset_config_look_use_mute; diff --git a/src/plugins/fset/fset-option.c b/src/plugins/fset/fset-option.c index a201d3e6f..095a80de6 100644 --- a/src/plugins/fset/fset-option.c +++ b/src/plugins/fset/fset-option.c @@ -207,6 +207,13 @@ int fset_option_match_filters (const char *config_name, const char *section_name, struct t_fset_option *fset_option) { + if (!weechat_config_boolean (fset_config_look_show_plugin_description) + && (strcmp (config_name, "plugins") == 0) + && (strcmp (section_name, "desc") == 0)) + { + return 0; + } + if (!fset_option_filter || !fset_option_filter[0]) return 1; |